{ testing shell for FIR filter using real data "firtest.asm" (requires "fircoefs.dat") Analog Devices, Inc. DSP Applications P.O.Box 9106 Norwood, MA 02062 Christoph D. Cavigioli ... 25-Apr-1991 } #define SAMPLES 0x10 #define TAPS 5 .EXTERN fir, fir_init; .SEGMENT /PM pm_data; .VAR coefs[TAPS] = "fircoefs.dat"; { FIR coefficient stored in file } .ENDSEG; .SEGMENT /DM dm_data; .VAR dline[TAPS]; { no need to make this circular } .ENDSEG; .SEGMENT /DM dm_data; .VAR inbuf[SAMPLES]= 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.; .VAR outbuf[SAMPLES]=-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.; .ENDSEG; .SEGMENT /PM rst_svc; initial_setup: jump begin (db); pmwait=0x0021; dmwait=0x8421; .ENDSEG; .SEGMENT /PM pm_code; begin: l1=0; l2=0; l0=TAPS; l8=TAPS; m0=1; m8=1; r0=TAPS; call fir_init (db); { set up the FIR filter DAGs and zero delay line } b1=inbuf; b2=outbuf; b0=dline; b8=coefs; lcntr=SAMPLES, do filtering until lce; call fir (db); { input sample passed in F0, output returned in F0 } r1=TAPS-3; f0=dm(i1,1); filtering: dm(i2,1)=f0; done: jump done; .ENDSEG;