DSPRelated.com
Forums

IIR filter in VisualDSP

Started by Peter Rosko October 18, 2001
Hello,
can someone tell me, why are different results in arrays in_re3 and in_re5 ?
Here is a part of source code for ADSP21061 (of course, all (remaining too)
variables are declared,defined and set to zeros) :

#include <filters.h>
#define taps 2
float pm a_coeff[taps],b_coeff[taps];
float state[taps+1];

float in_re1_=0,in_re5_=0;
main()
{
for (i=0;i<512;i++) in_re1[i]=sinf(2*pi*t[i]*50)+3.0;

for (i=0; i < taps+1; i++) state[i]=0;

a_coeff[1]=5.788039238732501e-002;
a_coeff[0]=5.788039238732501e-002;
b_coeff[1]= 1;
b_coeff[0]= -8.842392152253499e-001;

for (i=0;i<512;i++)
{
in_re3[i]=iir(in_re1[i],a_coeff,b_coeff,state,taps);
}

for (i=0;i<512;i++)
{

in_re5[i]=in_re1[i]*5.788039238732501e-002+in_re1_*5.788039238732501e-002-in_re5\
_*(-8.842392152253499e-001);
in_re5_=in_re5[i];
in_re1_=in_re1[i];
}
}

compilation is without any error... best regards
Peter Rosko