# [sdiy] 90-degree phase displacement network calculations

David G Dixon dixon at mail.ubc.ca
Wed Jan 6 05:46:54 CET 2021

```Well, that was easier than I thought it would be.

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:

PDN90RC(F1, F2, NN, N)

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:

PDN90RC(15, 15000, 6, 1) = 0.0301

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:

1	 3.0100E-02
2	 8.6072E-03
3	 3.8927E-03
4	 1.9037E-03
5	 9.4806E-04
6	 4.7422E-04
7	 2.3740E-04
8	 1.1875E-04
9	 5.9136E-05
10	 2.8920E-05
11	 1.3080E-05
12	 3.7402E-06

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:

PDN90RC(15000, 15, 6, 1) = 0.0301

Remember that one filter chain takes the odd-numbered RC values, and the
other filter chain takes the even-numbered RC values.

Here is the code:
----------------------------------------------------------------------
Option Base 0
Function PDN90RC(f1, f2, nn, n)

Dim k(8) As Double
Dim kp(8) As Double
Dim sn(8) As Double

Pi = 3.14159265359
f = (f1 * f2) ^ (0.5)
kp(0) = f1 / f2

For j = 1 To 8
k(j) = (1 - kp(j - 1)) / (1 + kp(j - 1))
kp(j) = (1 - k(j) ^ 2) ^ (0.5)
Next j

sn(8) = Sin((2 * n - 1) * (Pi / 2) / (4 * nn))
For j = 7 To 0 Step -1
sn(j) = (1 + k(j + 1)) * sn(j + 1) / (1 + k(j + 1) * sn(j + 1) ^ 2)
Next j
cn = (1 - sn(0) ^ 2) ^ (0.5)
pole = kp(0) ^ (-0.5) * cn / sn(0)

PDN90RC = pole / (2 * Pi * f)

End Function
---------------------------------------------------------------------
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.

This was fun.

Cheers,
Doc Sketchy

_____

From: Synth-diy [mailto:synth-diy-bounces at synth-diy.org] On Behalf Of David
G Dixon
Sent: Tuesday, January 05, 2021 6:42 PM
To: 'synth-diy at synth-diy.org'
Subject: [sdiy] 90-degree phase displacement network calculations

[CAUTION: Non-UBC Email]
Hello SDIY Team,

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:

First, I used the numbers in the Electronotes article, EN-168.

Then I discovered the QuadNet program on the internet, which gives more
accurate PDNs than the Electronotes numbers.  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.

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.

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.

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.

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.

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.

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.

Cheers,
Doc Sketchy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20210105/9231148e/attachment.htm>
```