This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP_iir question

Hello,

i implement the DSP_iir function from the DSPLib in my code, but the result is incorrect.

I need a 50Hz notch filter. For this, i calculate the coefficients for the filter:

% iir biquads
     1.00000000000000000000    % B0
    -1.99990371426585890000    % B1
     1.00000000000000000000    % B2
    -1.99791607350730670000    % A1
     0.99802035477030926000    % A2


     1.00000000000000000000    % B0
    -1.99990371426585890000    % B1
     1.00000000000000000000    % B2
    -1.99808507103852470000    % A1
     0.99817380517345733000    % A2


     1.00000000000000000000    % B0
    -1.99990371426585890000    % B1
     1.00000000000000000000    % B2
    -1.99901828871528960000    % A1
     0.99913513377724383000    % A2


     1.00000000000000000000    % B0
    -1.99990371426585890000    % B1
     1.00000000000000000000    % B2
    -1.99920827982724810000    % A1
     0.99928756109000716000    % A2

i read the post in http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/112/p/10599/41701.aspx#41701 and see, that B0 is not used, because it was always 1.

I transferred the other coefficients in the Q14 format:

-32764
16383
-32732
16351

-32764
16383
-32735
16353

-32764
16383
-32750
16369

-32764
16383
-32753
16371

i used this coefficients as the coefficients input vector for the DSP_iir function. The code for the IIR filter is the following:

#define BUFFER_SIZE 1024  
#define IIR_COEFF     16
#define IIR_STATES  (
IIR_COEFF / 2) 

for(n=0; n<IIR_STATES; n++) IirState[n] = 0;
for(n=0; n<BUFFER_SIZE+IIR_STATES; n++) ActiveOutBuffer[n] = DSP_iir(ActiveInBuffer[n], IirCoeff1.Coeff,
IIR_COEFF, &IirState[0]);

I see, that the filter change my audio signal, but it was not a 50Hz notch filter.

Have anybody an idea what's wrong?