<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>Pretty cool, David!</p>
    <p>I've been looking for a tool to calculate RCs for an n stage all
      pass network.<br>
    </p>
    <div class="moz-cite-prefix">On 1/5/21 10:46 PM, David G Dixon
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:897DADD1F3CD487DA51EC36B45B712F0@david78c70950b">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <meta name="GENERATOR" content="MSHTML 8.00.6001.23562">
      <div dir="ltr" align="left"><span class="565232304-06012021"><font
            size="2" face="Arial" color="#0000ff">Well, that was easier
            than I thought it would be.</font></span></div>
      <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
      <div dir="ltr" align="left"><span class="565232304-06012021"><font
            size="2" face="Arial" color="#0000ff">I've now got a
            function in Excel that predicts the RC factors for the
            all-pass filters in any 90-degree PDN.  Here is the
            function:</font></span></div>
      <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
      <div dir="ltr" align="left"><span class="565232304-06012021"><font
            size="2" face="Arial" color="#0000ff">PDN90RC(F1, F2, NN, N)</font></span></div>
      <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
      <div dir="ltr" align="left"><span class="565232304-06012021"><font
            size="2" face="Arial" color="#0000ff">I've made it so that
            NN is the number of filter stages in each chain, so half the
            total.  This way, it confines one to an even number of
            filter stages.  So, for the classic 15 Hz to 15 kHz unit
            with 12 filter stages, NN = 6, and the function would be:</font></span></div>
      <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
      <div dir="ltr" align="left"><span class="565232304-06012021"><font
            size="2" face="Arial" color="#0000ff">PDN90RC(15, 15000, 6,
            1) = 0.0301</font></span></div>
      <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
      <div dir="ltr" align="left"><span class="565232304-06012021"><font
            size="2" face="Arial" color="#0000ff">If one sets up
            a column of integers from 1 to 12, and puts the function
            next to that with those cell values as N, then one gets the
            following:</font></span></div>
      <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
      <span class="565232304-06012021">
        <div dir="ltr" align="left">
          <table style="WIDTH: 129pt; BORDER-COLLAPSE: collapse"
            x:str="" width="172" cellspacing="0" cellpadding="0"
            border="0">
            <colgroup> <col style="WIDTH: 60pt" width="80"> <col
                style="WIDTH: 69pt; mso-width-source: userset;
                mso-width-alt: 2616" width="92"> </colgroup><tbody>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; WIDTH: 60pt; HEIGHT:
                  15.75pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8"
                  x:num="" width="80" height="21" align="right"><font
                    face="Arial">1</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; WIDTH: 69pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8"
                  class="xl22" x:num="3.0099754398651757E-2" width="92"
                  align="right"><font face="Arial">3.0100E-02</font></td>
              </tr>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="21" align="right"><font face="Arial">2</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="8.6072053671113532E-3" align="right"><font
                    face="Arial">8.6072E-03</font></td>
              </tr>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="21" align="right"><font face="Arial">3</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="3.8927476000830221E-3" align="right"><font
                    face="Arial">3.8927E-03</font></td>
              </tr>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="21" align="right"><font face="Arial">4</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="1.9037436952639975E-3" align="right"><font
                    face="Arial">1.9037E-03</font></td>
              </tr>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="21" align="right"><font face="Arial">5</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="9.4806261012010803E-4" align="right"><font
                    face="Arial">9.4806E-04</font></td>
              </tr>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="21" align="right"><font face="Arial">6</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="4.7421695335205682E-4" align="right"><font
                    face="Arial">4.7422E-04</font></td>
              </tr>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="21" align="right"><font face="Arial">7</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="2.3739997513812038E-4" align="right"><font
                    face="Arial">2.3740E-04</font></td>
              </tr>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="21" align="right"><font face="Arial">8</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="1.1874647489957513E-4" align="right"><font
                    face="Arial">1.1875E-04</font></td>
              </tr>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="21" align="right"><font face="Arial">9</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="5.9135635335742968E-5" align="right"><font
                    face="Arial">5.9136E-05</font></td>
              </tr>
              <tr style="HEIGHT: 15.75pt" height="21">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="21" align="right"><font face="Arial">10</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="2.8920213818498576E-5" align="right"><font
                    face="Arial">2.8920E-05</font></td>
              </tr>
              <tr style="HEIGHT: 15pt" height="20">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="20" align="right"><font face="Arial">11</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="1.3079633648106397E-5" align="right"><font
                    face="Arial">1.3080E-05</font></td>
              </tr>
              <tr style="HEIGHT: 15pt" height="20">
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; HEIGHT: 15pt;
                  BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" x:num=""
                  height="20" align="right"><font face="Arial">12</font></td>
                <td style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8;
                  BACKGROUND-COLOR: transparent; BORDER-TOP: #ece9d8;
                  BORDER-RIGHT: #ece9d8" class="xl22"
                  x:num="3.7401997187326388E-6" align="right"><font
                    face="Arial">3.7402E-06</font></td>
              </tr>
            </tbody>
          </table>
        </div>
        <div dir="ltr" align="left"> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Arial" color="#0000ff">I have confirmed
              that these are exactly the same values generated by the
              QuadNet program.  The cool thing is that this still works
              if you exchange the two end frequencies, so:</font></span></div>
        <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Arial" color="#0000ff">PDN90RC(15000, 15,
              6, 1) = 0.0301</font></span></div>
        <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Arial" color="#0000ff">Remember that one
              filter chain takes the odd-numbered RC values, and the
              other filter chain takes the even-numbered RC values.</font></span></div>
        <div dir="ltr" align="left"> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Arial" color="#0000ff">Here is the code:</font></span></div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff">----------------------------------------------------------------------</font></span></div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff">Option Base 0<br>
              Function PDN90RC(f1, f2, nn, n)</font></span></div>
        <div> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff">Dim k(8) As
              Double<br>
              Dim kp(8) As Double<br>
              Dim sn(8) As Double</font></span></div>
        <div> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff">Pi =
              3.14159265359<br>
              f = (f1 * f2) ^ (0.5)<br>
              kp(0) = f1 / f2</font></span></div>
        <div> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff">For j = 1 To 8<br>
                k(j) = (1 - kp(j - 1)) / (1 + kp(j - 1))<br>
                kp(j) = (1 - k(j) ^ 2) ^ (0.5)<br>
              Next j</font></span></div>
        <div> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff">sn(8) = Sin((2
              * n - 1) * (Pi / 2) / (4 * nn))<br>
              For j = 7 To 0 Step -1<br>
                sn(j) = (1 + k(j + 1)) * sn(j + 1) / (1 + k(j + 1) *
              sn(j + 1) ^ 2)<br>
              Next j<br>
              cn = (1 - sn(0) ^ 2) ^ (0.5)<br>
              pole = kp(0) ^ (-0.5) * cn / sn(0)</font></span></div>
        <div> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff">PDN90RC = pole
              / (2 * Pi * f)</font></span></div>
        <div> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff">End Function<br>
            </font></span><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff">---------------------------------------------------------------------</font></span></div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff"><font
                face="Arial">The thing to note about this code is that I
                discovered that 8 successive Landen transformations are
                enough to get to k = 0 and k' = 1 from any starting k'
                value, and therefore, sn(u,k) = sin(u).  No matter the
                value of k' (which is F1/F2), this result is always
                reached within 8 transformation steps.  Sometimes, of
                course, it is reached in fewer steps, but I just set the
                number of transformations to 8.  The variables sn(0) and
                cn are the Jacobi elliptic sine and cosine, from which
                the filter poles are calculated directly.</font></font></span></div>
        <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff"><font
                face="Arial">This was fun.</font></font></span></div>
        <div dir="ltr" align="left"><span class="565232304-06012021"></span> </div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff"><font
                face="Arial">Cheers,</font></font></span></div>
        <div dir="ltr" align="left"><span class="565232304-06012021"><font
              size="2" face="Courier New" color="#0000ff"><font
                face="Arial">Doc Sketchy</font> </font></span></div>
      </span><br>
      <div dir="ltr" class="OutlookMessageHeader" lang="en-us"
        align="left">
        <hr tabindex="-1">
        <font size="2" face="Tahoma"><b>From:</b> Synth-diy
          [<a class="moz-txt-link-freetext" href="mailto:synth-diy-bounces@synth-diy.org">mailto:synth-diy-bounces@synth-diy.org</a>] <b>On Behalf Of </b>David
          G Dixon<br>
          <b>Sent:</b> Tuesday, January 05, 2021 6:42 PM<br>
          <b>To:</b> '<a class="moz-txt-link-abbreviated" href="mailto:synth-diy@synth-diy.org">synth-diy@synth-diy.org</a>'<br>
          <b>Subject:</b> [sdiy] 90-degree phase displacement network
          calculations<br>
        </font><br>
      </div>
      <span style="BACKGROUND-COLOR: #ffecb3; COLOR: #000000; FONT-SIZE:
        12px"><span style="BACKGROUND-COLOR: #ffecb3; COLOR: #000000;
          FONT-SIZE: 12px"><span style="PADDING-BOTTOM: 3px;
            LINE-HEIGHT: 1.6; BACKGROUND-COLOR: #ffecb3; FONT-STYLE:
            normal; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; COLOR:
            #000000; FONT-SIZE: 12px; FONT-WEIGHT: normal; PADDING-TOP:
            3px">[<strong>CAUTION:</strong> Non-UBC Email]</span></span></span>
      <div><font size="2" face="Arial"><span class="619271402-06012021">Hello
            SDIY Team,</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">So,
            ever since I've been building Bode frequency shifters, I've
            been curious about how to actually design best-case
            90-degree phase displacement networks.  Here's a brief
            history of my experience with this:</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">First,
            I used the numbers in the Electronotes article, EN-168.</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">Then
            I discovered the QuadNet program on the internet, which
            gives more accurate PDNs than the Electronotes numbers.  </span></font><font
          size="2" face="Arial"><span class="619271402-06012021">However,
            the QuadNet program is a pain to use, and restricts one to
            certain frequency ranges.  For example, you can't have a low
            frequency lower than 1 Hz, or a frequency range higher than
            4 orders of magnitude.  I want to go lower and broader.</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">So,
            the Electronotes method is an approximation to the problem
            reported by Weaver in 1954 (which I tracked down).  It's
            easy to use, but does not give true Chebyshev approximation
            accuracy.</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">I
            contacted the guy who wrote the QuadNet program to see if he
            could give me the source of the math he used in the
            program.  He had forgotten, and didn't have any
            documentation.</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">So,
            I started looking up the original references for this
            problem.  After much hunting, I found Darlington's paper
            from 1950 in the Bell Labs technical journal.  It explains
            the problem, but not in a way in which my tiny brain could
            make immediate use.</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">After a
            bit more searching, I found a Masters thesis by a guy named
            Donald Douglas from 1961, and his references included
            another 1950 paper by a guy named Orchard from a journal
            called Wireless Engineer.  I finally found a PDF of this
            article on the web lastnight, and I have now been able to
            exactly reproduce my designs from QuadNet using the
            techniques in this paper.  Thankfully, there is a very nice
            numerical example in the paper which demonstrates the use of
            the Landen transformation to calculate Jacobi's elliptic
            sine function from circular sines.  With this, it is
            trivially easy to find the correct RC factors for the chains
            of first-degree allpass filters.</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">As
            of now, I can do it very quickly in an Excel spreadsheet,
            but I'm going to write a function subprogram in Visual
            Basic that will make the RC factors available as an Excel
            function -- something like PDN90RC(F1, F2, N, n) where F1
            and F2 are the mininum and maximum frequencies, N is the
            total number of filter stages, and n is the filter stage of
            interest.</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">I'll
            let you all know when I've got the function subprogram
            figured out.  Maybe I'll write a little paper about it as
            well.</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021"></span></font><font
          size="2" face="Arial"><span class="619271402-06012021"></span></font> </div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">Cheers,</span></font></div>
      <div><font size="2" face="Arial"><span class="619271402-06012021">Doc
            Sketchy</span></font></div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Synth-diy mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Synth-diy@synth-diy.org">Synth-diy@synth-diy.org</a>
<a class="moz-txt-link-freetext" href="http://synth-diy.org/mailman/listinfo/synth-diy">http://synth-diy.org/mailman/listinfo/synth-diy</a>
Selling or trading? Use <a class="moz-txt-link-abbreviated" href="mailto:marketplace@synth-diy.org">marketplace@synth-diy.org</a>
</pre>
    </blockquote>
  </body>
</html>