Post on 23-Oct-2015
Digital Signal Processing
Analog Filter Design
1Copyright © 2010, S. K. Mitra
Analog Analog LowpassLowpass Filter Filter SpecificationsSpecifications
• Typical magnitude response of an analog lowpass filter may be given as indicated below
)( ΩjHa
1
2Copyright © 2010, S. K. Mitra
Analog Analog LowpassLowpass Filter Filter SpecificationsSpecifications
• In the passband, defined by , we require
i.e., approximates unity within an error of
)( ΩjHa
pΩ≤Ω≤0
ppap jH Ω≤Ωδ+≤Ω≤δ− ,1)(1
)( ΩjHa
∞≤Ω≤Ωs
∞≤Ω≤Ωδ≤Ω ssa jH ,)(
• In the stopband, defined by , we require
i.e., approximates zero within an error of
pδ±
sδ2
3Copyright © 2010, S. K. Mitra
Analog Analog LowpassLowpass Filter Filter SpecificationsSpecifications
• - passband edge frequency• - stopband edge frequency• - peak ripple value in the passband• - peak ripple value in the stopband• Peak passband ripple
dB• Minimum stopband attenuation
dB
pΩ
sΩ
sδpδ
)1(log20 10 pp δ−−=α
)(log20 10 ss δ−=α
3
4Copyright © 2010, S. K. Mitra
Analog Analog LowpassLowpass Filter Filter SpecificationsSpecifications
• Magnitude specifications may alternately be given in a normalized form as indicated below
4
5Copyright © 2010, S. K. Mitra
Analog Analog LowpassLowpass Filter Filter SpecificationsSpecifications
• Here, the maximum value of the magnitude in the passband assumed to be unity
• - Maximum passband deviation, given by the minimum value of the magnitude in the passband
• - Maximum stopband magnitude
21/1 ε+
A1
5
6Copyright © 2010, S. K. Mitra
Analog Analog LowpassLowpass Filter DesignFilter Design• Two additional parameters are defined -
(1) Transition ratio
For a lowpass filter
(2) Discrimination parameterUsually
s
pkΩΩ
=
121 −=
Ak ε
1<k
11 <<k
6
7Copyright © 2010, S. K. Mitra
Butterworth ApproximationButterworth Approximation
• The magnitude-square response of an N-thorder analog lowpass Butterworth filteris given by
• First derivatives of atare equal to zero
• The Butterworth lowpass filter thus is said to have a maximally-flat magnitude at
12 −N 2)( ΩjHa
Nc
a jH 22
)/(11)(ΩΩ+
=Ω
0=Ω
0=Ω7
8Copyright © 2010, S. K. Mitra
Butterworth ApproximationButterworth Approximation
• Gain in dB is
• As and dB
is called the 3-dB cutoff frequency
210 )(log10)( Ω=Ω jHaG
0)0( =G30103.3)5.0(log10)( 10 −≅−==ΩcG
cΩ
8
9Copyright © 2010, S. K. Mitra
Butterworth ApproximationButterworth Approximation
• Typical magnitude responses with 1=Ωc
0 1 2 30
0.2
0.4
0.6
0.8
1
Ω
Mag
nitu
de
Butterworth Filter
N = 2N = 4N = 10
9
10Copyright © 2010, S. K. Mitra
Butterworth ApproximationButterworth Approximation
• Two parameters completely characterizing a Butterworth lowpass filter are and N
• These are determined from the specified bandedges and , and minimum passband magnitude , and maximum stopband ripple
cΩ
pΩ sΩ21/1 ε+A/1
10
11Copyright © 2010, S. K. Mitra
Butterworth ApproximationButterworth Approximation• and N are thus determined from
• Solving the above we get
cΩ
222 1
)/(11)(
AjH N
cssa =
ΩΩ+=Ω
222
11
)/(11)(
ε+=
ΩΩ+=Ω N
cppa jH
)/1(log)/1(log
)/(log]/)1[(log
21
10
110
10
2210
kkAN
ps=
ΩΩ−⋅= ε
11
12Copyright © 2010, S. K. Mitra
Butterworth ApproximationButterworth Approximation• Since order N must be an integer, value
obtained is rounded up to the next highest integer
• This value of N is used next to determine by satisfying either the stopband edge or the passband edge specification exactly
• If the stopband edge specification is satisfied, then the passband edge specification is exceeded providing a safety margin
cΩ
12
13Copyright © 2010, S. K. Mitra
Butterworth ApproximationButterworth Approximation• Transfer function of an analog Butterworth
lowpass filter is given by
where
• Denominator is known as the Butterworth polynomial of order N
∏ −Ω=
∑+Ω==
=−=
N
Nc
NN
Nc
Na pssdssD
CsH1
10 )()()(
l lll
l
Nep NNjc ≤≤Ω= −+ ll
l 1,]2/)12([π
)(sDN
13
14Copyright © 2010, S. K. Mitra
Butterworth ApproximationButterworth Approximation• Example - Determine the lowest order of a
Butterworth lowpass filter with a 1-dB cutoff frequency at 1 kHz and a minimum attenuation of 40dB at 5 kHz
• Now
which yieldsand
which yields
11
1log10 210 −=⎟⎠⎞
⎜⎝⎛+ ε
25895.02 =ε
401log10 210 −=⎟⎠⎞
⎜⎝⎛
A000,102 =A
14
15Copyright © 2010, S. K. Mitra
Butterworth ApproximationButterworth Approximation• Therefore
and
• Hence
• We choose N = 4
51334.19611 2
1=−= ε
Ak
51 =ΩΩ=
p
sk
2811.3)/1(log)/1(log
10
110 ==kkN
15
16Copyright © 2010, S. K. Mitra
ChebyshevChebyshev ApproximationApproximation• The magnitude-square response of an N-th
order analog lowpass Type 1 Chebyshev filteris given by
where is the Chebyshev polynomialof order N:
)/(11)( 22
2
pNa T
sHΩΩ+
=ε
⎩⎨⎧
>ΩΩ≤ΩΩ
=Ω −
−
1),coshcosh(1),coscos(
)( 1
1
NN
TN
)(ΩNT
16
17Copyright © 2010, S. K. Mitra
ChebyshevChebyshev ApproximationApproximation
• Typical magnitude response plots of the analog lowpass Type 1 Chebyshev filter are shown below
0 1 2 30
0.2
0.4
0.6
0.8
1
Ω
Mag
nitu
de
Type 1 Chebyshev Filter
N = 2N = 3N = 8
17
18Copyright © 2010, S. K. Mitra
ChebyshevChebyshev ApproximationApproximation• If at the magnitude is equal to 1/A,
then
• Solving the above we get
• Order N is chosen as the nearest integer greater than or equal to the above value
sΩ=Ω
2222 1
)/(11)(
ATjH
psNsa =
ΩΩ+=Ω
ε
)/1(cosh)/1(cosh
)/(cosh)/1(cosh
11
1
1
21
kkAN
ps−
−
−
−
=ΩΩ−= ε
18
19Copyright © 2010, S. K. Mitra
ChebyshevChebyshev ApproximationApproximation• The magnitude-square response of an N-th
order analog lowpass Type 2 Chebyshev(also called inverse Chebyshev) filter is given by
where is the Chebyshev polynomialof order N
22
2
)/()/(
1
1)(
⎥⎦
⎤⎢⎣
⎡ΩΩΩΩ
+
=Ω
sN
psNa
TT
jH
ε
)(ΩNT
19
20Copyright © 2010, S. K. Mitra
ChebyshevChebyshev ApproximationApproximation• Typical magnitude response plots of the
analog lowpass Type 2 Chebyshev filter are shown below
0 1 2 30
0.2
0.4
0.6
0.8
1
Ω
Mag
nitu
de
Type 2 Chebyshev Filter
N = 3N = 5N = 7
20
21Copyright © 2010, S. K. Mitra
ChebyshevChebyshev ApproximationApproximation• The order N of the Type 2 Chebyshev filter
is determined from given , , and Ausing
• Example - Determine the lowest order of a Chebyshev lowpass filter with a 1-dB cutoff frequency at 1 kHz and a minimum attenuation of 40 dB at 5 kHz -
)/1(cosh)/1(cosh
)/(cosh)/1(cosh
11
1
1
21
kkAN
ps−
−
−
−
=ΩΩ−= ε
ε sΩ
6059.2)/1(cosh)/1(cosh
11
1== −
−
kkN
21
22Copyright © 2010, S. K. Mitra
Elliptic ApproximationElliptic Approximation• The square-magnitude response of an
elliptic lowpass filter is given by
where is a rational function of order N satisfying , with the roots of its numerator lying in the interval
and the roots of its denominator lying in the interval
)/(11)( 22
2
pNa R
jHΩΩ+
=Ωε
)(ΩNR)(/1)/1( Ω=Ω NN RR
10 <Ω<∞<Ω<1
22
25Copyright © 2010, S. K. Mitra
Elliptic ApproximationElliptic Approximation
• Typical magnitude response plots with are shown below
1=Ω p
0 1 2 30
0.2
0.4
0.6
0.8
1
Ω
Mag
nitu
de
Elliptic Filter
N = 3N = 4
23
26Copyright © 2010, S. K. Mitra
Analog Analog LowpassLowpass Filter DesignFilter Design• Example - Design an elliptic lowpass filter
of lowest order with a 1-dB cutoff frequency at 1 kHz and a minimum attenuation of 40 dB at 5 kHz
• Code fragments used[N, Wn] = ellipord\(Wp, Ws, Rp, Rs, ‘s’\);[b, a] = ellip\(N, Rp, Rs, Wn, ‘s’\);with Wp = 2*pi*1000;
Ws = 2*pi*5000;Rp = 1;Rs = 40;
24
27Copyright © 2010, S. K. Mitra
Analog Analog LowpassLowpass Filter DesignFilter Design
• Gain plot
0 2000 4000 6000-60
-40
-20
0
Frequency, Hz
Gai
n, d
B
Lowpass Elliptic Filter
25
28Copyright © 2010, S. K. Mitra
Design of Analog Design of Analog HighpassHighpass, , BandpassBandpass and and BandstopBandstop FiltersFilters
• Steps involved in the design process:Step 1 - Develop of specifications of a prototype analog lowpass filter from specifications of desired analog filter
using a frequency transformationStep 2 - Design the prototype analog lowpass filterStep 3 - Determine the transfer function of desired analog filter by applying the inverse frequency transformation to
)( sH LP
)(sHLP
)(sHD
)(sHD
)(sHLP26
29Copyright © 2010, S. K. Mitra
Design of Analog Design of Analog HighpassHighpass, , BandpassBandpass and and BandstopBandstop FiltersFilters• Let s denote the Laplace transform variable
of prototype analog lowpass filter and denote the Laplace transform variable of desired analog filter
• The mapping from s-domain to -domain is given by the invertible transformation
• Then
s
s)ˆ(sHD
)ˆ()()ˆ( sFsLPD sHsH ==
)(ˆ 1)ˆ()( sFsDLP sHsH −==
)ˆ(sFs =
)(sHLP
27
30Copyright © 2010, S. K. Mitra
Analog Analog HighpassHighpass Filter DesignFilter Design• Spectral Transformation:
where is the passband edge frequency of and is the passband edge
frequency of• On the imaginary axis the transformation is
ss ppˆΩΩ
=
pΩpΩ
ΩΩΩ
−=Ω ˆˆ pp
)(sHLP)ˆ(sHHP
28
31Copyright © 2010, S. K. Mitra
Analog Analog HighpassHighpass Filter DesignFilter Design
ΩΩΩ
−=Ω ˆˆ pp
Ω
sΩ− ˆ pΩsΩpΩ− ˆHighpass
PassbandPassband Stopband
sΩ− pΩ sΩpΩ−Lowpass
Passband
Stopband StopbandΩ
Ω
0
0
29
Lowpass to Highpass spectral Transformation:
30
32Copyright © 2010, S. K. Mitra
Analog Analog HighpassHighpass Filter DesignFilter Design• Example - Design an analog Butterworth
highpass filter with the specifications: kHz, kHz, dB, dB
• Choose• Then
• Analog lowpass filter specifications: ,, dB, dB
4ˆ =pF 1ˆ =sF40=αs
1.0=α p
1=Ω p
1=Ω p
410004000
ˆˆ
ˆ2
ˆ2===
ππ
=Ωs
p
s
ps F
FFF
1.0=α p 40=αs4=Ωs31
33Copyright © 2010, S. K. Mitra
Analog Analog HighpassHighpass Filter DesignFilter Design• Code fragments used
[N, Wn] = buttord\(1, 4, 0.1, 40, ‘s’\);[B, A] = butter\(N, Wn, ‘s’\);[num, den] = lp2hp(B, A, 2*pi*4000);
• Gain plots
0 2 4 6 8 10-80
-60
-40
-20
0
Ω
Gai
n, d
B
Prototype Lowpass Filter
0 2 4 6 8 10-80
-60
-40
-20
0
Frequency, kHz
Gai
n, d
B
Highpass Filter
32
34Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• Spectral Transformation
where is the passband edge frequency of , and and are the lower and upper passband edge frequencies of desired bandpass filter
)ˆˆ(ˆˆˆ
12
22
pp
op s
ssΩ−ΩΩ+Ω=
pΩ1ˆ pΩ 2ˆ pΩ
)ˆ(sHBP
)(sHLP
33
35Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• On the imaginary axis the transformation is
where is the width of passband and is the passband center frequency of the bandpass filter
• Passband edge frequency is mapped into and , lower and upper passband edge frequencies
w
op BΩ
Ω−ΩΩ−=Ω ˆ
ˆˆ 22
12 ˆˆ ppwB Ω−Ω=oΩ
1ˆ pΩm 2ˆ pΩ±pΩ±
34
36Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
w
op BΩ
Ω−ΩΩ−=Ω ˆ
ˆˆ 22
1ˆ sΩ− oΩ1ˆ sΩ1ˆ pΩ−
BandpassPassbandPassband Stopband
sΩ− pΩ sΩpΩ−Lowpass
Passband
Stopband StopbandΩ
ΩStopband Stopband
0
02ˆ sΩ
2ˆ pΩ− 1ˆ pΩ 2ˆ pΩoΩ− ˆ↓ ↓ ↓ ↓2ˆ sΩ−
35
Lowpass to Bandpass spectral Transformation:
36
37Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• Stopband edge frequency is mapped into and , lower and upper stopband edge frequencies
• Also,
• If bandedge frequencies do not satisfy the above condition, then one of the frequencies needs to be changed to a new value so that the condition is satisfied
sΩ±1ˆ sΩm 2ˆ sΩ±
21212 ˆˆˆˆˆ ssppo ΩΩ=ΩΩ=Ω
37
38Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• Case 1:To make we can either increase any one of the stopband edges or decrease any one of the passband edges as shown below
2121 ˆˆˆˆ sspp ΩΩ>ΩΩ
1ˆ pΩ 2ˆ pΩ1ˆ sΩ 2ˆ sΩ
→ →
←←
Ω
2121 ˆˆˆˆ sspp ΩΩ=ΩΩ
Passband
Stopband Stopband
38
39Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
(1) Decrease tolarger passband and shorter
leftmost transition band(2) Increase to
No change in passband and shorter leftmost transition band
1ˆ pΩ
1ˆ sΩ
221 ˆ/ˆˆ pss ΩΩΩ
221 ˆ/ˆˆ spp ΩΩΩ
39
40Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• Note: The condition can also be satisfied by decreasing which is not acceptable as the passband is reduced from the desired value
• Alternately, the condition can be satisfied by increasing which is not acceptable as the upper stop band is reduced from the desired value
21212 ˆˆˆˆˆ ssppo ΩΩ=ΩΩ=Ω
2ˆ pΩ
2ˆ sΩ
40
41Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• Case 2:To make we can either decrease any one of the stopband edges or increase any one of the passband edges as shown below
2121 ˆˆˆˆ sspp ΩΩ<ΩΩ
1ˆ pΩ 2ˆ pΩ1ˆ sΩ 2ˆ sΩ
→ →
←←
Ω
2121 ˆˆˆˆ sspp ΩΩ=ΩΩ
Passband
Stopband Stopband
41
42Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
(1) Increase tolarger passband and shorter
rightmost transition band(2) Decrease to
No change in passband and shorter rightmost transition band
2ˆ pΩ
2ˆ sΩ
121 ˆ/ˆˆ pss ΩΩΩ
121 ˆ/ˆˆ spp ΩΩΩ
42
43Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• Note: The condition can also be satisfied by increasing which is not acceptable as the passband is reduced from the desired value
• Alternately, the condition can be satisfied by decreasing which is not acceptable as the lower stopband is reduced from the desired value
21212 ˆˆˆˆˆ ssppo ΩΩ=ΩΩ=Ω
1ˆ pΩ
1ˆ sΩ
43
44Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• Example - Design an analog elliptic bandpass filter with the specifications:
kHz, kHz, kHzkHz, dB, dB
• Now and• Since we choose
4ˆ 1 =pF 7ˆ 2 =pF8ˆ 2 =sF
3ˆ 1 =sF1=pα 22=sα
621 1028ˆˆ ×=pp FF 6
21 1024ˆˆ ×=ss FF
2121 ˆˆˆˆ sspp FFFF >
428573724
2
211 .
FFFFp
ssp === kHz
44
45Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• Bandwidth kHz• We choose
• Analog lowpass filter specifications:, , dB, dB
1=Ω p
413725
924)(1
2121 .
)/(BFFFFws
ssss =
×−
=⋅−
=Ω
1=Ω p 4.1=Ωs 1=pα22=sα
725
7247 =−=wB
45
46Copyright © 2010, S. K. Mitra
Analog Analog BandpassBandpass Filter Filter DesignDesign
• Code fragments used[N, Wn] = ellipord\(1, 1.4, 1, 22, ‘s’\);[B, A] = ellip\(N, 1, 22, Wn, ‘s’\);[num, den]
= lp2bp(B, A, 2*pi*4.8989795, 2*pi*25/7);• Gain plot
0 2 4 6 8-60
-40
-20
0
Ω
Gai
n, d
B
Prototype Lowpass Filter
0 5 10 15-60
-40
-20
0
Frequency, kHz
Gai
n, d
B
Bandpass Filter
46
47Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design
• Spectral Transformation
where is the stopband edge frequency of , and and are the lower and upper stopband edge frequencies of the desired bandstop filter
sΩ)(sHLP
2212
ˆˆ
)ˆˆ(ˆ
os
ss ss
sΩ+Ω−ΩΩ=
)ˆ(sHBS
1ˆ sΩ 2ˆ sΩ
47
48Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design• On the imaginary axis the transformation is
where is the width of stopband and is the stopband center frequency of the bandstop filter
• Stopband edge frequency is mapped into and , lower and upper stopband edge frequencies
22 ˆˆˆ
Ω−ΩΩΩ=Ωo
ws
B
12 ˆˆ sswB Ω−Ω=oΩ
1ˆ sΩm 2ˆ sΩ±sΩ±
48
49Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design• Passband edge frequency is mapped
into and , lower and upper passband edge frequencies
pΩ±1ˆ pΩm 2ˆ pΩ±
1ˆ sΩ−oΩ
1ˆ sΩ1ˆ pΩ−
BandpassPassbandPassband
sΩ− pΩ sΩpΩ−Lowpass
Passband
Stopband StopbandΩ
ΩStopband Stopband
0
0
2ˆ sΩ2ˆ pΩ− 1ˆ pΩ 2ˆ pΩoΩ− ˆ↓ ↓ ↓ ↓
2ˆ sΩ−
Passband
49
Lowpass to Bandstop spectral Transformation:
50
50Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design• Also,
• If bandedge frequencies do not satisfy the above condition, then one of the frequencies needs to be changed to a new value so that the condition is satisfied
21212 ˆˆˆˆˆ ssppo ΩΩ=ΩΩ=Ω
51
51Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design• Case 1:• To make we can either
increase any one of the stopband edges or decrease any one of the passband edges as shown below
2121 ˆˆˆˆ sspp ΩΩ>ΩΩ
1ˆ pΩ 2ˆ pΩ1ˆ sΩ 2ˆ sΩ→ →
←←
Ω
2121 ˆˆˆˆ sspp ΩΩ=ΩΩ
Stopband
PassbandPassband
52
52Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design
(1) Decrease tolarger high-frequency passband
and shorter rightmost transition band(2) Increase to
No change in passbands andshorter rightmost transition band
2ˆ pΩ
2ˆ sΩ
221 ˆ/ˆˆ pss ΩΩΩ
221 ˆ/ˆˆ spp ΩΩΩ
53
53Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design• Note: The condition
can also be satisfied by decreasing which is not acceptable as the low-frequency passband is reduced from the desired value
• Alternately, the condition can be satisfied by increasing which is not acceptable as the stopband is reduced from the desired value
21212 ˆˆˆˆˆ ssppo ΩΩ=ΩΩ=Ω
1ˆ pΩ
1ˆ sΩ
54
54Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design• Case 2:• To make we can either
decrease any one of the stopband edges or increase any one of the passband edges as shown below
2121 ˆˆˆˆ sspp ΩΩ<ΩΩ
2121 ˆˆˆˆ sspp ΩΩ=ΩΩ
1ˆ pΩ 2ˆ pΩ1ˆ sΩ 2ˆ sΩ→ →
← ←
ΩStopband
PassbandPassband
55
55Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design
(1) Increase tolarger passband and shorter
leftmost transition band(2) Decrease to
No change in passbands andshorter leftmost transition band
1ˆ pΩ
1ˆ sΩ
121 ˆ/ˆˆ pss ΩΩΩ
121 ˆ/ˆˆ spp ΩΩΩ
56
56Copyright © 2010, S. K. Mitra
Analog Analog BandstopBandstop Filter DesignFilter Design
• Note: The condition can also be satisfied by increasing which is not acceptable as the high-frequency passband is decreased from the desired value
• Alternately, the condition can be satisfied by decreasing which is not acceptable as the stopband is decreased
21212 ˆˆˆˆˆ ssppo ΩΩ=ΩΩ=Ω
2ˆ pΩ
2ˆ sΩ
57