Sie sind auf Seite 1von 17

Digital Signal Processing (CE00155 7)

1. An IIR digital band-pass filter meeting the specifications given below is required. Starting
with a suitable normalized analogue low-pass filter obtain the coefficients of its transfer
function H(z).

Passband 12-15 kHz


Sampling frequency 48 kHz
Band-pass filter order 4
Filter type Butterworth

Solution:
If a low pass filter is to be converted to a band pass filter, then we use the following
frequency transformation.
2
s 2  O
s ………(1)
Ws
where W   p2   p1 ……..(2)

Also we know that  0   p1  p2 ………(3)


2

Here  p1 is the lower cutoff frequency and  p2 is the upper cutoff frequency of the pass
band(Lai, 2004).
According to Lai (2004), the normalized transfer function of a second order Butterworth filter
1
is H ( s)  ……(4)
s  2s  1
2

The pre-warped critical frequencies are:


 p T
 p1  tan( 1 )
2
2  12000
 tan( )
2  48000
  p1  1 ……(5)
Similarly
 p1 T
 p2  tan( )
2
2  15000
 tan( )
2  48000
  p 2  1.5 …….(6)
Now, from equations (2), (5) and (6)
W = 1.5-1= 0.5
From equations (3), (5) and (6)
 02  1  1.5  1.5
Applying the frequency transformation from equation (1) to the normalized transfer function
of Butterworth filter in equation (4) we get,
1
H ( s)  2 2 2
( s  0 )  s 2  0 2 
 2   1

(Ws) 2  Ws 

Student Id: 10004089 1


Digital Signal Processing (CE00155 7)

(Ws) 2
 2

2
( s 2  0 ) 2  2 s 2  0 Ws  (Ws) 2 
Substituting the corresponding values and simplifying the equation we have,

0.25s 2
H ( s ) 
( s 2  1.5) 2  2  s 2  1.5 0.5 s  0.25s 2

0.25s 2

s 4  0.707 s 3  3.25s 2  1.06s  2.25
z 1
H(z) can be written by substituting s= in H’(s). Thus we have,
z 1
2
 z 1 
0.25   
H ( z)   z 1
4 3 2
 z 1   z 1   z 1   z 1 
   0.707     3.25     1.06     2.25
 z  1   z  1   z  1   z 1

0.25   z  1  z  1
2 2

 z  1  0.707   z  1  z  1  3.25   z  1 2  z  1 2  1.06   z  1 z  1 3  2.25 z  1 4
4 3


0.25  z 4  2 z 2  1  
      
z 4  4 z 3  6 z 2  4 z  1  0.707 z 4  2 z 3  2 z  1  3.25  z 4  2 z 2  1  1.06  z 4  2 z 3  2 z  1  2.25 z 4  4  
=

0.25  1  2 z 2  z 4 
1  4 z 1
 6z 2
 4z 3
  0.7071  2 z
z 4 1
 2z 3
z 4
   
 3.25  1  2 z  2  z  4  1.06  1  2 z 1  2 z  3  z
0.25  1  2 z  z  2 4

8.267  5.706 z 1  13 z  2  4.294 z 3  4.733 z  4

0.03  0.06 z 2  0.03z 4


 H ( z) 
1  0.690 z 1  1.572 z  2  0.519 z 3  0.572 z  4

Thus the transfer function obtained is

0.03  0.06 z 2  0.03 z 4


H ( z) 
1  0.690 z 1  1.572 z  2  0.519 z 3  0.572 z  4

2. An image transformation function is defined by the following equation:

Student Id: 10004089 2


Digital Signal Processing (CE00155 7)

15  p for 2  p  12
q
 0 for p  2, p  12

Where p and q are input and output image elements.


Apply the above transformation on the following image p and describe its effect.
15 15 13 14 14
13 13 15 0 0 

p0 0 4 4 4
 
0 1 4 4 4
15 14 4 4 4 

What is the effect of applying DCT transformation on the above image?


The following convolution mask is then applied to q:
 1  1
 1  1
 
Obtain the output image following this operation and explain your results.

Solution:
From the question, we have
15 15 13 14 14
13 13 15 0 0 
15  p for 2  p  12 
q and p   0 0 4 4 4
0 for p  2, p  12  
0 1 4 4 4
15 14 4 4 4 
By applying the transformation function, we get,

0 0 0 0 0
0 0 0 0 0 

q  0 0 11 11 11
 
0 0 11 11 11
0 0 11 11 11

For a Inverted grayscale threshold(16 gray levels) operator,


15  p for p 2  p  p1
q
 0 for p  p1, p  p 2
This is used to identify image features having a specific value.

Now, applying Discrete Cosine Transform to the image.


FDCT = Bp B T
For calculating the elements of the matrix B individually, we use the following formula
 2  i    2 j  1 
B i, j   0.5  C  cos 
 16 
 1
 if i  0
where C   2
 1 otherwise

Student Id: 10004089 3


Digital Signal Processing (CE00155 7)

Individually calculating the elements,


1  2  0    2  0  1 
B 0,0  0.5   cos   0.35  0
2  16 
1  2  0    2  1  1 
B 0,1  0.5   cos   0.35  0
2  16 
1  2  4    2  2  1 
B 0,2   0.5   cos   0.35  0
2  16 
1  2  0    2  3  1 
B 0,3  0.5   cos   0.35  0
2  16 
1  2  0    2  4  1 
B 0,4   0.5   cos   0.35  0
2  16 
 2  1   2  0  1 
B1,0   0.5  1 cos   0.5  1
 16 
 2 1   2  1  1 
B1,1  0.5  1 cos   0.191  0
 16 
 2  1   2  2  1 
B 1,2   0.5  1 cos   0.191  0
 16 
 2  1   2  3  1 
B 1,3  0.5  1 cos   0.46  1
 16 
 2  1   2  4  1 
B1,4   0.5 1 cos   0.46  1
 16 
Arranging the calculated elements in the matrix B,
0 0 0 0 0
1 0 0 1  1

B  0 0 0 0 0
 
0 1 1 0 0
0 0 0 0 0 

Taking transpose of B, we get


0 1 0 0 0
0 0 0 1 0

B T
 0 0 0 1 0
 
0 1 0 0 0
0 1 0 0 0
We now have B, p and B T . Calculating the DCT
F =BpBT

Student Id: 10004089 4


Digital Signal Processing (CE00155 7)

0 0 0 0 0  15 15 13 14 14 0 1 0 0 0
1 0 0 1  1 13 13 15 0 0  0 0 0 1 0

F  0 0 0 0 0  0 0 4 4 4   0 0 0 1 0
     
0 1 1 0 0  0 1 4 4 4  0 1 0 0 0
0 0 0 0 0  15 14 4 4 4  0 1 0 0 0

 0 0 0 0 0  0 1 0 0 0
 0 0 5 6 6 0 0 0 1 0

F  0 0 0 0 0   0 0 0 1 0
   
  13  13  11 4 4 0 1 0 0 0
 0 0 0 0 0 0 1 0 0 0

0 0 0 0 0
0  12 0 5 0

F  0 0 0 0 0
 
0  21 0 2 0
0 0 0 0 0

We can come to a conclusion that DCT tracks the signal energy of the image.
 1  1
The given convolution mask is  1  1
 
The following convolution mask is multiplied with q to get the elements A to Q.
  A 

B  
 C 

D


   
  E G 
 H 

 
I
  
  J  
K   
L
 

 M 


   
  N  O  
 P  
 Q 

0 0 0 0   1
0 1 0 0 0  0 0 0 0 0
0 0 0 0 0   1 1 0 0 0 0 0 0 0 0

A  0 0 11 11 11   0 0 0 0 0   0 0 0 0 0
     
0 0 11 11 11  0 0 0 0 0  0 0 0 0 0
0 0 11 11 11  0 0 0 0 0 0 0 0 0 0

0 0 0 0  0
0 1 1 0 0 0 0 0 0 0
0 0 0 0 0  0 1 1 0 0 0 0 0 0 0

B  0 0 11 11 11  0 0 0 0 0  0 0 0 0 0
     
0 0 11 11 11 0 0 0 0 0 0 0 0 0 0
0 0 11 11 11 0 0 0 0 0 0 0 0 0 0

0 0 0 0  0
0 0 1 1 0  0 0 0 0 0
0 0 0 0 0  0 0 1 1 0 0 0 0 0 0

C  0 0 11 11 11  0 0 0 0 0   0 0 0 0 0
     
0 0 11 11 11 0 0 0 0 0  0 0 0 0 0
0 0 11 11 11 0 0 0 0 0 0 0 0 0 0

Student Id: 10004089 5


Digital Signal Processing (CE00155 7)

0 0 0 0 0  0 0 0 1  1 0 0 0 0 0
0 0 0 0 0  0 0 0 1 1  0 0 0 0 0

D  0 0 11 11 11  0 0 0 0 0   0 0 0 0 0
     
0 0 11 11 11 0 0 0 0 0  0 0 0 0 0
0 0 11 11 11 0 0 0 0 0  0 0 0 0 0

0 0 0 0 0  0 0 0 0 0  0 0 0 0 0
0 0 0 0 0   1 1 0 0  
0  0 0 0 0 0

E  0 0 11 11 11   1 1 0 0 0  11 11 0 0 0
     
0 0 11 11 11  0 0 0 0 0 11 11 0 0 0
0 0 11 11 11  0 0 0 0 0 11 11 0 0 0

0 0 0 0 0  0 0 0 0 0  0 0 0 0 0
0 0 0 0 0  0 1 1 0 0 0 0 0 0 0

G  0 0 11 11 11  0 1 1 0 0   0 11 11 0 0
     
0 0 11 11 11 0 0 0 0 0  0 11 11 0 0
0 0 11 11 11 0 0 0 0 0 0 11 11 0 0

0 0 0 0 0  0 0 0 0 0 0 0 0 0 0
0 0 0 0 0  0 0 1 1 0 0 0 0 0 0

H  0 0 11 11 11  0 0 1 1 0  0 0 11 11 0
     
0 0 11 11 11 0 0 0 0 0 0 0 11 11 0
0 0 11 11 11 0 0 0 0 0 0 0 11 11 0

0 0 0 0 0  0 0 0 0 0  0 0 0 0 0
0 0 0 0 0  0 0 0 1  1 0 0 0 0 0 

I  0 0 11 11 11  0 0 0 1 1   0 0 0 11 11
     
0 0 11 11 11 0 0 0 0 0  0 0 0 11 11
0 0 11 11 11 0 0 0 0 0  0 0 0 11 11

0 0 0 0 0  0 0 0 0 0 0 0 0 0 0
0 0 0 0 0   0 0 0 0 0 0 0 0 0 0

J  0 0 11 11 11   1 1 0 0 0  0 0 0 0 0
     
0 0 11 11 11  1 1 0 0 0 0 0 0 0 0
0 0 11 11 11  0 0 0 0 0 0 0 0 0 0

0 0 0 0 0  0 0 0 0 0 0 0 0 0 0
0 0 0 0 0  0 0 0 0 0 0 0 0 0 0

K  0 0 11 11 11  0 1 1 0 0  0 0 0 0 0
     
0 0 11 11 11 0 1 1 0 0 0 0 0 0 0
0 0 11 11 11 0 0 0 0 0 0 0 0 0 0

Student Id: 10004089 6


Digital Signal Processing (CE00155 7)

0 0 0 0  0
0 0 0 0 0  0 0 0 0 0
0 0 0 0 0  0 0 0 0 0 0 0 0 0 0

L  0 0 11 11 11  0 0 1 1 0   0 0 0 0 0
     
0 0 11 11 11 0 0 1 1 0  0 0 0 0 0
0 0 11 11 11 0 0 0 0 0 0 0 0 0 0

0 0 0 0  0
0 0 0 0 0  0 0 0 0 0
0 0 0 0 0  0 0 0 0 0  0 0 0 0 0

M  0 0 11 11 11  0 0 0 1  1  0 0 0 0 0
     
0 0 11 11 11 0 0 0 1 1  0 0 0 0 0
0 0 11 11 11 0 0 0 0 0  0 0 0 0 0

0 0 0 0  0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0   0 0 0 0 0 0 0 0 0 0

N  0 0 11 11 11   0 0 0 0 0  0 0 0 0 0
     
0 0 11 11 11   1 1 0 0 0 0 0 0 0 0
0 0 11 11 11  1 1 0 0 0 0 0 0 0 0

0 0 0 0  0
0 0 0 0 0  0 0 0 0 0
0 0 0 0  0
0 0 0 0 0 0 0 0 0 0

O  0 0 11 11 11  0 0 0 0 0   0 0 0 0 0
     
0 0 11 11 11 0 1 1 0 0  0 0 0 0 0
0 0 11 11 11 0 1 1 0 0 0 0 0 0 0

0 0 0 0  0
0 0 0 0 0  0 0 0 0 0
0 0 0 0 0  0 0 0 0 0 0 0 0 0 0

P  0 0 11 11 11  0 0 0 0 0   0 0 0 0 0
     
0 0 11 11 11 0 0 1 1 0  0 0 0 0 0
0 0 11 11 11 0 0 1 1 0 0 0 0 0 0

0 0 0 0  0
0 0 0 0 0  0 0 0 0 0
0 0 0 0 0  0 0 0 0 0  0 0 0 0 0

Q  0 0 11 11 11  0 0 0 0 0   0 0 0 0 0
     
0 0 11 11 11 0 0 0 1  1 0 0 0 0 0
0 0 11 11 11 0 0 0 1 1  0 0 0 0 0

Substituting all the elements back into the matrix, we get the output.

0 0 0 0 0
0 0 0 0 0 

Output  11 22 22 22 11
 
11 22 22 22 11
11 22 22 22 11

Student Id: 10004089 7


Digital Signal Processing (CE00155 7)

Convolution masks are generally used to achieve filtering effect. Here from the above,
elements may have coefficients as ‘=’ or ‘-‘. The summation would lead to 0. Hence we end
up eliminating DC component.

4. A causal digital filter is described by the following equation: H ( z )  c


1  bz 
1

1  az 
1

a) Sketch the direct form I and direct form II realisations of this filter and find the
corresponding difference equation.
b) Sketch the pole-zero pattern for a=0.5 and b=-0.6 and comment on stability.
c) Determine the value of c when a=-0.5 and b=0.5 such that maximum value of H(z) is
equal to 1.
Solution:
a) Direct form-I and Direct form-II realisations and difference equation

Given, H ( z )  c
1  bz  1

1  az  1 …….(1)

c  bcz 1
or H ( z ) 
1  az 1
Thus the Direct form-I is

X(z) c Y(z)

z-1 z-1

bc -a

Direct form-II realization is

X(z) c ∑ ∑ Y(z)

z-1

Student Id: 10004089 8


Digital Signal Processing (CE00155 7)

-a b
1
Y ( z ) c  bcz
We know that H ( z )  
X ( z) 1  az 1
 Y ( z )[1  az 1 ]  X ( z )[c  bcz 1 ]

Taking inverse Z transform and simplifying we get the difference equation,


Y ( n)  c.x( n)  bc.x (n  1)  a. y ( n  1)

b) Sketch pole-zero pattern for a=0.5 and b=-0.6

Substituting a and b values in equation(1), we get H ( z )  c


1  0.6 z  1

1  0.5 z  1

We have a pole at -0.5 and a zero at 0.6.


According to Lyons(2004), if the poles are located inside the unit circle, then the system is
stable else the system becomes unstable.
Plotting the pole and zero in the unit circle, we can see that the pole lies inside the unit circle
and hence the system is stable.

c) When a=-0.5 and b=0.5, find c such that maximum value of H(z) is equal to 1.

H ( z)  c
1  0.5 z 
1

1  0.5 z 
1

Substituting z  e jt in above equation,

H (e j t
)c
1  0.5e  j t

1  0.5e  j t

Also, e  jt  cos t  j sin t , hence

H (e jt )  c
1  0.5 cos t  j sin t  
1  0.5 cos t  j sin t  
c
 (1  0.5 cos t )  0.5 j sin t 
 (1  0.5 cos t )  0.5 j sin t 

Student Id: 10004089 9


Digital Signal Processing (CE00155 7)

Magnitude of H (e jt ) is:


(1  0.5 cos t ) 2   0.5 j sin t 
2

H (e jt )  c
(1  0.5 cos t ) 2   0.5 j sin t 
2

1.25  cos t
c
1.25  cos t

Maximum value is reached when cos t  1 , thus


2.25
H ( e j t ) max c  3c
0.25
1
Since the maximum value is 1, we have H (e jt ) max  3c  1 c
3
5. Determine using the geometric method the frequency response at dc, 1/8, ¼, 3/8 and ½ the
sampling frequency of the causal discrete time system with the following z-transformation:
( z  1)
H ( z) 
( z  0.7071)
Sketch the frequency response (amplitude and phase) up to the sampling frequency.

Solution:
( z  1)
Given that H ( z ) 
( z  0.7071)
Thus H(z) has 1 pole and 1 zero.
At z  e jt , we have
U e jT  1
H (e jT )   jT
V e  0.7071
1  cos(T )  j sin(T )

cos(T )  0.7071  j sin(T )

i. At DC, we have T  0 .
Substituting this in above equation,
1  cos(0)  j sin(0)
H (e jT ) 
cos(0)  0.7071  j sin(0)
Thus the pole and zero are 20 o and 0.29290o
The frequency response is H (e jT )  2 / 0.2929  6.8280 o

Student Id: 10004089 10


Digital Signal Processing (CE00155 7)

s  
ii. At   , T  s 
8 8 Fs 4
where  s is sampling frequency
 
1  cos( )  j sin( )
H (e jT )  4 4
 
cos( )  0.7071  j sin( )
4 4
1.847722.5 o
H ( e j T )   2.6131  67.5 o
0.707190 o
s  
iii. At   , T  s 
4 4 Fs 2
 
1  cos( )  j sin( )
H (e jT )  2 2
 
cos( )  0.7071  j sin( )
2 2
 1.1547  80.26

3 s 3
iv. At   , T 
8 4

3 3
1  cos(
)  j sin( )
H ( e j T )  4 4
3 3
cos( )  0.7071  j sin( )
4 4
 0.4840  85.93

s
v. At   , T  
2

1  cos( )  j sin( )
H (e jT )   00
cos( )  0.7071  j sin( )

Student Id: 10004089 11


Digital Signal Processing (CE00155 7)

Student Id: 10004089 12


Digital Signal Processing (CE00155 7)

6. Determine the convolution of the following pairs of signals:


i. x( n)  u (n)  u (n  5)
h( n)  u (n  2)  u ( n  8)  u (n  11)  u (n  17)

 1

ii. 
x( n)   3

0
n 0n6
elsewhere

 1 2 n 2
h(n)  
0 elsewhere

Solution:
i. Given x( n)  u (n)  u (n  5) and
h(n)  u ( n  2)  u (n  8)  u (n  11)  u ( n  17)

From Lyons (2004), convolution is given by



y (n)   h(k ).x(n  k ) …...(1)


1 n 1
We have, u (n)  0
 n0
Graphically we can represent x(n) as,

u(n) 1

u(n-5) 1

u(n)-u(n-5) 1

0 5
and h(n) can be represented as:

u(n-2) 1

u(n-8) 1

u(n-11) 1

u(n-17) 1

Convolving x(n) and h(n), we get,

Student Id: 10004089 13


Digital Signal Processing (CE00155 7)

Student Id: 10004089 14


Digital Signal Processing (CE00155 7)

 1

(ii) Given 
x( n)   3

0
n 0n6
elsewhere

 1 2 n 2
h(n)  
0 elsewhere

Solution:

Student Id: 10004089 15


Digital Signal Processing (CE00155 7)

The values of x(n) and the corresponding graph are shown x(n)
x(0)=0;
x(1)=1/3=0.333 2
x(2)= 2/3=0.667
x(3)=3/3=1
x(4)=4/3=1.333 1
x(5)=5/3=1.667
x(6)=6/3=2
0 1 2 3 4 5 6 x (n)
Similarly for h(n) we have,
h(n)
h(-2)=1
h(-1)=1 2
h(0)=1
h(1)=1
1
h(2)=1

-2 -1 0 1 2 n

Convolving x(n) with h(n), we get,

Student Id: 10004089 16


Digital Signal Processing (CE00155 7)

References:
 Lai Edmund, 2004. Practical Digital Signal Processing For Engineers And
Technicians. MA: Newnes.
 Lyons G. Richard, 2004. Understanding digital signal processing. 2nd Edition. New
Jersey: Prentice Hall.
 Moniri .M, 2010. Digital Signal Processing lecture notes, Digital Signal Processing
CE001557. Staffordshire University, Unpublished.

Student Id: 10004089 17

Das könnte Ihnen auch gefallen