All the zeros at nyquist (weather 1 or 2 or none) are put in serial prior to the pole. So they are just input to the 1-pole in all 3 cases. For example here is the 1-zero case:Z1202 wrote: ↑Tue May 28, 2019 12:30 pmYou should be able to do with just 1 zero. Your goal 2-pole function should have no more than 2-zeros and (assuming the poles are complex) it should be expressible as an average of two complex 1-poles without any zeros mixed with the input (unfiltered) signal added to that or something like that. Mixing coefficients need to be found out. I'm not sure whether allowing 1-poles to have 1-zero will remove the need to mix in the input signal or not, but you shouldn't have 2 zeros in a 1-pole.
See partial fraction expansion for more detail.
Code: Select all
temp=re;
re = b0*(in0 + in1) + R*(x*re - y*im);
im = R*(x*im + y*temp);
out0 = re;
I tried all cases, no-zeros, 1-zero and 2-zero. In all cases, droping the imaginary part after the 1-pole to relief some CPU, causes the resultant slope to be as shown above. Slightly shallower than expected. Nothing is for free.
The reason I needed the transfer function is because I need to normalize it. i.e. find the b0 coefficient.
On paper, In all cases, weather I include the zeros in the transfer function or not, averaging generates an extra real zero that follows the real component of the poles (i.e not fixed to nyquist). If averaging is really what dropping the imaginary part does (which indeed seams correct), then that shallow slope is probably caused by that extra zero attenuating the poles. Thats all I wanted to say. Not trying to be too picky about it.