Professional Documents
Culture Documents
Lecture 05: Design of Non-Recursive Digital Filters: John Chiverton
Lecture 05: Design of Non-Recursive Digital Filters: John Chiverton
Lecture 05: Design of Non-Recursive Digital Filters: John Chiverton
Filters
John Chiverton
Introduction
Windowing
Filter Parameters
Filter Design
Summary
Outline
Introduction
Windowing
Filter Parameters
Filter Design
Summary
What is a Digital Filter?
( Ω)
Low Pass
t, Y
tpu
Ou
Low Frequencies π Ω
|H ( Ω) |
e
nt S r Tim
em
yst
a
Band Pass
Inv ), Line
aria
H(Ω
Middle Frequencies π Ω
|H ( Ω) |
)
X(Ω
High Pass
ut,
Inp
π Ω
High Frequencies
Non-recursive digital filters
Linear Time
Input, x[n] Output, y[n]
Invariant System
Introduction
Windowing
Filter Parameters
Filter Design
Summary
Moving Average Filters
I Moving average filters are usually implemented non-recursively.
I Moving average filters are interesting as they
I Are useful for some applications
I But the frequency response is not ideal
1
k
if −k/2 ≤ n ≤ k/2
h[n] = ; where k is odd.
0 otherwise
Example
0.2 if −2 ≤ n ≤ 2
h[n] = .
0 otherwise
Moving Average Frequency Responses
k=3 k=5
k=7 k=9
Moving Average Frequency Responses
k=11 k=13
k=15 k=17
Moving Average Frequency Responses and the Sinc
Function
Introduction
Windowing
Filter Parameters
Filter Design
Summary
Ideal Frequency Response Time Domain Representation
What is the time domain representation for the ideal low pass
frequency response?
Recall the inverse Fourier Transform is given by:
Z
1
x[n] = X(Ω) exp(jΩπ)dΩ. (1)
2π 2π
This equation states that any frequency Ω between −Ω1 and +Ω1 can pass
without attenuation (H(Ω) = 1). All other frequencies are stopped altogether.
The time domain representation of (4) is given by
0 −Ω
ZΩ1
1
Zπ Z 1 Zπ
1 1 @
h[n] = H(Ω) exp(jΩπ)dΩ = 0dΩ + 1 × exp(jΩπ)dΩ + 0dΩA
2π 2π
−π −π −Ω1 Ω1
» –Ω1 ! » –Ω1
1 exp(jΩn) 1 exp(jΩn)
= [0]−Ω 1
−π + + [0]πΩ1 =
2π jn −Ω1 2π jn −Ω1
1 1 1
= (exp(jΩ1 n) − exp(−jΩ1 n)) = 2j sin(Ω1 n) = sin(Ω1 n)
2πjn 2πjn πn
Ω1
= sinc(nΩ1 )
π
sin(nΩ1 )
where sinc(nΩ1 ) = nΩ1
is known as the sinc function.
Ideal Low Pass Frequency Response Time Domain
Representation
Example
Q. What is the time domain
impulse response for an ideal
low pass frequency response
filter with Ω1 = π/2?
A.
π π 1 nπ
h[n] = sinc n = sinc
2π 2 2 2
2 1 nπ
= sin
nπ 2 2
1 nπ
= sin .
nπ 2
Ideal Low Pass Frequency Response Time Domain
Representation
Example
Q. What is the time domain
impulse response for an ideal
low pass frequency response
filter with Ω1 = π/2?
A.
π π 1 nπ
h[n] = sinc n = sinc
2π 2 2 2
2 1 nπ
= sin
nπ 2 2
1 nπ
= sin .
nπ 2
h[n] is sampled at discrete
values of n.
Sinc Function
I The Sinc function is the Fourier transform of a square wave or impulse response.
F
⇒
Fourier
F −1
⇐
Inverse
Fourier
I The Sinc function is also the inverse Fourier transform of a square wave.
Ideal Frequency Response Time Domain Representation
A Problem!
The Sinc function continues forever.
A Problem!
The Sinc function continues forever.
Introduction
Windowing
Filter Parameters
Filter Design
Summary
How to Stop the Sinc function early?
(
1 for − window2 width ≤ n ≤ window2 width
w[n] =
0 every where else
So that
(
h[n] for − window2 width ≤ n ≤ window2 width ,
h2 [n] =
0 every where else.
How to Stop the Sinc function early?
(
h[n] for − window2 width ≤ n ≤ window2 width ,
h2 [n] =
0 every where else.
Problem with A Rectangular Window!
F
⇒
Fourier
=
Time Domain Frequency Response (Mag)
F
⇒
Frequency Domain Effect of (Rectangular) Windowing
Ideal Low Pass Filter
Big Window Smaller Window
Introduction
Windowing
Filter Parameters
Filter Design
Summary
Filter Parameters
1.2
1+ δ p
1.0
δp
1−δ p I δp : pass band ripple
0.8
1.2
I δp = 0.12
1+ δ p
1.0
δp I δs = 0.08
1−δ p ∴ Gain at end of pass band
0.8
is 1 − δp = 0.88.
0.6 Gain and attenuation in
decibels (dB):
0.4
1 − δs = 0.08 or -21.94dB.
Tra
Filter Parameters
1+ δ p I δs = 0.08
1.0
δp
Pass band frequencies:
1−δ p
0.8
Ω = 0 to Ωp
0.6
where Ωp = 0.43 radians.
0.4
Transition width:
0.2
Ω = Ωp to Ωs =
δs
δs 0.43 to 0.56 radians.
0.0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
Ω p Ωs frequency Stop band starts at:
Pass Band Stop Band
Widtion
th
Ω = Ωs = 0.56 radians.
i
ns
Tra
Filter Bandwidth
Filter bandwidth defined by:
“Range of frequencies the filter gain is greater than -3dB”.
1.2
As
1.0
Then 0.708
0.6
„ «
gaindB
20
gain = 10 . 0.4
So for 0.2
Introduction
Windowing
Filter Parameters
Filter Design
Summary
Other Window Types for Truncation (Other than
Rectangle)
Introduction
Windowing
Filter Parameters
Filter Design
Summary
Steps for FIR Low Pass Filter Design
Ω1
h[n] = sinc(nΩ1 )
π
Introduction
Windowing
Filter Parameters
Filter Design
Summary
Band Pass FIR Filter Design
Low pass filter H(Ω) can be converted to a bandpass filter by:
I Convolution in frequency domain with delta function δΩ ;
0
I At centre frequency Ω0 .
Band Pass
Ω
−Ωcf Ωcf π
Ω0
Band Pass FIR Filter Design
Low Pass
Low Frequencies π Ω
|H ( Ω) |
High Pass
High Frequencies
High Pass FIR Filter
High Frequencies
High Pass
Ω
π− Ωcf Ω0=π π+ Ωcf
High Pass FIR Filter
Introduction
Windowing
Filter Parameters
Filter Design
Summary
Summary