You are on page 1of 14

Course 20139

Questions:
1 Given the following pole zero diagram of a system

Im
2

x2 2
Re

-2

Separate the system into H min ( z ) and H ap ( z ) . Write the full transfer function

as a product of the two and mark clearly which part is H min ( z ) and which part

is H ap ( z ) .

Solution
There are two zeros outside the unit circle. Those are reflected to their
conjugate reciprocal locations at H min ( z ) . The poles stay at the same location

at H min ( z ) .

At H ap ( z ) the two zeros of the original system stay at the same location but

there will be two new poles to cancel the new zeros of H min ( z ) .
H min ( z ) H ap ( z )
Im Im
2

0.25 x2 0.25
0.25 0.25 2
Re Re
-0.25 -0.25

-2

From the diagrams it is easy to write the transfer function

H ( z)
[ z − (0.25 + 0.25 j )][ z − (0.25 − 0.25 j )] ⋅ [ z − (2 + 2 j )][ z − (2 − 2 j )]
z


2
[
z − (0.25 + 0.25 j ) ][ z − (0.25 − 0.25 j ) ]
 
H min ( z )
H ap ( z )

2 Given a transfer function H1 ( z ) of a system:

z−2
H1 ( z ) =
z − 0.5

In order to correct the magnitude distortion caused by the frequency response


of the system, the output of this system was entered into a second system that
eliminates the magnitude distortion.

a. Write the overall transfer function of the two systems combined H T ( z ) .

b. What distortion cannot be corrected by this method for this system?


c. Is there any difference if the transfer function of the first system is
z + 0.5
H 2 ( z) = ?
z − 0.5
Solution
a. In order to eliminate the magnitude distortion of the frequency response of
H1 ( z ) we need the second system to be an inverse of the first one. Since H1 ( z )
has a zero outside the unit circle at z=2 it cannot be inverted. To have an
invertible system we need to split H1 ( z ) into a minimum phase system and aa
all pass system. The minimum phase system can be inverted and will correct all
the magnitude distortion of H1 ( z ) .
If we write =
H1 ( z ) H min ( z ) ⋅ H ap ( z ) then by having the second system has a

1
transfer function of the overall transfer function of the two systems
H min ( z )
combined will be
1 1
HT ( z) =H1 ( z ) ⋅
H min ( z )
=( H min ( z ) ⋅ H ap ( z ) ) ⋅ H min ( z )
=H ap ( z )

So

z−2 1 − 2 z −1 −2 ( z −1 − 0.5 ) −2 1 − 0.5 z −1


−1 (
H1 ( z=) = =
−1 −1
= −1
⋅ ⋅ z −1 − 0.5 )
z − 0.5 1 − 0.5 z 1 − 0.5 z 1 − 0.5 z 1 − 0.5 z
−2 (1 − 0.5 z ) z −1 − 0.5
−1

=H1 ( z ) ⋅
1−0.5
 z −1  1− 0.5

−1
z
H min ( z ) H ap ( z )

And from here we get

z −1 − 0.5
H
= T ( z) ap ( z )
H=
1 − 0.5 z −1

b. The phase distortion caused by H T ( z ) cannot be corrected.


c. Since H 2 ( z ) is by itself a minimum phase system it can be inverted and the
overall system will have no frequency distortion at all (not magnitude and not
phase).

3 Given an incomplete pole zero diagram of a real, causal, stable system.


Write the full correct transfer function for the system.
Im

0.5

-0.5
0.5 Re

-0.5

Solution
For reality we need the symmetry about the real axis.
For stability we need all poles to be inside the unit circle.
For causality we need the number of poles be at least as the number of zeros.

The complete pole zero diagram will be:


Im

0.5

-0.5
0.5 Re

-0.5

From what was said before and the diagram, it is now easy to write the transfer
function:

H ( z) =
( z − (0.5 − j 0.5) )( z − (0.5 + j 0.5) )
( z − (−0.5 + j 0.5) )( z − (−0.5 − j 0.5) )
For all designs – plot the frequency response 0 to π rad/smp
4 Design a HPF with a rectangular window. Cutoff frequency is 1KHz and
sampling frequency is 4KHz.
a. Design a 2nd order filter. Write the impulse response h[n]=…
b. Design a 4th order filter. Write the impulse response h[n]=…
c. Design a 6th order filter. Write the impulse response h[n]=…
d. What is the filters attenuation at 500Hz and 1.5KHz in any case?
Solution
From the table:

Rectangular window means h[n] = hd [n]

2nd order filter N=2, M=1


1000 1
=ωc 2=
π π
4000 2
1 
Sin  π (0 − 1) 
hd [0] = − 2 =−0.3183
π (0 − 1)
1
π
1
hd [1] =1− 2 =
π 2
hd [2] = hd [0]
1
h[n] =−0.3183 ⋅ δ [n] + δ [n − 1] − 0.3183 ⋅ δ [n − 2]
2
nd
2 order filter
1.2

0.8
magnitude

0.6

0.4

0.2

0
0 0.5 1 1.5 2 2.5 3

frequency [rad/smp]

Gain at 500Hz: 0.05


Gain at 1500Hz: 0.95

4th order filter N=4, M=2


1000 1
=ωc 2=
π π
4000 2
1 
Sin  π (0 − 2) 
hd [0] =
− 2 =0
π (0 − 2)
1 
Sin  π (1 − 2) 
hd [1] = − 2 =−0.3183
π (1 − 2)
1
π
2 1
hd [2] = 1− =
π 2
hd [3] = hd [1]
hd [4] = hd [0]
1
−0.3183 ⋅ δ [n − 1] + δ [n − 2] − 0.3183 ⋅ δ [n − 3]
h[n] =
2
th
4 order filter
1.2

0.8
magnitude

0.6

0.4

0.2

0
0 0.5 1 1.5 2 2.5 3

frequency [rad/smp]

Gain at 500Hz: 0.05


Gain at 1500Hz: 0.95
Be aware – the result is the same as 2nd order since h[0] and h[4] are both zero.
6th order filter N=6, M=3
1000 1
=ωc 2=
π π
4000 2
1 
Sin  π (0 − 3) 
hd [0] =
− 2 =0.1061
π (0 − 3)
1 
Sin  π (1 − 3) 
hd [1] =
− 2 =0
π (1 − 3)
1 
Sin  π (2 − 3) 
hd [2] = − 2 =−0.3183
π (1 − 3)
1
π
2 1
hd [3] =1− =
π 2
hd [4] = hd [2]
hd [5] = hd [1]
hd [6] = hd [0]
1
n] 0.1061 ⋅ δ [n] − 0.3183 ⋅ δ [n − 2] + δ [n − 3] − 0.3183 ⋅ δ [n − 4] + 0.1061 ⋅ δ [n − 6]
h[=
2
th
6 order filter
1.2

0.8
magnitude

0.6

0.4

0.2

0
0 0.5 1 1.5 2 2.5 3

frequency [rad/smp]

Gain at 500Hz: 0.1


Gain at 1500Hz: 1.1
5 Design a 3rd order BSF with a rectangular window. The cutoff and cuton
frequencies are 500Hz and 1.5KHz. Sampling frequency is 4KHz.
a. What is the impulse response of the filter h[n]=…?
b. Draw an optimized diagram of the filter.
Answer
Pay attention! A 3rd order filter is either type 2 or type 4 and both cannot
be BSF.
Bellow is what happens if you do not take this into account. Look at the
frequency response you get. Is it A BSF? NO!!!
From the table:

Rectangular window means h[n] = hd [n]

3rd order filter N=3, M=1.5


500 1
=ωc1 2=π π
4000 4
1500 3
=ωc 2 2=
π π
4000 4
1  3 
Sin  π (0 − 1.5)  Sin  π (0 − 1.5) 
hd [0] = 4 − 4  = 0.2773
π (0 − 1.5) π (0 − 1.5)
1  3 
Sin  π (1 − 1.5)  Sin  π (1 − 1.5) 
hd [1] = 4 − 4 =−0.3445
π (1 − 1.5) π (1 − 1.5)
hd [2] = hd [1]
hd [3] = hd [0]
h[n] = 0.2773 ⋅ δ [n] − 0.3445 ⋅ δ [n − 1] − 0.3445 ⋅ δ [n − 2] + 0.2773 ⋅ δ [n − 3]
rd
3 order BS filter
1

0.9

0.8

0.7

0.6

magnitude
0.5

0.4

0.3

0.2

0.1

0
0 0.5 1 1.5 2 2.5 3

frequency [rad/smp]

x[n] z −1

+ + z −1

z −1

0.2773 -0.3445

+ y[n]

Pay attention! A 3rd order filter is either type 2 or type 4 and both cannot
be BSF.
Look at the frequency response you get. Is it A BSF? NO!!!

6 Design a 6th order LPF. The cutoff frequency is 750Hz and the sampling
frequency is 3KHz.
a. Use a rectangular window. What is the impulse response of the filter
h[n]=…?
b. Use a Bartlett window. What is the impulse response of the filter
h[n]=…?
c. Use a Hanning window. What is the impulse response of the filter
h[n]=…?
Solution
6th order filter N=6, M=3
From the table:
750 1
=ωc 2=
π π
3000 2
1 
Sin  π (0 − 3) 
hd [0] = 2  = −0.1061
π (0 − 3)
1 
Sin  π (1 − 3) 
=hd [1] = 2  0
π (1 − 3)
1 
Sin  π (2 − 3) 
=hd [2] = 2  0.3183
π (1 − 3)
1
π
2 1
hd [3] =1− =
π 2
hd [4] = hd [2]
hd [5] = hd [1]
hd [6] = hd [0]
1
hd [n] =−0.1061 ⋅ δ [n] + 0.3183 ⋅ δ [n − 2] + δ [n − 3] + 0.3183 ⋅ δ [n − 4] − 0.1061 ⋅ δ [n − 6]
2
Rectangular window : h[n] = hd [n]
th
6 order LPF rectangular window
1.2

0.8
magnitude

0.6

0.4

0.2

0
0 0.5 1 1.5 2 2.5 3

frequency [rad/smp]
Bartlett window
 2n / M 0≤n≤M /2  2n / 6 0≤n≤3
 
w [ n ] =  2 − 2n / M M / 2 ≤ n ≤ M ⇒  2 − 2n / 6 3 ≤ n ≤ 6
 0 else  0 else
 
w[0] = 0
w[1] = 0.3333
w[2] = 0.6667
w[3] = 1
w[4] = 0.6667
w[5] = 0.3333
w[6] = 0
h[n] hd [n] ⋅ w[n]
=
1
] 0.6667 ⋅ 0.3183 ⋅ δ [n − 2] + δ [n − 3] + 0.6667 ⋅ 0.3183 ⋅ δ [n − 4]
h[n=
2
th
6 order LPF Bartlett window
1

0.9

0.8

0.7

0.6
magnitude

0.5

0.4

0.3

0.2

0.1

0
0 0.5 1 1.5 2 2.5 3

frequency [rad/smp]

Hanning window
1   2π n   1   2π n  
 1 − cos    0≤n≤M  1 − cos   0 ≤ n ≤ 6
=w [ n]  2   M  ⇒ 2   6 
 0 else  0 else
 
w[0] = 0
w[1] = 0.25
w[2] = 0.75
w[3] = 1
w[4] = 0.75
w[5] = 0.25
w[6] = 0
[n] hd [n] ⋅ w[n]
h=
1
h[n] = 0.75 ⋅ 0.3183 ⋅ δ [n − 2] + δ [n − 3] + 0.75 ⋅ 0.3183 ⋅ δ [n − 4]
2
th
6 order LPF Bartlett window
1

0.9

0.8

0.7

0.6
magnitude

0.5

0.4

0.3

0.2

0.1

0
0 0.5 1 1.5 2 2.5 3

frequency [rad/smp]

7 Design a Kaiser LPF. Sampling frequency is 20KHz. Transient frequencies are


5.5KHz and 6.5KHz, and the maximum allowed ripple is 5%.
What is the impiulse rsponse of the filter h[n]=…?

Solution
f sample = 20 KHz
f P = 5.5 KHz
f S = 6.5 KHz
δ = 0.05
Calculating the window
fP 5500
Ω P 2π =
= 2π = 1.7279 rad / smp
f sample 20000
fS 6500
Ω S 2π =
= 2π = 2.0420 rad / smp
f sample 20000
ΩP + ΩS
=
ΩC = 1.8850 rad / smp
2
∆Ω = Ω S − Ω P = 0.3142 rad / smp

A=−20 ⋅ log(δ ) =−20 ⋅ log(0.05) =26.021


The filter’s order
A−8 26.021 − 8
=N = = 25.103
2.285 ⋅ ∆Ω 2.285 ⋅ 0.3142
We have to round up so N=26
Since 21 ≤ A ≤ 50
b 0.5842 ⋅ ( A − 21)0.4 + 0.07886 ⋅ ( A − 21)
= = 1.5089
And the window elements are
 26  
2
 
n− 2  
I 0 1.5089 1 − 
 26  
  
 2  
=w[n]   0 ≤ n ≤ 26
I 0 (1.5089)

(The MATLAB function for zeroth-order modified Bessel function of the 1st
Kind is besseli(0,x) )
The sesired impulse response for LPF is
   N 
 sin  ΩC  n −  
   2  N
n≠
  N 2
hd [n] =  π n− 
  2
 ΩC N
 n=
 2 2

N
In this case N=13 so there is no n = 2

   26  
 sin 1.5708  n −  
   2 
n ≠ 13
  26 
hd [n] =  π n− 
  2 
 1.5708
 n = 13
 π

Now we multiply the desired impulse response by the window to get the actual
impulse response
[n] hd [n] ⋅ w[n]
h=
The frequency response of the filter will be
th
13 order LPF Kaiser window
1.2

0.8

magnitude
0.6

0.4

0.2

0
0 0.2 0.4 0.6 0.8

frequency [rad/smp]

You might also like