Tut2 Solutions
Tut2 Solutions
Tutorial 2 - Solution
Prof. Dr.-Ing. A. Zoubir
Signal Processing Group
a)
Re{H(ejω )} Im{H(ejω )}
π
π
−π π 2π 3π ω −π π 2π 3π ω
−π
−π
b) The filter is non-causal and has an infinite unit sample response. To make it a realizable FIR filter the unit sample
response has to be truncated and shifted.
c) No, it is not realizable, because the filter is non-causal. The unit sample response has to be shifted by N samples
to make the filter causal.
d) For 1 ≤ |n| ≤ N the following holds. Other cases are trivial.
Hence h1 (n) is anti-symmetric and, therefore, the filter has a generalized linear phase. h1 (n) is of length 2N + 1
(odd) and anti-symmetric. Therefore, the FIR filter, which is made causal by shifting by N , is of type III.
e) Multiplying the ideal unit sample response with a window function in the time-domain corresponds to a circular
convolution in the frequency domain:
Z π
1
H1 (ejω ) = H(ejθ )B(ej(ω−θ) )dθ
2π −π
f) The parameter γ determines the shape of the window function. Since the factorial n! is only defined for natural
numbers, we have to choose γ ∈ {1, 2, . . .}. Using the given hint, we obtain for γ → ∞
|n| |n| |n|
((γN )!)2 Y γN − (i − 1) Y N − (i−1)
γ
Y N
lim = lim = lim i
= =1
γ→∞ (γN − n)!(γN + n)! γ→∞ γN + i γ→∞ N + N
i=1 i=1 γ i=1
1
for all n. The function b(n) hence converges to a rectangular window for γ → ∞. Also, for each n ̸= 0, b(n) is
increasing in γ so that the peak of the window function is most pronounced for γ = 1 and becomes more and more
flat with increasing γ. Some examples for b(n) with different values of γ are given in the figure.
γ = 1
γ = 5
0.8
γ = 100
γ = 1000
0.6
b(n)
0.4
0.2
0
−20 −10 0 10 20
n
g) The approximation of the ideal frequency response becomes more accurate for large γ, i.e., for window functions
with almost rectangular shape. With γ, however, also the amplitude of the side lobes increases. This effect can be
observed in the “wobbly” frequency response we obtain when using the rectangular window function (γ = ∞).
γ=1 γ=1
3 γ=5 γ=5
3
γ=∞ γ=∞
differentiator differentiator
|H1 (ejω )|
|H1 (ejω )|
2 2
1 1
0 0
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3
ω ω
N = 20 N = 50
a) Determine the equivalent pass- and stopband frequencies in the analog domain, using the bilinear transform
2 ω
p
Ωp = tan = tan(0.12π) ≈ 0.3959
Td 2
2 ω
s
Ωs = tan = tan(0.25π) = 1.0
Td 2
2
The pass- and stopband tolerances are given by
α1 = 1 − 10−1/20 ≈ 0.1087
α2 = 10−4/20 ≈ 0.6309
(i) The analog prototype for a Butterworth low-pass filter of order N is specified by the following magnitude-
squared function
1
|Hc (jΩ)|2 = 2N
1 + ΩΩc
In order to meet the analog low-pass characteristic, both subsequent equations have to be fulfilled
2N
Ωp 1
1+ = (1)
Ωc (1 − α1 )2
2N
Ωs 1
1+ ≥ (2)
Ωc α22
After rearranging terms we apply the logarithm to Equations (1) and (2), and obtain
1
2N (log(Ωp ) − log(Ωc )) = log −1
(1 − α1 )2
1
2N (log(Ωs ) − log(Ωc )) ≥ log −1
α22
which can be solved for N as follows
1
log (1−α1 )2 − 1 − log α12 − 1
N≥ 2
= 0.95 (3)
2 (log(Ωp ) − log(Ωs ))
We choose N = 1. Ωc is obtained by using Equation (1),
Ωp
Ωc = q = 0.7782
1
(1−α1 )2 −1
(ii) The transfer function in the Laplace domain |Hc (s)|2 can be obtained from the analog frequency response
|Hc (jΩ)|2 by using s = jΩ, i.e.
2 1 (−1)N Ω2N
c
|Hc (s)| = 2N =
(jΩc )2N + s2N
s
1+ jΩc
The poles of |Hc (s)|2 can be obtained by setting the denominator to zero, which leads to
√
s = jΩc 2N −1
2 −Ω2c Ωc Ωc
|Hc (s)| = = ·
(s − Ωc )(s + Ωc ) s + Ω c Ωc − s
| {z } | {z }
Hc (s) Hc (−s)
3
and therewith
Ωc 0.7782
Hc (s) = =
s + Ωc s + 0.7782
b) Using the bilinear transform with Td = 2, we get the digital filter from the analog filter prototype
(1 + z −1 )Ωc
=
(1 − z −1 ) + (1 + z −1 )Ωc
Ωc + Ωc z −1
=
(Ωc + 1) + (Ωc − 1)z −1
b0 + b1 z −1
H(z) =
1 + a1 z −1
with
Ωc Ωc − 1
b0 = b1 = = 0.4376 and a1 = = −0.1247
Ωc + 1 Ωc + 1
c) In practice, implementation of an IIR filter using direct convolution is not possible because the unit sample response
h(n) is of infinite length. The flow graph for implementing the filter with a minimum number of delay elements is
depicted below, where b0 , b1 and a1 are as given above.
b0
x(n) y(n)
z −1
−a1 b1
d) When increasing the transition width or when relaxing the passband or stopband requirements the number of
elements N will decrease and vice versa for decreasing the transition width.
a) Determine the equivalent pass- and stopband frequencies in the analog domain, using the impulse invariance
method
ωp
Ωp = = 0.12π
Td
ωs
Ωs = = 0.25π
Td
The pass- and stopband tolerances α1 and α2 are as given in Problem 2. We use Equation (3), and obtain
1 1
log (1−α )2 − 1 − log 2
α2
− 1
1
N≥ = 1.2
2 (log(Ωp ) − log(Ωs ))
4
We chose N = 2. Ωc is obtained by using Equation (1),
Ωp
Ωc = q = 0.5286
1
4
(1−α1 )2 −1
and the fact that the same α1 and α2 are use for both methods, the difference in N results from different Ωp and
Ωs . In both methods, the frequency is mapped according to the following rules in both methods:
2 ω
ΩBT = tan
Td 2
IIM ω
Ω = ,
Td
where ΩBT and ΩIIM stand for the frequency in the bilinear transform and that in the impulse invariance method.
In the following, we will show that
ΩBT ΩIIM
log s
BT
≥ log sIIM , (4)
Ωp Ωp
which leads to N BT ≤ N IIM . Due to the fact that ωs /2 > ωp /2, the inequality (4) is equivalent to
tan(ωs /2) ωs /2
≥
tan(ωp /2) ωp /2
or
tan(ωs /2) tan(ωp /2)
≥ . (5)
ωs /2 ωp /2
The inequality in (5) follows from the fact that
tan(ω/2)
• the function ω/2 is non-negative and monotonically increasing in ω ∈ [0, π),
• ωs > ωp .
c) Using the impulse invariance method, the digital filter can be designed as follows
>>N=2;
>>OmegaC=0.5286;
>>[bt,at]=butter(N,OmegaC,’s’);
>>[bI,aI]=impinvar(bt,at,0.5)
d) Using the bilinear transformation, the digital filter from Problem 2 can be designed as follows
>>N=1;
>>OmegaC=0.7782;
>>[bt,at]=butter(N,OmegaC,’s’);
>>[bB,aB]=bilinear(bt,at,0.5)
e) You can compare the filters by using the filter visualization tool.
>>H=fvtool(bB,aB,bI,aI);
>>legend(H,’Bilinear’,’Impulse Invariance’)
Generally the filter using the bilinear transform is preferable, because no aliasing will occur. The filter using the
impulse invariance method can be affected by aliasing, if the continous-time filter is not band-limited.
5
0
−20
|H(ejω )| (dB)
−60