Professional Documents
Culture Documents
4 Filter Structures
4 Filter Structures
Digital Filters
DSP ALUs designed to do fast MACs
Use Harvard architecture: place filter state
in X memory, filter coefficients in Y
memory
Try to avoid truncation until after all MACs
ECEN4002
Filter Implementation
h0
x[n1]
Z-1
h1
x[n2]
Z-1
h2
x[n-3]
y[n]
h3
3
H ( z ) hn z n
n0
ECEN4002
Filter Implementation
FIR Setup
X Memory
Modulo N
Buffer
Memory
Input
Y Memory
Filter state
Coefficients
(delay line)
(delay line)
Accumulator
ECEN4002
Filter Implementation
Modulo N
Buffer
Memory
Output
4
a,x(r0)
a
#n-1
x0,y0,a
x0,y0,a
ECEN4002
x:(r0)+,x0
y:(r4)+,y0
x:(r0)+,x0
(r0)-
y:(r4)+,y0
Filter Implementation
IIR Filters
IIR (infinite impulse response) filters allow
zeros and poles; FIR allow zeros only. IIR
can be more selective for a given filter order
IIR also called recursive filters: output
depends on past inputs and past outputs
IIR designs are not guaranteed to be stable
IIR filters can be particularly sensitive to
coefficient quantization
ECEN4002
Filter Implementation
Filter Implementation
Overflow Issues
Gain from input to storage nodes in the
filter may exceed unity. This can cause
filter state to be saturated (clipped),
resulting in distortion
Typically must scale down (attenuate) the
input signal, then scale up (amplify) by an
equal amount on the output
ECEN4002
Filter Implementation
Second-Order Sections
High-order filter polynomials involve terms
that are products and sums involving many
poles and zeros. Small roundoff errors
when implementing filter can lead to large
response errors
As with analog filters, it is typical to reduce
sensitivity by using second-order sections
ECEN4002
Filter Implementation
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.)
ECEN4002
Filter Implementation
10
-1
b0
y[n]
Z-1
y[n-1]
Z-1
x[n2]
ECEN4002
b1
b2
Filter Implementation
-a1
Z-1
y[n-2]
-a2
11
Filter Implementation
12
m0 = 2*N-1, m4 = 4*N-1
Initial gain in y1, input in y0, output in a
ECEN4002
Filter Implementation
13
ECEN4002
Filter Implementation
14
ECEN4002
Filter Implementation
15
#$040821,x:M_AAR0
movep
#$012421,x:M_BCR
Filter Implementation
16
Conclusion
DSP chips (including the DSP563xx) are
designed specifically for fast digital filter
implementations
Care must be taken to ensure that the
practical details are addressed:
Coefficient quantization
Overflow and scaling
Computational complexity
ECEN4002
Filter Implementation
17