/********************************************************************* * iir_fixpt_dsplib32.c- C program for IIR filtering (direct-form II) * using C5400 DSP Lib in Section 7.7.7 ********************************************************************** * System configuration: * * in(n) |----------------| out(n) * ---->| Bandpass filter|-----> * |----------------| * *********************************************************************/ #include "math.h" #include "stdio.h" #include "tms320.h" #include "dsplib.h" #include "input3a.h" // for using iircas4 short i; short oflag; // overflow flag DATA gain=17; DATA x1[300]; void main(void) { asm(" STM #0, SWWSR"); /* clear */ for (i=0;i>15); /* compute */ /* (i)300 samples/block oflag=iir32(x1,h,r,&dp,NBIQ, NX); */ /* (ii)75 samples/block if (NX >= 4) { oflag=iir32(x1,h,r,&dp,NBIQ,NX/4); oflag=iir32(&x1[NX/4],h,&r[NX/4],&dp,NBIQ,NX/4); oflag=iir32(&x1[NX/2],h,&r[NX/2],&dp,NBIQ,NX/4); oflag=iir32(&x1[(3*NX)/4],h,&r[(3*NX)/4],&dp,NBIQ,NX/4); } */ /* (iii) sample mode */ for (i=0; i