beautypg.com

Motorola DSP96002 User Manual

Page 544

background image

MOTOROLA

DSP96002 USER’S MANUAL

B-25

org y:0

cbuf ds ntaps

org y:10

dsig ds 1

xsig ds 1

org p:$50

start

move #sbuf,r0 ;point to state buffer

move #cbuf,r4 ;point to coefficient buffer

move r4,r5 ;extra pointer

move #ntaps-1,m0 ;mod on pointers

move #ntaps-1,m4

move #ntaps-1,m5

move #-3,n0 ;final adjustment

move #u,d7.s ;adaptation constant

main

fclr d1 y:xsig,d4.s

fclr d0 d4.s,x:(r0)+ y:(r4)+,d5.s

rep #ntaps

fmpy d4,d5,d1 fadd.s d1,d0 x:(r0)+,d4.s y:(r4)+,d5.s

fadd.s d1,d0 x:(r0)-,d4.s y:(r4)-,d5.s

move y:dsig,d1.s

fsub.s d0,d1

fmpy.s d7,d1,d1 x:(r0)+,d4.s

fmpy.s d4,d1,d3 y:(r4)+,d5.s

fadd.s d3,d5 x:(r0)+,d4.s

do #ntaps,cup

fmpy.s d4,d1,d3 d5.s,d0.s y:(r4)+,d5.s

fadd.s d3,d5 x:(r0)+,d4.s d0.s,y:(r5)+

cup

move x:(r0)+n0,d4.s y:(r4)-,d0.s

jmp main

end

The FIR filter requires 1N/coefficient and the coefficient update requires 2N/coefficient for a total of 3N/co-

efficient.