Practical Frequency-Selective Digital Filter Design
Practical Considerations in Digital Filter Design
Digital Filter Design I
Practical Frequency-Selective Digital Filter Design
Desired filter characteristics are specified in the frequency domain in terms of desired magnitude and phase response of the filter; i.e., H(ω) is specified.
Passband
Dr. Deepa Kundur
Transition band
Passband edge frequency Stopband edge frequency
University of Toronto Stopband
I
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
1 / 63
Practical Considerations in Digital Filter Design
Filter design involves determining the coefficients of a causal FIR or IIR filter that closely approximates the desired frequency response specifications.
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
FIR versus IIR Filters
Linear Phase
2 / 63
Practical Considerations in Digital Filter Design
Passband ripple
Passband ripple Stopband ripple Passband edge frequency Stopband edge frequency
I
FIR filters: normally used when there is a requirement of linear phase I
FIR filter with the following symmetry is linear phase: h(n) = ±h(M − 1 − n)
I
Q: What is linear phase?
n = 0, 1, 2, . . . , M − 1
IIR filters: normally used when linear phase is not required and cost effectiveness is needed I
I
A: The phase is a straight line in the passband of the system.
IIR filter has lower sidelobes in the stopband than an FIR having the same number of parameters if some phase distortion is tolerable, an IIR filter has an implementation with fewer parameters requiring less memory and lower complexity
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
3 / 63
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
4 / 63
Practical Frequency-Selective Digital Filter Design
Practical Considerations in Digital Filter Design
Practical Frequency-Selective Digital Filter Design
Practical Considerations in Digital Filter Design
Linear Phase
Linear Phase
Example: linear phase (all pass system) I Group delay is given by the negative of the slope of the line (more on this soon).
Example: linear phase (all pass system) I Phase wrapping may occur, but the phase is still considered to be linear.
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
5 / 63
Practical Considerations in Digital Filter Design
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
6 / 63
Practical Considerations in Digital Filter Design
Linear Phase
Linear Phase
Example: linear phase (high pass system) I Discontinuities at the origin still correspond to a linear phase system.
Example: linear phase (low pass system) I Linear characteristics only need to pertain to the passband frequencies only.
Passband
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
7 / 63
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
8 / 63
Practical Frequency-Selective Digital Filter Design
Practical Considerations in Digital Filter Design
Practical Frequency-Selective Digital Filter Design
DTFT Theorems and Properties
Practical Considerations in Digital Filter Design
Group Delay Therefore,
Recall, Property Notation:
Linearity: Time shifting: Time reversal Convolution: Correlation:
Time Domain x(n) x1 (n) x2 (n) a1 x1 (n) + a2 x2 (n) x(n − k) x(−n) x1 (n) ∗ x2 (n) rx1 x2 (l) = x1 (l) ∗ x2 (−l)
Wiener-Khintchine:
rxx (l) = x(l) ∗ x(−l)
Frequency Domain X (ω) X1 (ω) X1 (ω) a1 X1 (ω) + a2 X2 (ω) e −jωk X (ω) X (−ω) X1 (ω)X2 (ω) Sx1 x2 (ω) = X1 (ω)X2 (−ω) = X1 (ω)X2∗ (ω) [if x2 (n) real] Sxx (ω) = |X (ω)|2
group delay
Y (ω) X (ω) ∠H(ω) = Φ(ω) H(ω) =
I
e −jωn0
=
−ωn0 = −ω · group delay
group delay ≡ −
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
=
In general (even for nonlinear phase systems),
among others . . .
I
F
n0 ) ←→ Y (ω) = X (ω)e −jωn0 |{z}
y (n) = x(n −
9 / 63
Practical Considerations in Digital Filter Design
dΦ(ω) dω
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
10 / 63
Practical Considerations in Digital Filter Design
Signal Magnitude versus Signal Phase
Linear phase filters maintain the relative positioning of the sinusoids in the filter passband. This maintains the structure of the signal while removing unwanted frequency components.
Q: Why is linear phase important? Q: What can happen when there is loss of phase information? -3
-2
-1
0
1
2
3
-3
-2
-1
0
1
2
3
n
Passband input
linear in passband
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
output
11 / 63
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
12 / 63
Practical Frequency-Selective Digital Filter Design
Practical Considerations in Digital Filter Design
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
13 / 63
Practical Considerations in Digital Filter Design
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
15 / 63
Practical Considerations in Digital Filter Design
14 / 63
Practical Considerations in Digital Filter Design
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
16 / 63
Practical Frequency-Selective Digital Filter Design
Practical Considerations in Digital Filter Design
Practical Frequency-Selective Digital Filter Design
Practical Considerations in Digital Filter Design
Signal Magnitude versus Signal Phase
A: To maintain the original “structure” of a signal in the passband frequency range, linear phase (or close to linear phase) is required.
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
17 / 63
Practical Considerations in Digital Filter Design
Practical Frequency-Selective Digital Filter Design
Linear Phase FIR Filters I
I
18 / 63
Practical Considerations in Digital Filter Design
Linear Phase FIR Filters: Example
As mentioned previously, FIR filters with the following symmetry are linear phase: h(n) = ±h(M − 1 − n)
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Q: Show that h(n) = δ(n) − δ(n − 1) is linear phase by determining the associated phase and group delay. Note: M = 2 and h(n) = −h(1 − n) = −h(M − 1 − n) for n = 0, 1.
n = 0, 1, 2, . . . , M − 1
h(n)
Note that this means that
1
h(n) = +h(M − 1 − n)
1 -7 -6 -5 -4 -3 -2 -1 0
for n = 0, 1, 2, . . . , M − 1, or
2 3 4 5 6 7
n
-1
h(n) = −h(M − 1 − n) For n = 0, h(0) = −h(1 − 0) = 1 and n = 1, h(1) = −h(1 − 1) = −1.
for n = 0, 1, 2, . . . , M − 1. Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
19 / 63
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
20 / 63
Practical Frequency-Selective Digital Filter Design
Practical Considerations in Digital Filter Design
Practical Frequency-Selective Digital Filter Design
Linear Phase FIR Filters: Example
Practical Considerations in Digital Filter Design
Linear Phase FIR Filters: Example
Q: Show that h(n) = δ(n) − δ(n − 1) is linear phase by determining the associated phase and group delay. Note: This system corresponds to: y (n) = = = first difference ⇔
H(ω) =
x(n) ∗ h(n) = x(n) ∗ [δ(n) − δ(n − 1)] x(n) ∗ δ(n) − x(n) ∗ δ(n − 1) x(n) − x(n − 1) (first difference system) dst-time derivative ⇒ highpass filter
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
∞ X
h(n)e −jωn
n=−∞ −jω·0
= 1·e + (−1) · e −jω·1 = 1 − e −jω = e −jω/2 e jω/2 − e −jω/2 = e −jω/2 · 2j sin(ω/2) = 2je −jω/2 sin(ω/2)
21 / 63
Practical Considerations in Digital Filter Design
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
Practical Frequency-Selective Digital Filter Design
Linear Phase FIR Filters: Example
22 / 63
Practical Considerations in Digital Filter Design
Linear Phase FIR Filters: Example
Note: |H(ω)| = |2je −jω/2 sin(ω/2)| = |2| · |j| · |e −jω/2 | · | sin(ω/2)| = 2 · 1 · 1 · | sin(ω/2)| = 2| sin(ω/2)|
Φ(ω) = ∠2je −jω/2 sin(ω/2) −jω/2 = |{z} ∠2 + ∠j + ∠e + |{z} | {z } =0
2
= =
linear in
Dr. Deepa Kundur (University of Toronto) Practical Frequency-Selective Digital Filter Design
23 / 63
=π/2
=−ω/2
=
∠ sin(ω/2) | {z } 0 π
0