Professional Documents
Culture Documents
R.C. Maher
x[n-1]
Z-1 h1
x[n-2]
Z-1 h2
x[n-3]
h3
3
H ( z ) hn z n
n 0
Modulo N Modulo N
Buffer Filter state Coefficients
Buffer
Memory Memory
(delay line) (delay line)
Input
Accumulator Output
ECEN4002 Spring 2003 Filter Implementation R. C. Maher 4
FIR Code for 56300
• Filter order ‘n’
• Input and Output in accumulator ‘a’
• r0: samples, r4: coefs, m0 & m4: n-1
move a,x(r0)
clr a x:(r0)+,x0 y:(r4)+,y0
rep #n-1
mac x0,y0,a x:(r0)+,x0 y:(r4)+,y0
macr x0,y0,a (r0)-
b0 b1 z 1 b2 z 2
H z
1 a1 z 1 a2 z 2
1 k1 z 1 k 2 z 2
b0
1 a1 z 1 a2 z 2
• Numerator implements 2 zeros, denominator
implements 2 poles (real or complex conj.)