I've been using the Faust programming language a lot lately for experimenting with DSP, and I've been digging into their implementation of an Elliptic (Cauer) Lowpass filter. Here's an example of such a filter with order three.
If you're unfamiliar with Faust, hopefully the example there is still fairly clear: they've designed a 3rd order Cauer filter with the properties listed in the comments and have implemented it as a second order direct form filter feeding into a first order direct form filter with the coefficients as listed.
I understand the analog prototype they've designed with [z,p,g] = ncauer(Rp,Rs,3);
in Matlab/Octave, and I think I have a good understanding of how to factor the transfer function into cascaded first- and second-order filters. What I don't understand is their use of poly
in Octave to find the coefficients there, and why the frequency of this elliptic filter is only governed by the last coefficient in the final first order filter? Intuitively it seems like so many more of those coefficients should depend on the frequency of the filter, especially if we have to consider multiple sample rates. Did they skip some steps here or make some assumptions that I'm missing? Any explanation to my confusion here would be greatly appreciated, thank you!
Update: I find it interesting that in Matlab/Octave I can compute [z,p,g] = ncauer(0.2,60,3); sos=zp2sos(z, p, g)
, deriving coefficients for second order sections without ever specifying the cutoff frequency. Maybe that's where I'm most confused?
lowpass3e(fc) = tf2s(b21,b11,b01,a11,a01,w1) : tf1s(0,1,a02,w1)
defines a function which takes 1 parameter,fc
, and the output is a 2nd order filter (tf2s
) feeding into a 1st order filter (tf1s
). Their coefficients there are specified and defined right underneath in thewith
block. The only reference to the inputfc
argument is in the definition of thew1
coefficient, the last one supplied totf1s
. All of the other coefficients are constant and thus unrelated tofc
it seems. $\endgroup$tf2s()
andtf1s()
havew1
as an argument, so i would expect that both the second-order and first-order IIR filters have coefficients that depend onw1
(and thenfc
.) $\endgroup$