0% found this document useful (0 votes)
38 views25 pages

Filter Design Techniques

This document discusses filter design techniques. It begins by defining a filter and describing the stages of the filter design process, which include specifying desired properties, approximating the specification using a discrete-time system, and realizing the system. It then reviews properties of discrete-time systems such as frequency response and popular frequency responses used for filter design like low-pass, high-pass, and band-pass. The document discusses finite impulse response (FIR) filters and their properties. It also covers linear phase FIR filters and their different types. The document concludes by discussing filter specification and design using optimization techniques like weighted least squares design.

Uploaded by

Ajay Lobo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views25 pages

Filter Design Techniques

This document discusses filter design techniques. It begins by defining a filter and describing the stages of the filter design process, which include specifying desired properties, approximating the specification using a discrete-time system, and realizing the system. It then reviews properties of discrete-time systems such as frequency response and popular frequency responses used for filter design like low-pass, high-pass, and band-pass. The document discusses finite impulse response (FIR) filters and their properties. It also covers linear phase FIR filters and their different types. The document concludes by discussing filter specification and design using optimization techniques like weighted least squares design.

Uploaded by

Ajay Lobo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Filter Design Techniques

• Filter
– Filter is a system that passes certain
frequency components and totally
rejects all others
• Stages of the design filter
– Specification of the desired properties
of the system
– Approximation of the specification using
a causal discrete-time system
– Realization of the system
Review of discrete-
time systems
Frequency response :
• periodic : period = 2π
• for a real impulse response h[k]
Magnitude response H ( e ) is even function

Phase response ∠H (e jω ) is odd function


• example :

1
Nyquist frequency
e jπk = ...,1,−1,1,−1,1,...
0 .5

−π π
0
-4 -2 0 2 4

-5
-4 -2 0 2 4
Review of discrete-
time systems
`Popular’ frequency responses for filter design :
low-pass (LP) high-pass (HP) band-pass (BP)

π π π
band-stop multi-band …

π π π
Review of discrete-
time systems
“FIR filters” (finite impulse response):
B(z) −1 −N
H (z) = N
= b 0 + b1 z + ... + b N z
z
• “Moving average filters” (MA filters)
• N poles at the origin z=0 (hence guaranteed stability)
• N zeros (zeros of B(z)), “all zero” filters
• corresponds to difference equation
y [ k ] = b 0 u [ k ] + b1 u [ k − 1 ] + ... + b N u [ k − N ]
• impulse response
h [ 0 ] = b 0 , h [1] = b1 ,..., h [ N ] = b N , h [ N + 1] = 0 ,...
Linear Phase FIR Filters
Non-causal zero-phase filters :
example: symmetric impulse response
h[-L],….h[-1],h[0],h[1],...,h[L]
h[k]=h[-k], k=1..L

k
frequency response is L
+L L

H (e ) = ∑ h[k ]e
k =− L
− jω . k
= ... = ∑ ak cos(ωk )
k =0

- i.e. real-valued (=zero-phase) transfer function


- causal implementation by introducing (group) delay
Linear Phase FIR Filters
• Causal linear-phase filters = non-causal zero-phase +
delay
example: symmetric impulse response & N even
h[0],h[1],….,h[N]
N=2L (even)
h[k]=h[N-k], k=0..L k
0 N
frequency response is
N L
H (e ) = ∑ h[k ]e
jω − jω . k
= ... = e − jω L
∑a k cos(ωk )
k =0 k =0

= i.e. causal implementation of zero-phase filter, by


introducing (group) delay z − L = e − jωL
z = e jω
Linear Phase FIR Filters
Type-1 Type-2 Type-3 Type-4
N=2L=even N=2L+1=odd N=2L=even N=2L+1=odd
symmetric symmetric anti-symmetric anti-symmetric
h[k]=h[N-k] h[k]=h[N-k] h[k]=-h[N-k] h[k]=-h[N-k]
L ω L
cos( )∑ ak cos(ωk ) je− jωN / 2 sin(ω) a cos(ωk)
L−1
∑ ak cos(ωk ) e
− jωN / 2 − jωN / 2
ω L
e
k =0
2 k =0 ∑k
k =0
j.e − jωN / 2
sin( )∑ ak cos(ωk )
2k =0

zero at ω =π zero at ω = 0, π zero at ω =0

LP/HP/BP LP/BP HP
Linear Phase FIR Filters
u[k]
• efficient direct-form realization. Δ Δ Δ Δ
example: Δ Δ Δ Δ

+ + + + +

bo b1 b2 b3 b4
x x x x x

y[k] + + + +
• PS: IIR filters can NEVER have linear-phase property !
Filter Specification
Ex: Low-pass 1.2
Passband Ripple
1

1−δP 0.8
ωP ωS
0.6 Passband Cutoff -> <- Stopband Cutoff

0.4 Stopband Ripple δS


0.2

0
0 0.5 1 1.5 2 2.5 3
Filter Design Problem
• Design of filters is a problem of
function approximation

• For FIR filter, it implies polynomial


approximation
• For IIR filter, it implies
approximation by a rational function
of z
Filter Design by Optimization
(I) Weighted Least Squares Design :
• select one of the basic forms that yield linear phase
e.g. Type-1
L
jω − jω N / 2
H (e ) = e ∑a
k =0
− jω N / 2
k cos(ωk ) = e A(ω )
• specify desired frequency response (LP,HP,BP,…)
H d (ω ) = e − jωN / 2 Ad (ω )
• optimization criterion is
+π +π

a0 ,..., a L ∫
) − H d (ω ) dω = min ∫ W (ω ) A(ω ) − Ad (ω ) dω
jω 2
ω
2
min W ( ) H ( e
a0 ,..., a L
−π −π
1 4444244443
F ( a0 ,..., a L )

where W (ω ) ≥ 0 is a weighting function


Filter Design by Optimization
F ( a 0 ,..., a L )
644 47444 8
• …this is equivalent to min{ x T Qx − 2 x T p + μ }
x

x T = [a0 a1 ... a L ]
π
Q = ∫ W (ω )c (ω )c T (ω ) dω
0
π
p = ∫ W (ω ) Ad (ω )c (ω ) dω
0

c T (ω ) = [1 cos(ω ) ... cos( Lω ) ]


μ = ...
=standard ‘Quadratic Optimization’ problem
xOPT = Q−1 p
Filter Design by
Optimization 1.2

• Example: Low-pass design 1


Passband Ripple

Ad (ω ) = 1, ω < ω P
0.8
(pass - band)
Passband Cutoff -> <- Stopband Cutoff
Ad (ω ) = 0, ω S ≤ ω ≤ π
0.6
(stop - band)
0.4 Stopband Ripple

optimization function is 0.2

ωP +π 0
0 0.5 1 1.5 2 2.5 3
F ( a0 ,..., aL ) = ∫ A(ω ) − 1 dω + γ . ∫ A (ω )dω = ...
2 2

1
0
442443 1ω4 S
4244 3
pass - band stop - band
i.e.
W (ω ) = ...
Filter Design by Optimization
• a simpler problem is obtained by replacing the F(..) by…
2
⎧ ⎡ a0 ⎤ ⎫
⎪ ⎪
F (a0 ,..., aL ) = ∑ W (ωi ) A(ωi ) − Ad (ωi ) = ∑ W (ωi )⎨cT (ωi ) ⎢⎢ : ⎥⎥ − Ad (ωi )⎬
2

i i ⎪ ⎢⎣aL ⎥⎦ ⎪
⎩ ⎭
where the wi’s are a set of n sample frequencies
The quadratic optimization problem is then equivalent to a least-squares
problem

min Ax − b = min { x T x − 2 xT {
A b + b{
2 T T T
2
A A
{ b}
x x
∑ W (ω i ) c (ω i ) c T (ω i ) ∑ ... ∑ ...
i i i

xLS = (A A)−1 A b
T T Compare to p.12
+++ : simple
--- : unpredictable behavior in between sample frequencies.
Filter Design by Optimization
• …then all this is often supplemented with
additional constraints

Example: Low-pass (LP) design (continued)


pass-band ripple control :
A(ω ) − 1 ≤ δ P , ω < ω P (δ P is pass - band ripple)

stop-band ripple control :


A(ω ) ≤ δ S , ω S ≤ ω ≤ π (δ S is stop - band ripple)
Filter Design by Optimization
Example: Low-pass (LP) design (continued)
a realistic way to implement these constraints, is to impose
the constraints (only) on a set of sample frequencies
ω P1 , ω P 2 ,..., ω Pm in the pass-band
and ω S 1 , ω S 2 ,..., ω Sn in the stop-band
The resulting optimization problem is :
minimize : F ( a ,..., a ) = ...
0 L

x T = [a0 a1 ... aL ]
subject to AP x ≤ bP (pass-band constraints)
AS x ≤ bS (stop-band constraints)
= `Quadratic Linear Programming’ problem
Filter Design by Optimization
(II) `Minimax’ Design :
• select one of the basic forms that yield linear phase
e.g. Type-1 H (e jω ) = e − jωN / 2 a[ k ] cos(ωk ) = e − jωN / 2 A(ω )
L


k =0

• specify desired frequency response (LP,HP,BP,…)


H d (ω ) = e − jωN / 2 Ad (ω )
• optimization criterion is
min max W (ω ) H (e jω ) − H d (ω ) = min max W (ω ) A(ω ) − Ad (ω )
a0 ,...,a L 0≤ω ≤π a0 ,...,a L 0≤ω ≤π

where W (ω ) ≥ 0 is a weighting function


Filter Design by Optimization
• Conclusion:
(I) weighted least squares design
(II) minimax design
provide general `framework’, procedures to
translate filter design problems into standard
optimization problems
• In practice (and in textbooks):
emphasis on specific (ad-hoc) procedures :
- filter design based on ‘windows’
- equi-ripple design
Filter Design using ‘Windows’
Example : Low-pass filter design
• ideal low-pass filter is
⎧1 ω < ωC
H d (ω ) = ⎨
⎩0 ω C < ω < π
• hence ideal time-domain impulse response is π

1 jω sin(ωc k )
∫π H

hd [k ] = (e )e .k
dω = ... = α
2π ωc k
d

• truncate hd[k] to N+1 samples : Non-causal and infinitely long


⎧ hd [ k ] − N /2 < k < N /2
h[ k ] = ⎨
⎩ 0 otherwise
• add (group) delay to turn into causal filter
Filter Design using ‘Windows’
Example : Low-pass filter design (continued)
• note : it can be shown that time-domain truncation corresponds to
solving a weighted least-squares optimization problem with the
given Hd, and weighting function W (ω ) = 1

• truncation corresponds to applying a ‘rectangular window’ :


h[k ] = hd [k ]w[k ]
⎧1 − N /2 < k < N /2
w[ k ] = ⎨
⎩0 otherwise
• +++: simple procedure (also for HP,BP,…)
• --- : truncation in the time-domain results in ‘Gibbs effect’ in the
frequency domain, i.e. large ripple in pass-band and stop-band,
which cannot be reduced by increasing the filter order N.
Filter Design using ‘Windows’
Remedy : apply windows other than rectangular window:
• time-domain multiplication with a window function w[k]
corresponds to frequency domain convolution with W(z) :

h[k ] = hd [k ]w[k ]
H ( z ) = H d ( z ) ∗W ( z )
• candidate windows : Han, Hamming, Blackman, Kaiser,…. (see
textbooks)
• window choice/design = trade-off between side-lobe levels
(define peak pass-/stop-band ripple) and width main-lobe
(defines transition bandwidth)
Windowing Effect

Gibbs phenomenon
Windowing
Equiripple Design
• Starting point is minimax criterion, e.g.
min max W (ω ) A(ω ) − Ad (ω ) = min max E (ω )
a0 ,..., a L 0 ≤ω ≤π a0 ,..., a L 0 ≤ω ≤π

• Based on theory of Chebyshev approximation and the ‘alternation


theorem’, which (roughly) states that the optimal ai’s are such that
the ‘max’ (maximum weighted approximation error) is obtained at
L+2 extremal frequencies…

max E (ω ) = E (ωi ) for i = 1,.., L + 2


0 ≤ω ≤π

…that hence will exhibit the same maximum ripple (‘equiripple’)


• Iterative procedure for computing extremal frequencies, etc.
(Remez exchange algorithm, Parks-McClellan algorithm)
• Very flexible, etc., available in many software packages
• Details omitted here (see textbooks)
Software
• FIR Filter design abundantly available in
commercial software
• Matlab:
b=fir1(n,Wn,type,window), windowed linear-phase FIR design,
n is filter order, Wn defines band-edges, type is
`high’,`stop’,…
b=fir2(n,f,m,window), windowed FIR design based on inverse
Fourier transform with frequency points f and
corresponding magnitude response m
b=remez(n,f,m), equiripple linear-phase FIR design with
Parks-McClellan (Remez exchange) algorithm

You might also like