/******************************************************************* * iir_fixpt_dsplib.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 "input1.h" /* for using iircas4 */ /*#include "input2.h" */ /* for using iircas5 */ /*#include "input3.h" */ /* for using iircas51 */ 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=iircas4(x1,h,r,&dp,NBIQ, NX); */ /* (ii)75 samples/block if (NX >= 4) { oflag=iircas4(x1,h,r,&dp,NBIQ,NX/4); oflag=iircas4(&x1[NX/4],h,&r[NX/4],&dp,NBIQ,NX/4); oflag=iircas4(&x1[NX/2],h,&r[NX/2],&dp,NBIQ,NX/4); oflag=iircas4(&x1[(3*NX)/4],h,&r[(3*NX)/4],&dp,NBIQ,NX/4); } */ /* (iii) sample mode */ for (i=0; i