Professional Documents
Culture Documents
to accompany
Sanjit K. Mitra
Prepared by
Chowdary Adsumilli, John Berger, Marco Carli, Hsin-Han Ho, Rajeev Gandhi, Martin Gawecki, Chin Kaye
Koh, Luca Lucchese, Mylene Queiroz de Farias, and Travis Smith Copyright © 2011 by Sanjit K. Mitra.
No part of this publication may be reproduced or distributed in any form or by any means, or stored in a
database or retrieval system, without the prior written consent of Sanjit K. Mitra, including, but not
limited to, in any network or other electronic Storage or transmission, or broadcast for distance
learning.
Chapter 10 – Part 1
10.1 For this problem, we have N =71 and ωs −ωp =0.04π and we assume that δp =δs .
⎛⎝
⎜ ⎜⎜ ⎞ ⎠
⎟ ⎟ ⎟ =107114.6()0.04π()/2π[]−13−20
⎛⎝
⎜⎞ ⎠
⎟ =0.0206.
Therefore:
2
/4π2
=710.04π()/(2π) +11.012170.04π()2
/(2π) 2=1.4244.
Solving for:
⎦ ⎥ log 10δs ()
10.2 For this problem, we have N =71 and ωs −ωp =0.04π=Δω. Using Eq. (10.45): αs =2.285Δω()N
+8=2.2850.04π()71+8=28.3871 dB.
⎧ ⎨ ⎩ h HP n []=
2π
H HP
e j ω()
e j ωn d ω−π
π
∫=12π
e j ωn d ω−π
−ωc
∫+12π
e j ωn d ωωc
=12πe j ωn jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ −π
−ωc +12πe
j ωn jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ωc
π=12πe −j ωc n jn −e −j πn jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ +12πe j πn jn −e j ωc n jn ⎡ ⎣ ⎢ ⎢ ⎤
⎦⎥ ⎥ =
sin(πn ) πn −sin(ωn )
πn
h BP n []=
2π
H BP (e j ω) e j ωn d ω−π
∫=12π
e j ωn d ω−ωc 2
−ωc 1
∫+1
2π
e j ωn d ωωc 1
ωc 2∫
=12πe j ωn jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ −ω
c2
−ωc 1+12πe j ωn jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ωc 1
ωc 2
=12πe −j ωc 1n jn −e −j ωc 2n jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ +12πe j ωc 2n jn −e j ωc 1n jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥
sin(ωn ) πn −sin(ωn )
πn
0, ωc 1≤ω≤ωc 2, 1, ωc 2≤≤π. ⎧ ⎨ ⎪
⎩ ⎪ h BS n []=
2π
H BS
(e j ω) e j ωn d ω−π
∫=12π
e j ωn
d ω−π
−ωc 2∫+12π
e j ωn
d ωωc 2
π
∫+12π
e j ωn d ω−ωc 1
ωc 1
12πe j ωn jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ −π
−ωc 2
+12πe j ωn jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥
ωc 2
+12πe j ωn jn ⎡ ⎣ ⎢ ⎢ ⎤
⎦⎥ ⎥
−ωc 1
ωc 1
=12πe −j ωc n jn −e −j πn jn ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ +12πe j πn jn −e j ωc n jn ⎡ ⎣ ⎢ ⎢ ⎤
⎦ ⎥ ⎥ 12πe −j ωc 1n jn −e −j ωc 1n jn ⎡ ⎣ ⎢ ⎢ ⎤
, otherwise. ⎧ ⎨ ⎪ ⎩ ⎪
10.4 The ideal L -band digital filter H ML (z ) has a frequency response given by: H ML (e j ω) =A k , for
ωk −1≤ω≤ωk , 1≤k ≤L .
It can be considered as sum of ideal bandpass filters with cutoff frequencies at: ωc 1k =ωk −1 and ωc
2k =ωk , where ωc 10=0 and ωc 2L =π. From Eqn. (10.19) the impulse response of an ideal bandpass
filter is given by:
h BP [n ]=sin(ωn ) πn −sin(ωn )
πn
.
Therefore: h BP k
[n ]=sin(ωn ) πn −sin(ωn ) πn . .
Hence: h ML [n ]=h BP k
[n ]k =1
⎛⎝⎜
⎞ ⎠ ⎟ k =1
∑ =A 1sin(ωn ) πn −sin(0n ) πn ⎛ ⎝ ⎜⎞ ⎠
⎟+
Ak
sin(ωn )
πn
k =2
L −1∑
−A k sin(ωn ) πn −sin(ωn ) πn ⎛ ⎝ ⎜⎞ ⎠ ⎟ k =2
L −1
⎛ ⎝ ⎜⎞ ⎠ ⎟
=A 1sin(ωn ) πn
A k sin(ωn ) πn k =2
L −1∑−A k sin(ωn ) πn
k =2
L −1
∑−A L sin(ωn )
πn
=A k sin(ωn )
πn
Ak
sin(ωn )
πn
k =2
∑k =1
L −1∑.
sin(ωn )
πn
to the first sum in the above expression and change the index range of the second sum, resulting in:
h ML [n ]=A k sin(ωn )
πn
A k +1
sin(ωn )
πn
k =1
L −1∑k =1
πn
πn
k =1
∑k =1
L∑=
(A k −A k +1)
sin(ωn )
πn
k =1
∑.
10.5 The impulse response for the Hilbert Transformer is given by:
H HT (e j ω
) =j , −π<ω<0, −j , 0<ω<π. ⎧ ⎨ ⎩
Therefore : h HT [n ]=
2π
H HT (e
jω
)e
j ωn
d ω−π0
∫+
12π
H HT (e j ω) e j ωn d ω0
=12π
je j ωn d ω−π
∫−1
2πje j ωn d ω0
∫=
22πn 1−cos(πn ) ()=
πn
, n ≠0.
2π
jd ω−π
0∫
12π
jd ω0
∫=0.
, if n ≠0. ⎧ ⎨ ⎪
⎩⎪
Since h HT [n ]=−h HT [−n ], and the length of the truncated impulse response is odd, it is a
From the frequency response plots given above, we observe the presence of ripples at the band edges
due to the Gibbs phenomenon caused by the truncation of the impulse response.
∑. .
Hence, € F H x [n ]
{}
⎩
(a)Let € y [n ]=H {H {H {H {H {H {x [n ]}}}}}}.
Hence:
Y (e j ω) =
(j ) 6X (e j ω), −π<ω<0,
(– j ) 6X (e j ω), 0<ω<π,
=−X (e j ω).
Therefore, y [n ]=− x [n ].
(b)Define € g [n ]=H x [n ]
Hx[]
{}x [ ]
=– ∞
∑=g [ ]h *[ ]
=– ∞
∑.
g [ ]h *[ ]
=– ∞
∑=1
2π
G (e j ω)
–π
∫G (e j ω) d ω. Therefore:
Hx[]
{}x [ ]
=– ∞
∑=1
2π
H HT (e j ω)
−π
∫X (e j ω) X (e – j ω) d ωwhere H HT (e j ω) =
j , −π<ω<0,
−j , 0<ω<π.
H HT (e j ω)
−π
∫X (e j ω) X (e – j ω) d ω=0.
As a result:
€ H x [ ]{}x [ ] =– ∞∞
∑=0.
10.7 Given the frequency response for the ideal low pass filter: H LP (z ) =h LP [n ]z −n n =0
N
∑.
) +H LP (e
j (ω+π2
It is evident from this figure that H HT (e j ω) is the frequency response of an ideal Hilbert transformer.
Therefore, we have:
H HT (e j ω) =H LP (e
j (ω+π2
) +H LP (e
j (ω−π2
=h LP [n ]e
−jn (ω+π2
n =0N
∑+
h LP [n ]e
−jn (ω−π2
n =0
∑
=
h LP [n ]n =0
⎟ . For n odd, cos(n ω/2)=0 and we can drop all odd terms in the above expression. Let
N =2M with N even and let r =2n . Then, we can rewrite the above equation as:
H HT (e j ω) =
2h LP [2r ]r =0
∑cos(r π) e −j 2r ω.
The corresponding transfer function of the Hilbert transformer is therefore given by:
H HT (z ) =
∑.
10.8 We know that the frequency response of the ideal differentiator is given by:H DIF (e j ω) =j ω.
Hence: h DIF [n ]=12πj ωe j ωn −ππ∫d ω=j 2πωe j ωn −ππ∫d ω=j 2πωe j ωn jn +e j ωn n ⎛ ⎝ ⎜⎜⎞⎠⎟⎟
−ππ. Therefore: h DIF [n ]=cos(πn ) n −sin(πn ) πn
=cos(πn )
Since h DIF [n ]=−h DIF [−n ], the truncated impulse response is a Type 3 linear-phase FIR filter. The
magnitude responses of the above differentiator for several values of M are given below:
10.9 Given that N = 2M + 1, we can write the impulse response of the high pass filter as:
ˆ h HP
⎪⎩
⎪⎪
ˆ H HP (z ) +ˆ H LP
(z ) =ˆ h HP
[n ]z −n
n =−∞
∑+
ˆ h LP
[n ]z −n
n =−∞
∑=
ˆ h HP
[n ]z −n
n =0N −1
∑+
ˆ h LP
[n ]z −n n =0
N −1
∑ =
ˆ h HP [n ]+ˆ h LP
[n ]()z −n n =0
N −1
∑.
⎨
⎩
Hence, ˆ H HP (z ) + ˆ H
LP (z ) =z
10.10 The frequency response of the zero-phase ideal linear passband lowpass filter is:
H LLP (e j ω) =
, <ωc , 0, otherwise. ⎧
h LLP [n ]=
2π
−ωe j ωn d ω
−ωc
∫+ωe j ωn d ω0
ωc
∫⎛
⎞⎠⎟
2π
ωe j ωn
jn
e j ωn
– ωc
ωe j ωn
jn
e j ωn n
⎤ ⎦ ⎥ ⎥ 0ωc ⎛
⎜⎜
⎞⎠⎟
⎟⎟
=
1
2π
ωe j ωc n −ωe −j ωc n
jn
e j ωc n +e −j ωc n −2 n
⎜⎜
⎞⎠⎟⎟
=ω
πn
sin(ωc n ) +
cos(ωn ) −1πn .
10.11 The frequency response of the zero-phase ideal band-limited differentiator is:
H BLDIF (e j ω) =
ω, <ωc , 0, otherwise. ⎧
h BLDIF [n ]=
2π
ωe j ωn d ω
−ωc
ωc
∫=1
2π
ωe j ωn
jn
e j ωn n
⎤ ⎦ ⎥ ⎥ −ωc ωc ⎛
⎜⎜
⎞⎠⎟
⎟⎟
2π
ωe j ωc n +ωe −j ωc n
jn
e j ωc n −e −j ωc n n
⎜⎜
⎞⎠⎟⎟
=– j ω
πn
cos(ωc n ) +j
πn 2
sin(ωc n ).
10.12 The frequency response of a causal ideal notch filter can thus be expressed as:
€ H notch (e j ω) =
where €
H notch (ω) =
1, 0≤ω≤ωo ,
−1, ωo <ω<π.
H LP (ω) −1]. Hence, the impulse response of the ideal notch filter is given by h notch [n ]=±2h LP [n
]−δ[n ]
[], where: h LP [n ]=
sin(ωn )
πn
, −∞<n <∞.
Therefore: h notch [n ]=
±1, n =0,
2sin(ωn )
πn
, otherwise.
⎩⎪
G (e j ω) =
0, 0≤ω≤ωp ,
−π
2Δω
sin
π(ω−ωp )
Δω
⎟, ωp <ω≤ωs ,
−π
2Δω
sin
π(ω+ωp )
Δω
⎞
⎠
⎟, −ωs ≤ω≤−ωp ,
0, elsewhere.
Clearly: G (e j ω) =
dH (e j ω)
dω
g [n ]=
2π
G (e j ω) e j ωn d ω
−π
−π
8πΔωj
j
π(ω−ωp )
Δω
⎜⎜
⎟⎟
e j ωn d ω
ωp
ωs
∫−e −j
π(ω−ωp )
Δω
⎜⎜
⎟⎟
e j ωn d ω
ωp
ωs
⎜⎜
+e
π(ω+ωp )
Δω
⎜⎜
⎟⎟
e j ωn d ω
−ωs
−ωp
∫−e −j
π(ω+ωp )
Δω
⎜⎜
⎟⎟
e j ωn d ω
−ωs
−ωp
⎟
⎟
⎟⎟
−1
j 8Δω
j πωp
Δω
j ωs n +
Δω
−e
j ωp n +
Δω
⎟)
jn+
Δω
−e
j πωp
Δω
e
j ωs n −
Δω
−e
j ωp n −πΔω⎛
⎞⎠⎟
jn−
Δω
⎤⎦⎥
⎥⎥⎥
+e j πωp Δωe −j ωp n +πΔω⎛ ⎝ ⎜ ⎞ ⎠ ⎟ −e −j ωs n +πΔω⎛ ⎝ ⎜ ⎞ ⎠ ⎟ j n +πΔω⎝ ⎜ ⎠ ⎟ ⎡ ⎣ ⎢ ⎢ ⎢ ⎢
⎤ ⎦ ⎥ ⎥ ⎥ ⎥ −e −j πωp Δωe −j ωp n −πΔω⎛ ⎝ ⎜ ⎞ ⎠ ⎟ −e −j ωs n −πΔω⎛ ⎝ ⎜ ⎞ ⎠ ⎟ j n −πΔω⎝ ⎜ ⎠ ⎟
⎡ ⎣ ⎢ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥ ⎥ ⎞ ⎠ ⎟ ⎟ ⎟ ⎟ =−14Δωj −sin(ωs n ) −sin(ωp n ) n +πΔω⎝ ⎜ ⎠ ⎟ −
⎟⎟⎟ =
−2π/Δωn 2−πΔω⎛ ⎝ ⎜ ⎜⎜ ⎜ ⎞
g [n ].
⎜⎞ ⎠ ⎟ sin(ωn ) πn ⎛ ⎝ ⎜⎞
⎠⎟.
H t e j ω()−H d e j ω()
2d ω−π
π∫, , where
Hte
jω
()
h t n []e −j ωn n =−M
∑.
Using Parseval’s relation, we can write: ΦR =h t n []−h d n []2n =−∞
h t n []−h d n []2
h d 2n []n =−∞−M −1
∑+h d 2n []n =M +1
n =−M
⎟ −h d n []2n =−M
+h d
2n []n =−∞
−M −1
∑+h d 2
n []n =M +1∞
h d n []⋅ 12+12
n =−M
=−
h n []
n =−M
=121+2M ()cos 2πM 2M +1⎛ ⎝ ⎜⎞ ⎠ ⎟ −2. 10.15 For a Hamming window: ΦHamm =
∑. Recall
ΦR =
∑.
10.16 The responses of an ideal lowpass filter with a cutoff frequency ωc =π/2 are:
H HB (e j ω
The frequency responses of the Hilbert Transformer (from Eq. (10.24)) and the ideal discrete-time
Differentiator (from Eq. (10.26)) are as follows:
H HT (e j ω
) =j , −π<ω<0, −j , 0<ω<π. ⎧ ⎨ ⎩
H DIF (e j ω) =j ω. In order to get derive the impulse response of the Hilbert Transformer, we note that:
H HT (e j ω) =jH HB (e j ω−π/2()) −jH HB (e j ω+π/2()). Therefore, using the properties of the DTFT, we
get: h HT n []=jh HB [n ]e jn (π/2) −jh HB [n ]e −jn (π/2)
⎠ ⎟ . In order to derive the impulse response of the Differentiator, we note that: H DIF (e j ω) =j ωH HB
(e j ω−π/2()) +j ωH HB (e j ω+π/2()).
∂n
x [n ]⇔
j ωX e j ω()
∂n
h HB [n ]e −jn (π/2) ()
πn
10.17 For each problem, the codes used to generate the plots are given below, assuming that ωc
fRange = -M:M;
plot(w/pi,20*log10(abs(h)));grid;
From Table 10.2, we see that for fixed-window functions, we can achieve the minimum stopband
attenuation by using Hann, Hamming, or Blackman windows. Hann will have the lowest filter length:
Since M =3.11π
0.16π
The corresponding frequency response, generated with the code, is shown below:
Thus: Δω=0.11π,
αs
From Table 10.2, we see that for fixed-window functions, we can achieve the minimum stopband
attenuation by using Hann, Hamming, or Blackman windows. Hann will have the lowest filter length:
Since M =3.11π
0.16π
The corresponding frequency response, generated with the code, is shown below:
10.18 The code for the plotting of the frequency response is as follows:
fRange = -M:M;
idealBPF = (wc2/pi)*sinc((wc2/pi)*fRange)... -(wc1/pi)*sinc((wc1/pi)*fRange); fNum =
idealBPF.*hann(L)'; [h,w] = freqz(fNum,1,512);
plot(w/pi,20*log10(abs(h)));grid;
From Table 10.2, we see that the Hann window will have minimum length and meet the minimum
stopband attenuation. We can use the smaller stopband, so that it definitely meets
0.15π
=20.733.
Therefore
wp1 = 0.4*pi;
wp2 = 0.55*pi;
ws1 = 0.25*pi;
ws2 = 0.75*pi;
dp = 0.002;
ds1 = 0.006;
ds2 = 0.008;
as1 = -20*log10(ds1);
as2 = -20*log10(ds2);
diff = min(diff1,diff2);
wc1 = (wp1+ws1)/2;
wc2 = (wp2+ws2)/2;
M = 3.11*pi/diff;
L = 2*ceil(M) + 1;
[as1 as2 M L]
M = ceil(M);
fRange = -M:M;
fNum = idealBPF.*hann(L)';
[h,w] = freqz(fNum,1,512);
plot(w/pi,20*log10(abs(h)));grid;
From Table 10.2, we see that the Hann window will have minimum length and meet the minimum
stopband attenuation. Again, can use the smaller stopband, so that it definitely
0.17π
=31.1.
w GC
⎠⎟⎡ ⎣ ⎢ ⎤ ⎦
⎠ ⎟ +e −j 4πn 2M +1⎛ ⎝ ⎜⎞ ⎠ ⎟ ⎛ ⎝ ⎜ ⎜ ⎜ ⎞ ⎠ ⎟ ⎟ ⎟
⎡ ⎣ ⎢ ⎢ ⎢ ⎤ ⎦
⎟⎟⎟
⎛ ⎝ ⎜⎞ ⎠ ⎟ sin(ω/2)
⎜⎞⎠⎟
⎛ ⎝ ⎜⎞ ⎠ ⎟
sin(ω/2)
⎜⎞⎠⎟
⎛ ⎝ ⎜⎞ ⎠ ⎟ sin(ω/2)
⎟ +sin (2M +1) ω2+π2M +1⎛ ⎝ ⎜⎞ ⎠ ⎟ ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ sin ω2+π2M +1⎝ ⎜⎠ ⎟ +0.16sin (2M +1)
ω2−2π2M +1⎛ ⎝ ⎜⎞ ⎠ ⎟ ⎛ ⎝
⎜⎞⎠⎟
⎜⎞⎠⎟
⎟.
∑.
N2
∑,
Then: P k t ()=t −t t k −t l ⎛
⎝ ⎜⎞
⎠⎟
l =−N 1l ≠k
N 2∏
H z ()=
h n []z
−n n =0
∑.
D −k
n −k k =0k ≠n
for 0≤n ≤N .
H z ()≈
h n []z −n n =0
21
∑,
where h n []=
90/13−k
n −k k =0
k ≠n
21
. % Problem #10.21
D = 90/13; N = 21;
for n = 0:N,
for k = 0:N, if n ~= k,
h = prod(tmp');
figure(1);
plot(W/pi, Gd);
H comb (e j ω
A k k =0
A k k =0M
r [n −D ]=
A k k =0
1−ρD z
−D
Thus: H c (e j ω
)=
1−e −jD ω
1−ρe
1−ρ
cos(D ω) +j ρD
sin(D ω)
Then: H c (
e j ω) =
(d) The realization is shown below, and includes only a single delay and two additions.
x[n]
y[n]
z –D
Q (z )
1−N (z ) 1−0.9D
N (z )
for k = 0:N, if n ~= k,
h = prod(tmp');
H c (z ) =P (z ) Q (z ) =D (z ) −z −11D (z −1)
D (z ) −0.9z D (z )
with D =2π/0.16π
for n = 0:N,
plot(w/pi, abs(H));grid;
xlabel('\omega/\pi');
ylabel('Magnitude' );
10.25 We start with the expression for the low pass filter, derived from Figure 10.13(a):
H LP (e j ω) =
1, −ωp ≤ω≤ωp , 1−
ω−ωp
ωs −ωp
⎜⎜
⎟⎟, ωp <ω≤ωs , 1+
ω+ωp
ωs −ωp
⎜⎜
h LP [n ]=
2π
H LP (e j ω) e j ωn d ω−π
π
∫
2π
e j ωn d ω
−ωp
ωp
∫+1−ω−ωp
Δω
⎟e j ωn d ω+1+
ω+ωp
Δω
⎟e j ωn d ω−ωs
−ωp
ωp
ωs
⎡
⎣
⎤⎦⎥⎥⎥
2π
e j ωn d ω
−ωs
ωs
∫−ω−ωp
Δω
e j ωn d ω+
ω+ωp
Δω
e j ωn d ω−ωs
−ωp
ωp
ωs
⎦⎥⎥⎥
=
2π
2sin(ωn )
πn
Δω
(ω−ωp ) e j ωn
jn
e j ωn
ωp
ωs
+
1
Δω
(ω+ωp ) e j ωn
jn
e j ωn
⎤ ⎦ ⎥ ⎥ – ωs – ωp ⎫ ⎬ ⎪ ⎭ ⎪
2π
2sin(ωn )
πn
Δω
Δωe j ωs n
jn
e j ωs n −e j ωp n
−Δωe −j ωs n
jn
−
e −j ωp n −e −j ωs n n
⎤⎦⎥⎥⎧
⎩⎪
⎫⎬⎪⎭⎪
2π
2sin(ωn )
πn
Δω
Δωsin(ωn )
cos(ωs n ) −cos(ωp n ) n
⎤⎦⎥⎧
⎫⎬⎭
=
Δω
cos(ωp n )
πn
cos(ωn ) πn ⎧
⎫⎬⎭
Δω
cos((ω−Δω/2)n )
πn
cos((ω+Δω/2)n ) πn
⎫⎬⎭
= 2sin(Δωn /2)
Δω
sin(ωn )
πn
h LP [0]=
1
2π
H LP (e j ω) d ω
−π
∫=1
2π
2(ωs +ωp ) 2
=ωπ.
h LP [n ]=
Δωn
sin(ωn )
πn
, if n ≠0. ⎧
G (e j ω) = d H (e j ω)
dω
0, −ωp ≤ω≤ωp , –
Δω
, ωp <ω<ωs , 1
Δω
⎪⎪
g [n ]=
2π
G (e j ω) e j ωn d ω
–π
∫=1
2π
Δω
– ωs
– ωp
∫e j ωn d ω−1
2π
Δω
ωp
ωs
∫e j ωn d ω
=
2πΔω
−ωs
−ωp
e j ωn
jn
ωp
ωs
e j ωn
jn
j πn Δω
Thus: h LP [n ]=j
s +Δω2⎛ ⎝ ⎜ ⎞ ⎠ ⎟ n ⎛ ⎝ ⎜ ⎞
πn
, for n ≠0.
ωπ
10.26 Consider the case when the transition region is approximated by a second order spline. In this
case, the ideal frequency response can be constructed by convolving an ideal, no-transition-band
frequency response with a triangular pulse of width Δω=ωs −ωp , which in turn can be obtained by
convolving two rectangular pulses of width Δω/2. In the time
domain this implies that the impulse response of a filter with transition band approximated by a second
order spline is given by the product of the impulse response of an ideal low pass filter with no transition
region and square of the impulse response of a rectangular pulse.
Δωn /4
Thus, for a lowpass filter with a transition region approximated by a second order spline:
h LP [n ]=ωπ
h LP [n ]=ωπ
k =−L
∑.
For L =5. we first fit the data set {x [k ]} for each of −5≤k ≤5, to the polynomial x a (t ) =α0+α1t with a
minimum mean-square error at €
t =−5, −4, … , −1,0,1, … ,5, and then replace x [0] with a new value [0]=x (0)=α0. The mean-square error
is then given by:
∑.
We set:
∂α1
=0,
k =−55
11
x [k ].k =−5
5
∑
11
x [k ]k =−5
length 11.
(b) N = 1 and hence, x a (t ) =α0+α1t +α2t 2. Here, we fit the data set {x [k ]} for each of
−5≤k ≤5, to the polynomial x a (t ) =α0+α1t +α2t 2 with a minimum mean-square error at
t =−5, −4, … , −1,0,1, … ,5, and then replace x [0] with a new value [0]=x a (0)=α0. The mean-square
error is now given by:
x [k ]−α0−α1k −α2k
2()2
k =−5
∑.
We set:
α2=0,
which yields:
11α0+110α2=
x [k ],
k =−5
110α1=k x [k ],
k =−5
110α0+1958α2=k 2x [k ].
k =−5
α0=1958
x [k ]5∑−110k 2x [k ]
∑(1958×11) −(110)=1429
∑x [k ].
Hence, here we replace x [n ] with a new value x '[n ]=α0 which is a weighted combination of the
original data set:
x '[n ]=
429
∑x [n −k ]
(c) The impulse response of the FIR filter of Part (a) is given by
h 1[n ]=1
11
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1{},
whereas, the impulse response of the FIR filter of Part (b) is given by:
h 2[n ]=1
429
H 1(e
jω
) =111
−j ωk
k =−5
∑,
H 2(e
jω
) =1429
∑.
A plot of the magnitude responses of these two filters are shown below from which it can be seen that
the filter of Part (b) has a wider passband and thus provides smoothing over a larger frequency range
than the filter of Part (a).
y [n ]=1
320
jω
)=
Y (e j ω) X (e
j)
320
46e −j 2ω+67e −j ω+74 +67e j ω+46e j 2ω+21e j 3ω+3e j 4ω−5e j 5ω−6e j 6ω−3e j 7ω}
=1160
The magnitude response of the above FIR filter H 3(z ) is plotted below (solid line) along
with that of the FIR filter H 2(z ) of Part (b) of Problem 10.27 (dashed line). Note that both filters have
roughly the same passband but the Spencer's filter has very large attenuation in the stopband and
hence it provides better smoothing than the filter of Part (b).
(a)
P (x ) =α1x +α2x 2+α3x 3. Now P (0)=0 is satisfied by the way P (x ) has been defined. Also to ensure P
(1)=1 we require α1+α2+α3=1. Choose m =1 and n =1. Since dP (x )
dx x =0
dP (x )
dx x =1
P (1)=1⇒α1+α2+α3+α4=1. Also, dP (x )
d 2P (x ) dx
x =0
dP (x )
dx x =1
=0⇒α1+2α2+3α3+4α4=0.
Solving the above four simultaneous equations we get α1=0, α2=0, α3=4, α4=−3. Therefore, P (x )
=4x 3− 3x 4.
(c) Hence, P (x ) =α1x +α2x 2+α3x 3+α4x 4+α5x 5. Choose m =2and n =2. Following a procedure
similar to that in parts (a) and (b) we get α1=0, α2=0, α3=10, α4=−15, α5=6. Therefore P (x ) =10x 3−
15x 4+6x 5.
j ωk
) =H (e
j 2πk /M
H [k ]W M
−kn
k =0
Now, H (z ) =h [n ]z −n n =0M −1
∑=
H [k ]W M
−kn k =0
M −1
∑z −n
n =0M −1∑
=1M
⎠ ⎟ ⎟ k =0
M −1
∑. We can write
WM
−kn z −n n =0
M −1
∑−W M −kn z −n
n =M
=W M −kn z −n
n =0
−W M −kM z
−M W M −kn z −n
n =0∞
=1−z −M
)W M −kn z −n
n =0
∞
1−z −M
1−W M z
Therefore, H (z ) =
1−z
−M M
H [k ]
1−W M z k =0
M −1
x[n]y[n]
H [k ]
1−W M z
k =0
M −1
∑=1
H [k ]W M −kn z −n n =0
M −1
∑⎛
⎜
⎜
⎞⎠⎟⎟k =0
M −1
∑.
H [k ]W M −kn e −j ωn
n =0
M −1
k =0
M −1
∑. For
ω=j 2π /M ,
W M −kn e −2π n /M n =0
M −1
∑
⎛
⎞⎠⎟⎟k =0
M −1
=H [k ]
W M −kn W M n
n =0
M −1
k =0
M −1
=H [k ]
1
M
W M −(k − ) n
n =0
M −1
k =0
M −1
W M −(k − ) n
n =0
M −1
∑=1, if =k ,
0, otherwise.
Hence,
€
H (e j 2π /M ) =H [ ].
−j
ω(M −1)
2H (e j ω Since in the frequency sampling approach we sample the DTFT H (e j ω) at points given by ω=
2πk
, 0≤k ≤M −1,
therefore H [k ]=H (e j 2πk /M ) =H d (e j 2πk /M ) e j 2πk (M −1) /M , 0≤k ≤M −1. Since the filter is of
Type 1, M − 1 is even, thus, e j 2πk (M −1) /2=1. . Moreover, h [n ] being real,
H [k ]=
, M +3
, … , M −1.
⎩⎪
€ H [k ]=
,
H d (e j 2πk /M ) e −j 2π(M −k )(M −1) /2M , k =M
+1, … , M −1. ⎧
10.32 We design a linear phase FIR lowpass filter of length 21 using the frequency sampling approach
with passband edge at ωp =0.6π.
(a) From the length, we can determine that the frequency spacing between 2 consecutive DFT samples is
given by 2π/21 = 0.2992. The desired passband edge is between the
frequency samples at ω = 2π(6/21) and ω = 2π(7/21), and again between ω = 2π(13/21) and ω =
2π(14/21) for the other side of the frequency axis. We then simply use the corresponding shifted
impulse responses for those frequencies within the low pass range of this set:
()k , and leave the rest of the coefficients as zero. Therefore, the 21-point DFT is given by:
H [k ]=
e −j (2π/21)10k , k ∈0,...,6
[]
[] {}. ⎧
⎩⎪
A 21-point IDFT of the above DFT samples yields the impulse response coefficients given below in
ascending powers of z − 1:
Columns 1 through 11
0.0414 0.0000 0.0443 0.0476 0.0000 0.0606 0.0732 0.0000 0.1399 0.2767 0.6667
Columns 12 through 21
0.2767 0.1399 0.0000 0.0732 0.0606 0.0000 0.0476 0.0443 0.0000 0.0414
(b) The program for finding and plotting the magnitude response is as follows:
% Problem #10.32
clear;
clc;
N = 21;
index = 1;
for k = 0:6,
end
for k = 7:13,
H(index) = 0;
index = index + 1;
end
for k = 14:20,
end
h = ifft(H);
figure;
10.33 We design a linear phase FIR lowpass filter of length 37 using the frequency sampling approach
with passband edge at ωp =0.45π.
(a) From the length, we can determine that the frequency spacing between 2 consecutive DFT samples is
given by 2π/37 = 0.1698. The desired passband edge is between the
frequency samples at ω = 2π(8/21) and ω = 2π(9/21), and again between ω = 2π(28/21) and ω =
2π(29/21) for the other side of the frequency axis. We then simply use the corresponding
shifted impulse responses for those frequencies within the low pass range of this set:
()k , and leave the rest of the coefficients as zero. Therefore, the 37-point DFT is given by:
H [k ]=
e −j (2π/37)10k , k ∈0,...,8
[]
[] {}. ⎧
⎩⎪
A 21-point IDFT of the above DFT samples yields the impulse response coefficients given below in
ascending powers ofz − 1:
Columns 1 through 11
0.0203 0.0153 0.0247 0.0094 0.0285 0.0026 0.0317 0.0057 0.0344 0.0161 0.0366
Columns 12 through 22
0.0303 0.0383 0.0528 0.0396 0.0995 0.0403 0.3161 0.4595 0.3161 0.0403 0.0995
Columns 23 through 33
0.0396 0.0528 0.0383 0.0303 0.0366 0.0161 0.0344 0.0057 0.0317 0.0026 0.0285
Columns 34 through 37
(b) The program for finding and plotting the magnitude response is as follows:
% Problem #10.33
clear;
clc;
N = 37;
index = 1;
for k = 0:8,
H(index) = exp(-1i*((2*pi)/N)*((N-1)/2)*k);
index = index + 1;
end
for k = 9:28,
H(index) = 0;
index = index + 1;
end
for k = 29:36,
end
length(H)
h = ifft(H);
figure;
H (ω) =c [k ]sin(ωk ). k =1
∑ Now
H (π−ω) =c [k ]sin(π−ω) k
()
k =1
∑=−c [k ]sin
k =1
M
k =1
Thus,
H (ω) =
k =1
k =1
∑ or equivalently, 1−(−1) k +1
k =1
k =2,4,6, … .
c [M − k ]. For k even,
c [M − 2R ]=0 if M is even.
10.35 By expressing cos(ωn ) =T n (cosω), where T n (x ) is the n -th order Chebyshev polynomial in x
H (ω) =a [n ]cos(ωn )
n =0
n =0
∑.
Therefore, we can rewrite Eq. (10.73) repeated below for convenience P (ωi ) H (ωi ) −D (ωi )
⎥
⎥
α0
α1
αM
D (ω1)
D (ω2)
⎢
⎢
⎤⎦⎥
⎥ ⎥ ⎥ ⎥ ⎥ . Note that the coefficients {αi } are different from the coefficients {a [i ]} of Eq. (10.73). To
determine the expression of ε we use Cramer's rule arriving at ε=Δ
, where
€ Δ=det
cos(ωM +1) cos M (ωM +1) (−1) M /P (ωM +1) cos(ωM +2) cos M (ωM +2) (−1) M +1/P (ωM +2) and
Δε=
..
i =1
M +2
Δ=b i
i =1
M +2
∑(−1) i −1
P (ωi )
, where
b i =det
€ b i =(cosωk
k≠,k>
k , ≠i
∏−cos ω ). Define c i =b
br
r =1
r ≠i
cos ωi −cos ωn
n =1
n ≠i
M +2
∏. Therefore, ε=
b i D (ωi )
M +2
bi
i =1
∑(−1) i
P (ωi )
P (ω1)
P (ω2)
++
c (−1)
P (ωM +2)
W ω()=
1ω∈passband,
δp
δs
ω∈stopband.
⎩⎪
W ω()=
1, 0≤ω≤0.4π, 36/7,0.55π≤ω≤π. ⎧
1ω∈passband,
δp
δs
ω∈stopband.
⎩⎪
W ω()=
4, 0≤ω≤0.65π, 1, 0.8π≤ω≤π. ⎧
W ω()=
δp
δs 1
0≤ω≤ωs 1,
1ωp 1≤ω≤ωp 2,
δp
δs 2
ωs 2≤ω≤π,
⎪
W ω()=
⎜⎞
k =0
(N −1) /2
H (ω) =1
˜ b [k ]cosωk +1
⎜⎞
⎠
⎟
k =0
(N −1) /2
∑+1
˜ b [k ]cosωk −1
⎜⎞
k =0
(N −1) /2
=1
2
˜ b [k −1]cosωk −1
⎜⎞
k =1
(N +1) /2
∑+1
˜ b [k ]cosωk −1
⎜⎞
⎠
⎟
k =0
(N −1) /2
=1
˜ b [0]cosω
⎜⎞
⎟+1
˜ b [k ]+˜ b [k −1]
()
k =1
(N −1) /2
∑cos ωk −1
⎜⎞
⎞
⎠
⎟+1
˜ b N −1
⎡⎤
⎦ ⎥ cos ω
⎜⎞
⎟.
˜ b [1]+˜ b [0],
b [k ]=1
˜ b [k ]+˜ b [k −1]
(), 2≤k ≤N −1
2
, b N +1
⎣⎢
⎦⎥=
˜ b N −1
⎡⎤
k =0
(N /2) −1
H (ω) =1
˜ c [k ]sinω(k +1)
()
k =0
(N /2) −1
∑−1
˜ c [k ]sinω(k −1)
()
k =0
(N /2) −1
=1
˜ c [0]sin(ω) −1
˜ c [0]sin(−ω) +1
˜ c [1]sin(2ω) +1
˜ c [2]sin(3ω) −1
˜ c [2]sin(ω)
+1
˜ c [3]sin(4ω) −1
˜ c [3]sin(2ω) +1
˜ c [4]sin(5ω) −1
˜ c [4]sin(3ω) +
+1
˜cN
2
−2
⎣⎢
⎦ ⎥ sin ω
−1
⎜⎞
⎟−1
˜cN
−2
⎣⎢
⎦ ⎥ sin ω
2
−3
⎜⎞
⎟+1
˜cN
−1
⎣⎢
⎦ ⎥ sin ω
⎜⎞
⎝
⎜
⎟−1
˜cN
−1
⎣⎢
⎦ ⎥ sin ω
N 2−2⎛⎝⎜⎞⎠⎟⎛
⎞⎠⎟.
Comparing the above expression with Eq. (10.57) we observe c [1]=˜ c [0]− 1
˜ c [2],
c [k ]=1
˜ c [k −1]−˜ c [k +1]
(), 2≤k ≤N
−2, and c N
−1
⎣⎢
⎤
⎦⎥=
˜cN
−2
⎣⎢
⎦ ⎥ ,c
⎣⎢
⎦⎥=
˜cN
−1
⎣⎢
⎦⎥.
()
k =0
(N −1) /2
we arrive at
⎟ k =0(N −1) /2
⎟ k =0(N −1) /2
k =1
(N −1) /2
∑sin ωk −12⎛ ⎝ ⎜ ⎞ ⎠ ⎟ ⎛ ⎝ ⎜ ⎞ ⎠
˜ d [0]sinω2⎛ ⎝⎜⎞ ⎠ ⎟ +
[0]− 12
, 2≤k ≤N −12
, and d N +12⎡ ⎣ ⎢ ⎤ ⎦ ⎥ =˜ d N −12⎡ ⎣ ⎢ ⎤ ⎦ ⎥ , which are the same as given in Eq. (10.64).
10.42 From Step 2, we have € G (e j ω) = G (ω) e −jN ω=δs (F ) e −jN ω
+ F (ω) e −jN ω.
The amplitude response € G (ω) has been obtained by raising the amplitude response €
F (ω) by δs
), where H m (z ) is a real-coefficient
minimum-phase FIR lowpass filter with half the degree of the originalH (z ). Since, €
δs F (), €
H m (ω) must
Therefore,
G (e j ω) 2δs 1 + δ + δp s
1+δ δp s
For
10.43 Here L = 4. From Eq. (10.69), for a Type 1 FIR transfer function, orderN =2L =8. Next, from Eq.
(10.68), a [k ]=˜ a [k ]={− 5, 8, 6, 4, 2}.Next, using Eq. (10.52) we compute the impulse response
coefficients: h [4]=a [0], h [4−k ]=
a [k ]
{h [n ]}={−5, 4, 3, 2, 1, 2, 3, 4, −5}.
10.44 Here L = 4. From Eq. (10.69), for a Type 2 FIR transfer function, orderN =2L +1=9. Next, from Eq.
(10.68), ˜ b [k ]=˜ a [k ]={16,20, 8, − 8, 16}.
˜ b [k ]+2˜ b [k −1]
˜ b [4]+2˜ b [3]
()=4, b [3]=1
˜ b [3]+2˜ b [2]
()=0,
b [2]=1
˜ b [2]+2˜ b [1]
()=14, b [1]=1
˜ b [1]+2˜ b [0]
()=14.
−k
⎣⎢
h [4]=1
2
b [1]=13, h [3]=1
b [2]=7, h [2]=1
b [3]=0, h [1]=1
b [4]=2,
h [0]=1
10.45 Here L = 4. From Eq. (10.69), for a Type 3 FIR transfer function, orderN =2L =8. Next, from Eq.
(10.68), ˜ c [k ]=˜ a [k ]={2,0, 8, − 4, 0}.
c [1]=˜ c [0]−1
˜ c [2]=−2, c [2]=1
˜ c [1]−˜ c [3]
()=2, c [3]=1
˜ c [2]=4, c [4]=1
h [3]=1
c [1]=−1, h [2]=1
c [2]=1, h [1]=1
2
c [3]=2, h [0]=1
c [4]=−2.
Therefore,
0ω
2δs
1+δ +δ
ps
δδ
ps
H (e j ω)
10.46 Here L = 4. From Eq. (10.62), for a Type 4 FIR transfer function, orderN =2L +1=9. Next, from Eq.
(10.68), ˜ d [k ]=˜ a [k ]={6,0, −4, −8, −12}.
˜ d [1]−˜ d [2]
()=2, d [3]=1
d [4]=1 2
˜ d [3]−˜ d [4]
d [2]=1, h [2]=1
2
d [3]=1, h [1]=1
d [4]=1, h [0]=1
d [5]=− 6.
Therefore,
10.47 It follows from Equation 10.25 that the impulse response of an ideal Hilbert Transformer is an
anti-symmetric sequence. If we truncate it to a finite number of terms between – M ≤ n ≤ M the
impulse response is of length (2M + 1) which is odd. Hence the FIR Hilbert Transformer obtained by
truncation and satisfying Equation 10.86 cannot be satisfied by a Type 4 FIR filter.
10.48 (a)Thus, € X (
z ) =X (z ) z −1=−α+ z −1
1−αz
=x [n ]
−α+
z −1
1−αz
⎜⎜
⎞⎠⎟⎟
n =0
N −1
∑=P ( z ) D (z ) ,
where € P (
z ) =p [n ]
z −1
n =0
N −1
D(
z ) =d [n ]
z −n
n =0
N −1
(b)
X [k ]=X (
z ) z =e j 2πk /N =
P(
z)
D (z ) z =e j 2πk /N
P [k ]
D [k ]
, where
P [k ]=P (
D [k ]=D (
(c) Let
€
P =p [0]p [1] p [N −1]
[]T and
P(
z ) =p [n ]
z −n
n =0
()
€ +−3αx [0]+(1+2α2) x [1]−α(2+α2) x [2]+3α2x [3] () z −1 +3α2x [0]−α(2+α2) x [1]+(1+2α2) x [2]−3αx [3] ()
z −2
[]T and Q =
1−αα2−α3
−3α1+2α2−α(2+α2) 3α2
3α2−α(2+α2) 1+2α2−3α
−α3α2−α21
⎣
⎢
It can be seen that the e lements q r , s , 0≤r , s ≤3, of the 4×4 matrix Q can be determined as follows:
3!
r !(3−r )!
(−α) r , and
(iii) the remaining elements can be obtained using the recurrence relation
In the general case, we only change the computation of the elements of the first column using the
relation q r ,0=N −1C r (−α) r =
(N −1)!
r !(N −1−r )!
(−α) r .
10.49The specifications for the linear-phase IFIR filter are: ωp =0.02π, ωs =0.09π,
δp =0.02, δs =0.001.
==4.1308.
Therefore the optimal value 4, as that is the nearest smaller integer.
δp
2π
L opt
−ωs =0.41π, δp (I ) =
δp
From this we can determine the filter orders of each filter using the M-file firpmord :