We Should Forget About Small Efficiencies, Say About 97% of The Time: Premature Optimization Is The Root of All Evil. - D. Knuth
We Should Forget About Small Efficiencies, Say About 97% of The Time: Premature Optimization Is The Root of All Evil. - D. Knuth
We should forget about small efficiencies, say about 97% of the time: premature
optimization is the root of all evil. — D. Knuth
Schedule
I Presentations will occur from 6PM to 10:00PM in EECS 1311.
I Your team spokesperson must sign the team up for a 30 minute slot
(20 min presentation).
I All team members must take part in their team’s presentation.
I You may stay for any or all other portions of the presentation
meeting.
I Team should arrive at least 20 minutes before their time slot.
I Team must use powerpoint or other projectable media for your
presentations.
I The presentation must cover each section of the proposal.
I You should put your presentation on a thumb drive and/or email
copy to hero before the meeting.
I We have seen the need for several types of analog filters in A/D
and D/A
I Anti-aliasing filter
I Reconstruction (anti-image) filter
I Equalization filter
I Anti-aliasing and reconstruction require cts time filters
I Discrete time filters are used for spectral shaping
post-digitization.
I There will be round-off error effects due to finite precision.
M Ñ M Ñ
Ä~åÇ=êÉàÉÅí
öeEÑFö Ä~åÇé~ëë öeEÑFö
EåçíÅÜF
M Ñ M Ñ
The above steps are generally not independent of each other. Filter
design is usually an iterative process. The FIR–IIR response
selection step is a major design choice.
-1
Y = (b0 + b1 z −1 + b2 z −2 + · · · + bM z −M )X
= b0 X + b1 (z −1 X) + b2 (z −2 X) + · · · + bM (z −M X)
-1
Y 2
= b0 + b1 z −1 + b2 z −2 + · · · + bM z −M
X
ñ ÄM ó
Y = (b0 + b1 z −1 + b2 z −2 + · · · + bM z −M )X
= b0 X + (b1 X)z −1 + (b2 X)z −2 + · · · + (bM X)z −M
òJN
ÄN
Y
= b0 + b1 z −1 + b2 z −2 + · · · + bM z −M
X
òJN
This is sometimes referred to as the transposed direct
form (TDF) or the broadcast form. ÄO
ÄjJN
òJN
Äj
EECS 452 – Fall 2014 Lecture 8 – Page 9/32 Thurs – 10/4/2012
FIR Direct form hardware implementation
1 + z −1 + · · · + z −N
H(z) = .
N +1
1 − z −(N +1) 1
H(z) =
1 − z −1 N + 1
0.8
0.6
0.4
cients:
0.2
0
P = N + 1.
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
1
Distance to first zero: 1/P .
0.8 Nominal bandwidth: 1/P .
0.6 First side peak at: 3/(2P ).
magnitude,P=4
0.4
First lobe level:
0.2
0
P dB
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5
4 -11.4
1
0.8
8 -13.0
0.6 16 -13.3
magnitude,P=8
0.4
∞ -13.5
0.2
0
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5
f/f s
B(z) b0 + b1 z −1 + · · · + bM z −M
H(z) = =
A(z) 1 + a1 z −1 + · · · + aN z −N
1
= (b0 + b1 z −1 + · · · + bM z −M ) ×
1 + a1 z −1 + · · · + aN z −N
1
= × (b0 + b1 z −1 + · · · + bM z −M )
1 + a1 z −1 + · · · + aN z −N
n, d, d, n,
-1 -1 -1 -1
n, d, d, n,
-1 -1 -1 -1
n, d, d, n,
d, n,
-1 -1 -1
d,1 n,1
d,2 n,2 2
-1 -1 -1
d, n, 2 2
2 2 2
-
d, n,
-1 -1 -1
d, n,
1 + a1 z −1 + · · · + aN z −N
b0 + b1 z −1 + · · · + bM z −M
do not affect the stability of the TF. The zeros can lie
anywhere on the z-plane.
I A TF that has all of its numerator zeros inside of the unit
circle is said to have minimum phase.
I Minimum phase TFs are useful when designing inverse filters,
e.g. FM pre-emphasis and de-emphasis.
y[n] = 1.194y[n−1]−0.436y[n−2]+0.0605x[n]+0.121x[n−1]+0.0605x[n−2]
Use fdatool:
5th order IIR lowpass filter (requires 10 multiply-adds):
10 tap FIR lowpass filter (requires 10 multiply-adds)
Magnitude (dB) and Phase Responses
Magnitude (dB) and Phase Responses 0 0.0164
−20 −1.557
−10 −0.8635
−30 −2.343
Magnitude (dB)
−20 −1.5819
Phase (radians)
Magnitude (dB)
−40 −3.130
−60 −4.703
−40 −3.0188
−70 −5.490
−50 −3.7372 −80 −6.277
0 5 10 15 20 0 5 10 15 20
Frequency (kHz) Frequency (kHz)
,
I Both filters have passband cutoff freq fs /10 = 4800 and unity
average magnitude response over passband.
I Both filters have the same number of multiply-adds.
I IIR has flatter passband, steeper rolloff, and lower sidelobes.
I Q. So why not always use IIR designs?
I A. IIR have disadvantages
I (causal) IIR filters have non-linear phase response.
I IIR filters can be very sensitive to coefficient quantization.
I IIR filters can suffer from severe arithmetic overflow at internal
nodes.
I FIR filter forms (Direct Form and Transposed Direct Form) and
linear phase
I IIR filters forms (Direct Form 1, Direct Form 2 and Canonical
forms)
I IIR vs FIR filter designs