beautypg.com

Motorola DSP96002 User Manual

Page 528

background image

MOTOROLA

DSP96002 USER’S MANUAL

B-9

B.1.12 Nth Order Power Series (Real)

c = SUM (I=0,...,N) { a(I) * b

I

} c = a

N

b

N

+ a

N-1

b

N-1

+ ... + a

1

b

1

+ a

0

Program

ICycles

Words

move #baddr,r4 1 1

move #aaddr,r0 1 1

move y:(r4),d7.s 1 1

fclr d2 x:(r0)+,d0.s y:(r4),d6.s 1 1

do #N,end 2 3

fmpy d6,d7,d1 fadd.s d2,d0 x:(r0)+,d4.s 1 1

fmpy.s d6,d4,d2 d1.s,d6.s 1 1

end

fadd.s d2,d0 1 1

--- ---

Totals:

9 2N+8

(9 2N+8)

B.1.13 2nd Order Real Biquad IIR Filter

w(n) = x(n) - a1 * w(n-1) - a2 * w(n-2)

y(n) = w(n) + b1 * w(n-1) + b2 * w(n-2)

Input sample in d0.

X Memory Order - w(n-2), w(n-1)

Y Memory Order - a2, a1, b2, b1

Program

ICycles

Words

move x:(r0)+,d4.s y:(r4)+,d6.s 1 1

fmpy.s d6,d4,d2 x:(r0)-,d5.s y:(r4)+,d6.s 1 1

fmpy d6,d5,d2 fsub.s d2,d0.s d5.s,x:(r0)+ y:(r4)+,d6.s 1 1

fmpy d6,d4,d2 fsub.s d2,d0 y:(r4),d6.s 1 1

fmpy d6,d5,d2 fadd.s d2,d0 d0.s,x:(r0) 1 1

fadd.s d2,d0 1 1

move d0.s,x:output 1 1

--- ---

Totals: 7 7

(7 7)