IIR filter coefficients for 50Hz notch
Hello,
I am using ADA1761 codec with 48kHz sampling rate. My SigmaStudio project contains the second order double precission IIR filter for which I deliver 'a' and 'b' coefficients calculated in Matlab using iirnotch(w0/(Sfrq/2) , BW/(Sfrq/2) ) where BW = 1.9Hz, w0=50Hz, Sfrq=48kHz.
Matlab coefficients are: b0 = 0.999875660752326, b1=-1.999708490159189, b2=0.999875660752326
a1= -1.999708490159189, a2=0.999751321504651
Using these coefficients in Matlab produces the correct stimulated response (left). When I import these coefficient in SigmaStudio this gives me strange stimulated response (right).
When I import a and b from the text file, SigmaStudio rounds these coefficients to displayed in General Filter Settings edit controls.
Can somebody help me to understand what is wrong?
Wlodek
Hello,
I got the same results with the Stimulus-Probe graph, yet running the filter on a ADAU1761Z board gave much better results, as shown below:
So, though the graph shows only a -5 dB notch, the filter really provides a -34 dB notch. This is from limitations of the Stimulus-Probe tool itself:
It doesn't run a bit-accurate simulation of the DSP core -- instead, it performs complex math on the expected response of the coefficients.
Its x-axis frequency points are rather coarse -- so for example, if one of the points doesn't fall exactly on 50 Hz, it won't show the true maximum attenuation of your filter. This tends to happen with any high-Q filter.
Rest assured that your filter will perform quite well in practice.
Best regards,
Bob
Thanks for a speedy response!
I will perform some tests with real signal and let you konow.
Hello,
I have performed some tests with signal generator (50Hz) connected to my ADAU1761. Indeed IIR notch filter performed much better than Stimulus-Probe graph showed. I got approx. -33 dB on the output.
Thanks again for your help - I will sleep better today.
Please log in to reply.


