23
Department of Electronic and Electrical Engineering Dr D. McLernon DSP PROBLEM SHEET ONE F s = 1 / T F s =1/T  x ( n ) ( n ) o ( t )  x i ( t ) ( t )  x ( t ) D A C D S P CHIP A D C L P F L P F anti-aliasing fil ter sm oothing filter  Question 1 (a) Sketch the following discrete-time sequences for -4n4: (i) 3δ (n-4) (ii) u(n+2) (iii) -2u(-2n+3) (iv) 2δ (n-1)+6δ (n+1)-4δ(n-2) (v) -3sin(nφ), φ =π  /4 (vi) -3sin(nφ+2π), φ=π  /4 (vii) e  j(nφ) , φ=π  /2 (b) Given the sequence x(n) = 2 -n , -∞≤  n≤∞ sketch the following: (i)  x(n) (ii) x(n)u(n) (iii) x(n)u(-n) (iv) x(-n)u(-n) (v) x(-n+2)u(-n+2) (vi) x(n 2 )u(n) Question 2 (a) Determine if the following sequences are periodic, and if they are, find the periods. (i) e cos(π n/ 8) (ii) sin(2n+π  /4) (iii) e -n cos(π n  /4) (iv) cos(6.5π n+π  /3) (v) cos 2 (nπ  /16) (vi) cos(nπ  /30)+cos(nπ  /20) (b) An analogue signal x(t )=10cos(500π t ) is sampled at 0  , T,2T, .... with T=1ms. (i) Sketch x(t ) vs. t and show the sample values x(nT). (ii) Find another cosine y(t )  , whose frequency is as close as possible to that of  x(t ), which when sampled with T=1ms yields the same sample values as x(t ). Write the equation and sketch y(t ) vs. t . (iii) If  x(nT) were the input to a D/A converter, followed by a low-pass smoothing filter, why would the output be x(t ) and not y(t ) ? Question 3 (a) Consider the recursive linear difference equation (LDE),  y(n) =  x(n)-0.5  y(n-1). Let x(n) be a causal sequence with {  x(n)}={1,2,3,4,5,0,0,0,...}. Calculate {  y(n)} and sketch the result. (b) Show that the following two LDE’s give the same output {  y(n)} for input {  x(n)}:  y(n)=  x(n)+  x(n-1)+  x(n-2)+  x(n-3)+  x(n-4);  y(n)=  x(n)-  x(n-5)+  y(n-1). Question 4

Problem Sheets 1-9

Embed Size (px)

Citation preview

Page 1: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 1/23

Department of Electronic and Electrical Engineering

Dr D. McLernon 

DSP PROBLEM SHEET ONE 

F s = 1 / T F s = 1 / T

 x ( n )( n )

o( t ) x i ( t )

( t ) x ( t )

D A CD S PC H I PA D CL P F L P F

a n t i - a l i a s i n g f i lt e r s m o o t h i n g f i l te r

 

Question 1

(a) Sketch the following discrete-time sequences for -4≤n≤4:

(i) 3δ (n-4) (ii) u(n+2) (iii) -2u(-2n+3)

(iv) 2δ (n-1)+6δ (n+1)-4δ(n-2) (v) -3sin(nφ), φ =π  /4 

(vi) -3sin(nφ+2π), φ=π  /4 (vii)e j(nφ), φ=π /2

(b) Given the sequence x(n) = 2-n , -∞≤  n≤∞  sketch the following:

(i)  x(n)  (ii) x(n)u(n) (iii) x(n)u(-n)

(iv) x(-n)u(-n) (v) x(-n+2)u(-n+2) (vi) x(n2)u(n) 

Question 2

(a) Determine if the following sequences are periodic, and if they are, find the periods.

(i) ecos(π n/ 8) (ii) sin(2n+π  /4)  (iii) e

-ncos(π n /4)

(iv) cos(6.5π n+π  /3)  (v) cos2(nπ  /16)  (vi) cos(nπ  /30)+cos(nπ  /20) 

(b) An analogue signal x(t )=10cos(500π t ) is sampled at 0 , T,2T, .... with T=1ms.

(i) Sketch x(t ) vs. t and show the sample values x(nT). 

(ii) Find another cosine y(t ) , whose frequency is as close as possible to that of  x(t ),which when sampled with T=1ms yields the same sample values as x(t ). Write the

equation and sketch y(t ) vs. t .

(iii) If  x(nT) were the input to a D/A converter, followed by a low-pass smoothing filter,

why would the output be x(t ) and not y(t ) ? 

Question 3

(a) Consider the recursive linear difference equation (LDE),  y(n) = x(n)-0.5 y(n-1). Let x(n) be a

causal sequence with { x(n)}={1,2,3,4,5,0,0,0,...}. Calculate { y(n)} and sketch the result.

(b) Show that the following two LDE’s give the same output { y(n)} for input { x(n)}:

 y(n)= x(n)+ x(n-1)+ x(n-2)+ x(n-3)+ x(n-4);

 y(n)= x(n)- x(n-5)+ y(n-1).

Question 4

Page 2: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 2/23

 

Consider the following continuous-time, linear differential equation which models a

communication channel with x(t ) the input and y(t ) the channel output:

d y t 

dt 

dy t 

dt  y t x t  

2

25 6 7

( ) ( )( ) ( ) .+ + =  

Find the coefficients a0, a1, and a2 in the following second-order LDE that approximates thecontinuous-time equation at sampling instants t =nT, and where xn= x(nT) and is the output

from the LDE approximation: 

 yn

 

a y a y a y xn n n0 1 1 2 2 7 + + =− − n

1

(Hint: Approximate a first-order differential with a first-order backward difference, etc.) 

Question 5

Consider a first-order R-C low-pass circuit, where is the input and is the output.

Using the backward difference method of approximation find the coefficients a

 x t ( )  y t ( )

0 and b1 (interms of T , R and C ) in the following first-order LDE that approximates the continuous-time

filter input/output at sampling instants t =nT, where xn= x(nT) and is the output from the

LDE approximation: 

 yn

 y a x b yn n n= + −0 1 .

Now let T =0.1sec, and R = 1Ω C = 1F , and let the input be the following step function:

 x t t 

( ),

,=

≥RST

1 0

0

volt

volts otherwise.

Compare the output of the LDE ( ) with the true output of the analogue circuit ( ). Howwould the result change if T =0.05sec? What would happen as secs?

 yn  y t ( )T → 0

 

Question 6

Consider the first-order difference equation for a LTI causal system:

 y n a y n b x n n( ) ( ) ( ),= − + ≥1 01 0 .

Let the initial condition be  y( )− =1 0 , and let the input be .Find an expression

for if where the terms on the right-hand side are respectively the

 particular solution and the complimentary solution.

 x n a u nn

( ) ( )=

 y n( )  y n y n y n p c( ) ( ) ( )= +

 

Check your answer against direct convolution, and explain why convolution can be used here. 

DSP(1).DOC 

Page 3: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 3/23

School of Electronic and Electrical Engineering

Dr D. McLernon

DSP PROBLEM SHEET TEN: FIR FILTERS – Frequency Domain Question 10.1

Question 10.2

Question 10.3

Page 4: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 4/23

Question 10.4

Question 10.5

Question 10.6

Page 5: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 5/23

School of Electronic and Electrical Engineering

Dr D. McLernon

DSP PROBLEM SHEET ELEVEN: DFT/DTFT 

Question 11.1

( ) ( ) ( )1 1

2 2

0 0

1If 1, 0 1, show that Parseval's Rule holds, i.e.

 N N 

n k 

  x n n N x n X k   N 

− −

= =

= ≤ ≤ − =∑ ∑ .

That is, the total energy of the signal can be obtained from either the time-domain information or the

DFT information in the frequency-domain, where ( ) X k  is the DFT:

( ) ( )1

2 / 

0

,

 N k n j N 

 N  N 

n

 X k x n W W eπ 

−−

=

= =∑ .

Note that Parseval’s Rule holds for any signal x(n) that has a DFT.

Question 11.2

( ) ( ) ( )

1 1 22 2  j

0 0

1 1Show e is true for 3 in Example 11.1.

2

 N N 

n k 

  x n X k X d N   N 

π ω 

π 

ω π 

− −

= = −

= = =

∑ ∑ ∫  Note

that the   Discrete-Time Fourier Transform (DTFT) of  ( ) x n is ( ) j

 X e ω  , so that

( ) ( ) j

n

  X e x n ej nω ω 

∞−

=−∞

= ∑ . This is to distinguish the DTFT, ( ) j

 X e ω  , from the DFT, ( ) X k  .

Question 11.3 

Let 0( ) cos( ) x t  ω = t  and sample ( ) x t  every T  secs to get { }1

0( )

n x n

−=

where 0( ) cos( ) x n ω = nT  . Let the

radian sampling frequency be and let the frequency of 2 / s T ω π = ( ) x t  lie exactly on a DFT line – i.e.

 / o s

 p N ω ω = where p is an integer, 0 p N  1≤ ≤ − , corresponding to the ( p+1)-th DFT line. Thus we

can say that:

02

( ) cos( ) cos( ) cos( ), 0,1,..., 1sT   x n nT np np n N  

 N N 

ω  π ω = = = = −  

Show that as ( ) x t  lies exactly on a DFT line, then the scaled DFT  X (k )/  N represents the exact two-

sided spectral information of  ( ) x t  . That is it gives the exponential Fourier Series coefficients for the

continuous time waveform.

Question 11.4

Let . Show that( ) ( )1 2 1, 0 1 x n x n n N  = = ≤ ≤ − ( ) ( ) (3 1 2 ) x n x n x n≠ ∗ where

( ) ( ) ( ){ }13 1DFT 2  x n X k X  

−= k  and ( ) ( ) ( ) ( )1

1 2 1 2

0

 N 

 x n x n x k x n k  

=

∗ = ∗∑ − . That is, multiplying the

DFTs together is not equivalent to linear convolution. However, multiplying the DTFTs together isequivalent to linear convolution.

Question 11.5 ‘Windows’ are often needed in spectral analysis to improve the resolution of a DTFT/DFT spectral

estimate. They allow us to distinguish between two very closely spaced sinusoids that otherwise may

be ‘smeared’ together as one peak and thus become indistinguishable. They also allow us to identify a

low power sinusoid that otherwise may be hidden in the DTFT/DFT plot by the sidelobes of the

spectrum of a large power sinusoid.

So instead of taking the DFT or DTFT of a signal ( ) x n in order to examine its power

spectrum, we multiply (‘window’) the signal by a window function, , and then take the

DFT/DTFT of the resulting product . The question is, how does windowing affect the value of 

( )w n

( ) ( )w n x n

1

Page 6: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 6/23

the estimate of the true power spectrum? The true power spectral density (PSD), S xx ( ) , of a

discrete-time random process { ( )} x n may be defined as:

2( )

( )

 j N 

 xx N 

 X eS Lim E  

 N 

ω 

ω →∞

⎡ ⎤⎧ ⎫⎢ ⎥⎪ ⎪

= ⎢ ⎥⎨ ⎬⎢ ⎥⎪ ⎪⎢ ⎥⎩ ⎭⎣ ⎦

 

where

{ }1

1

00

( ) ( ), ( ) ( ) N 

 N  j j j N N n

n

 x n X e X e x n enω ω ω 

−− −

==

↔ = ∑ .

For example, let { ( )} x n be a zero-mean, white-noise process, with [i.e.

], but now let a window {

( ) 1 xxS ω  =

{ ( ) ( )} ( ) E x n x m n mδ = − }1

0( )

nw n

−=

be applied to { } . So

is used instead of  { }

1

0( )

n x n

−=

{ }1

0( ) ( )

nw n x n

−=

1

0( )

n x n

−=

for the PSD estimation. Derive the scaling factor that

must now be applied to the PSD estimate to compensate for using the window.

Question 11.6 Consider again question 10.3. This time consider a single complex exponential  x3(n) for simplicity.

What we now want to show is that if the frequency of  x3(n) does not lie exactly on a DFT line, then the

DFT of  x3(n) does not give the exact spectrum of the signal where:

( ) 0( )3 , 0,1,...,

 j n  x n e n N  

ω φ +1= = −

 

 

with 02

, integer p p N 

π ω  ≠ 

. Note that the DFT lines are spaced at intervals of  2 /  . N π 

Evaluate the DFT of  x3(n) and try and explain the result in terms of the definition of the DFT as the

sampled values of the DTFT. Use a plot to help with your explanation. Consider the special case of 

02

ˆ 2.25 N 

π ω  = .

Question 11.7

Consider a continuous-time signal 0( ) cos( ),c  x t t t  ω = − ∞ ≤ ≤ ∞ where 0 00

22 F 

π ω π = = . Let the

signal be windowed by a rectangular window to give w ( ) ( ) ( )c x t w t x t  = where:

ww

( ), 0( )

0, otherwise

c  x t t T   x t 

≤ ≤⎧= ⎨

⎩.

Let the windowed signal be sampled with a sampling frequency2

2s ss

F T 

π ω π = = :

w ( ), 0( )

0, otherwise

s  x nT n N   x n

1≤ ≤ −⎧= ⎨

⎩.

(i) Plot ( )c x t  , w ( ) x t  and ( ) x n for the particular case of:

0 0300Hz; 3.33msF T = =  

2000Hz; 0.5mss sF T = =  

w s( 1) 5mT N T = − = s  

11 N =  

2

Page 7: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 7/23

(ii)  For the general case, derive expressions for the Fourier Transform (FT) of  ( )c x t  (i.e.

( )c X  ω  ), the FT of  w ( ) x t  (i.e. w ( ) X  ω  ), the DTFT of  ( ) x n (i.e. ( ) j

 X e ω  ), and the DFT

of { } (i.e. );1

0( )

n x n

−=

ˆ ( ) X k 

(iii)  For the particular values in (i), compare and contrast the plots for ( )c X  ω  , w ( ) X  ω  ,

( )s j T  X e

ω  and ˆ ( ) X k  . explain why they are not all the same, how they are related, and

what scaling factors should be used to assist equality between them all.

Question 11.8

Use two different approaches (a simple method, and a more complicated one) to prove Parseval’s

theorem for a discrete sequence:

22 1( ) ( )

2

 j

n

  x n X e

π ω 

π 

d ω π 

=−∞ −

=∑ ∫   

where the sequence ( ) x n may be complex, and the DTFT equations are

1( ) ( )

2

( ) ( ) .

  j j n

 j j

n

n

  x n X e e

 X e x n e

π ω ω 

π 

ω ω 

d ω π 

∞−

=−∞

=

=

∫ 

 

You may also wish to make use of the following:

( ) ( ) ( ), (Sifting Property of ( ))  f t t T dt f T t  δ δ 

−∞− =∫ 

 where ( ) f t  is any function of any continuous variable, t , and ( )t δ  is the

“delta function”. And also use:

  2 ( 2 ), (Poisson Sum Formula) jn

n n

e nω  π δ ω π  

∞ ∞

=−∞ =−∞

= −∑ ∑

where ω  is any continuous variable, and ( )δ ω  is the “delta function”

such that:

0, 0( )

undefined, 0.

ω δ ω 

ω 

≠⎧= ⎨

=⎩

 

3

Page 8: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 8/23

Department of Electronic and Electrical Engineering

Dr D. McLernon 

DSP PROBLEM SHEET TWO 

Question 1

Sketch the following discrete-time sequences:

(a) 2δ (n) (b) 6δ (-n) (c) u(n)

(d) (e)  p n (f) δ (   p n u n u n( ) ( ) ( )= − − 5 ( )2 )k 

n

=−∞

(g) α α  (h)nu n( ), .= −0 9 − −sin( / ) ( )n u nπ  4 (i)  p  n( )3

(j)  p n (k)n( ) ( )2 1δ  − u n(4 )− (l) u  ( . )15

 

Question 2

(a) Let  x n u n u n n( ) ( ) ( ) . ( )= + − − + −1 4 05 4δ  . Sketch and then sketch the following: x n( )

 

(i)  x n (ii) (iii) (iv)( − 2) ) ) x n(4 − x n( )2 x n(2 1+ (v)  x n u n( ) ( )2 − (vi)   x n n( ) (− −1 3)δ   

(vii) 0 5 (viii) . 0 5 1. ( ) . ( ) ( )  x n x nn+ − x n( )

2

(b) Let h nn n

( ). ,

,=

≤RST

05 4

0 otherwise. Sketch and the following functions:h n( )

 

(i) (ii) (iii) h nh n(2 − ) )h n( + 2 u n h n( ) ( ) ( )− + (iv) h n h n( ) ( )+ + − −2 1 (v) h n n( ) ( )3 1δ  −  

(vi) . h n u n u n( ){ ( ) ( )+ + − −1 3 }

)

(c) For  x n and in the last two parts sketch:( ) h n( )

 

(i) (ii)h n x n( ) ( )− x n h n( ) (+ −2 1 2 (iii)  x n h n( ) (1 4)− + (iv)  x n h n( ) ( )− −1 3 . 

Question 3

 y(n)  x(n) h(n) 

(a) For the causal system above the sampling period is T secs. Give three general expressions

relating to . x n( ) y n( )

(b) Give two general expressions for the frequency response of the above system based upon

‘digital frequency’ or ‘normalised frequency’ in rad/s.(c) As part (b), but now based upon ‘real frequency’.

(d) Find { ( if  )}h n n=010  y n x n x n y n y n( ) ( ) ( ) . ( ) . ( )= − − + − − −2 1 0 9 1 05 2 . Assume zero initial

conditions.

(e) As in part (d), find { ( , if { . Assume zero initial

conditions.

)} y n n=010 ( )} { , , , , , , , , , } x n n= =0

10 1 2 3 4 5 6 7 8 9 10

 

(f) For the following impulse responses, give the relationship between and and plot

the frequency response (

 x n( ) y n( )

  H e f   j T 

T ( ) ,

ω 0 1

2≤ ≤ for ‘real frequency’) where T =1ms.

(i) { ( (ii) { (  )} { . , . }h n n= =01 0 5 05 )} { . , . }h n n= = −0

1 05 05

(iii) { ( (iv) { ( .)} { , , , , }, .h n a a a an=∞

= =02 31 0 9 )} { , , , , }, .h n a a a an=

∞= = −0

2 31 0 9

 

Question 4

Page 9: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 9/23

   y(n)  x(n) h(n) 

(a) For the causal system above let:  y n x n ay n n( ) ( ) ( ),= − − ≥1 0

)

. What is the impulse response,

, of the system? What is the requirement for the discrete-time filter above to be stable?{ ( )}h n

(b) From part (a), derive the frequency response . If  H e j(

ω  a = 0 6. , plot both the magnitude

response{  H ej

( ) ,ω  π ω π − ≤ ≤ } and the phase response { }.φ ω π ω π  ω ( ) ( ),=< − ≤ ≤ H ej

(c) If now{ , what is the relationship between and ? Plot

both the magnitude response{

( )} { , , , , , , , , }h n n=∞

=0 11111100 x n( ) y n( )

 H ej

( ) ,ω  π ω π − ≤ ≤ } and the phase response

{ φ ω  }.π ω π ω ( ) ( ),=< − ≤ ≤ H ej

 

Question 5

 y(n)  x(n) 

h(n) 

For the following inputs and impulse responses, plot the outputs.

(a)

0 1 2 3 4 5 6 70

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

n

x(n)

INPUT

0 1 2 3 4 5 6 70

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

h(n)

IMPULSE RESPONSE

n  (b)

Page 10: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 10/23

0 1 2 3 4 5-6

-4

-2

0

2

4

6

8

n

x(n)

INPUT

0 1 2 3 4 5 6 7-4

-2

0

2

4

6

8

n

h(n)

IMPULSE RESPONSE

 

Question 6

 y(n)  x(n) 

h(n) 

For the causal system above let:  y n x n x n y n n( ) ( ) . ( ) . ( ),= + − + − ≥05 1 0 9 1 0 . Derive an

expression for the frequency content of the input [ ], if . X e j(

ω ) y n n n( ) ( ) ( )= + −δ δ  1

 

DSP(2).DOC 

Page 11: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 11/23

Department of Electronic and Electrical Engineering

Dr D. McLernon 

DSP PROBLEM SHEET THREE 

Question 1

By drawing the pole/zero plot, roughly sketch the magnitude{ H e f  j T 

T ( ) ,

ω 0 1

2≤ ≤ }and phase

{ < ≤  H e f   j T 

T ( ),ω  0 1

2≤ } responses of the folowing filters:

(i)  H z z

( ).

=

−−

1

1 051

(ii)  H zz

 z( )

.=

1 2

1 05

1

1(iii)  H z (iv) 1 2 z( ) .= −

−1 0 5

1 1−

− z  

(v) (vi)  H z z( ) = +−

12  H z

z

 z( )

.=

+

+

1

1 081

2

What is the difference between the transfer functions in (iii) and (iv)?

What is special about the transfer function in (ii)?

Question 2

(a) Consider the LDE  y n x n x n( ) ( ) ( )= + − 1 . Let the input be   x n n u n( ) sin( ) ( ),= ω ω  =π 

0 02

. Iteratively calculate

the first 10 points of the output.

(b) Calculate, and plot, the the magnitude{ H e j

( ) ,ω 

ω π 0 ≤ ≤ }and phase { } responses.

Does the output correspond to what is predicted for the steady-state output from the magnitude and phase

responses evaluated at ?

< ≤ H ej

( ),ω 

ω π 0 ≤

 y n( )

ω ω = 0

 

(c) Finally, derive an analytical expression for by using z-transforms, where Y z . Evaluate

as . Is this expression for consistent with that obtained in parts (a)

and (b)?

 y n( ) H z X z( ) ( ) ( )=

 X z( ) X z Z e u n jn( ) [ .{ ( )}]= Imag ω 0  y n( )

 

Question 3

Design a second-order notch filter, with the notch at 200Hz. Assume that the sampling frequency isFs=1000Hz, and that the poles have moduli 0.95. Sketch the pole/zero plot, and the magnitude and phase

response of the filter.

Question 4

(a) Consider a digital filter with the following LDE:  y n x n x n( ) ( ) . ( )= + −05 1 . Calculate the system function

. Sketch the pole-zero plot, and the magnitude and phase response of the filter. Give an expression for

the phase response [ ] of the filter, and thus calculate the exact frequency [ ] at which

 H z( )

θ ω ω ( ) ( )=< H e j

ω 0

θ ω ( ) is a minimum. Give the value for θ ω ( 0 )

1

1

. Compare these results with the phase response plot.

(b) Let  y n now be filtered according to . What can you say about the

overall system response,

( ) y n y n y n y n1

2 1 05( ) ( ) ( ) . ( )= + − − −

 H zY z

 X z1

1( )( )

( )= . Plot the magnitude and phase responses.

1

Page 12: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 12/23

Department of Electronic and Electrical Engineering

Dr D. McLernon 

DSP PROBLEM SHEET FOUR 

Question 1

(a) Show that  H z

a z

a z

  z a z a

a z a z

k  N k 

 N 

k k 

 N 

 N N  N 

 N  N 

( ) = =+ + +

+ + +

− +

=

=

− − +

0

0

11

111

is an all-pass system function with a gain of one,

where all the coefficients of are real. H z( )

 

(b) Show that  H zz c

cz( )

*=

1

11is an all-pass system function with a gain of one, where c is a complex coefficient.

(c) Show that the in part (a) can be expressed as a cascade of second-order sections, where each second-

order section has four coefficients that are non-unity. Sketch a DSP structure for the implementation of each

second-order section that uses only three, not four, coefficient multipliers. 

 H z( )

 

(d) Show that any rational system function for a stable causal system can be expressed as H z( )

 

 H z H H zmin ap( ) ( )=  

where the first term on the RHS corresponds to a minimum-phase system, and the second term corresponds to

an all-pass system with a gain of one for all frequencies.

(e) A communications signal passes through a distorting communications channel to give .Show how a compensating filter might be applied to to approximately ‘recover’ , even when

is not minimum-phase.

s n( ) H zd ( ) x n( ) H zc ( ) x n( ) s n( )

 H zd ( )

 

(f) For part (e), assume .

Find the compensating filter .

  H z e z e z e z e zd   j j j j( ) ( . )( . )( . )( . ). . .

= − − − −− − −− −1 0 9 1 0 9 1 125 1 1250 6 1 0 6 1 0 8 1 08 1π π π   . −π  

)

 H zc ( )

 

(g) Explain why reflecting zeros in the unit circle for any , according to , does not

affect the magnitude response of .

 H z( ) ( ) (*  z c cz− −− −

1 11

 H z( )

 

(h) For the  H  in part (f), find three other channel system functions that have the same magnitude responses.

Show that the energy of these four channels is the same, and prove the result for the general case.

 zd ( )

 

DSP(4).DOC

 

1

Page 13: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 13/23

Department of Electronic and Electrical Engineering

Dr D. McLernon 

DSP PROBLEM SHEET FIVE 

(Problems due to finite wordlength representation in DSP)

Question 1

(a) A second-order digital filter, with system function , is used as a resonant circuit, to amplify signals at the

resonant frequency of the filter. If the impulse response of the filter is:

 H z( )

 

h n r n b b u nn( ) sin[( ) ] / sin( ) ( )= + 1  

obtain  H z and the region of convergence in the  z-plane. Note that r  is non-zero and u(n) is the unit-step

function. [Use the result ]

( )

sin( ) ( ) /  θ θ θ 

= −−

e e j j

2 j

(b) Sketch the pole-zero plot for , and comment on the filter’s stability. H z( )

(c) From the pole-zero plot, approximately sketch the magnitude response of the filter,  H ej

( )ω 

. Comment on

how both the resonant frequency, and the gain at this frequency, are determined by the parameters r and b. (d) Obtain the linear difference equation relating the input  x(n) to the output  y(n) for this filter.

(e) If for a particular case of the filter in part (d), the linear difference equation is.

  y n x n y n y n( ) ( ) . ( ) . ( )= + − − −12728 1 081 2  

calculate the poles, zeros, r and b.

(f) For part (e), if we can now, due to finite register length in the DSP chip, only realise the coefficients of the

linear difference equation to one decimal place, what will be the change in the resonant frequency, b when

using these quantised coefficients? [Round the coefficients to one decimal place - i.e. round to the nearest

value].

(g) For part (f), implement the linear difference equation (with quantised coefficients) where the input is an

impulse of weight 10, and zero initial conditions - i.e.  y(-1)= y(-2)=0. Calculate the first 50 points, and plot theoutput. You may need to use MATLAB for this.

(h) For part (g), implement the linear difference equation (with quantised coefficients) where the input is an

impulse of weight 10, and zero initial conditions - i.e.  y(-1)= y(-2)=0. But now round each product term (i.e.

and b y ) to the nearest integer before adding, thus simulating the effect of finite register

length. Calculate the first 50 points, and plot the output. You may need to use MATLAB for this. Does the

output get stuck in a self-sustaining oscillation (limit-cycle) even though the input is zero? What is the length,

and what are the values, of this oscillation?

b y n1 1( − ) )n2 2( −

 

Question 2

(a) Consider the filter with system function  H za a z a z

b z b z

( ) =+ +

+ +

− −

− −

0 11

22

1 1 2 21

. Show how the position of the poles and

zeros are related to the coefficients in  H ( z), and how these poles and zeros could be affected by finite

wordlength representation of these coefficients.

(b) Consider the case where  H zr z r z b z b z

( )( )( )

=

− −

=

+ +− − −

1

1 1

1

111

21

11

22−

has two real poles. Evaluate the

sensitivity of the pole to changes in the coefficient b due to finite wordlength representation of  b . That

is, evaluate

r 1 1 1

2

1

1 constantb

b

∂. Show that as , then becomes very sensitive to changes in b .r r 1 → 2 r 1 1

 

DSP(5).DOC

1

Page 14: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 14/23

School of Electronic and Electrical Engineering

Dr D. McLernon 

DSP PROBLEM SHEET SIX 

Continuous to Discrete-Time Techniques

 Question 1

(a) Consider a first-order, low-pass, analogue RC filter, . Sketch the appropriate structure

with input and output .

 H sc( )

 x t c( ) y t c( )

(b) Using the impulse invariance method , calculate the ‘equivalent’ digital filter , and then

give the corresponding linear difference eqn (LDE).

 H z( )

(c) Let the cut-off frequency for the RC filter be , and let the sampling

frequency be . Plot

ω π  c = 2 103rad/s

ω π π  s T = =2 2 104 / rad / s H jc ( )ω  and  H e j T ( ω  ) against the same

axes, using a normalised dB scale, and let f go from 0 to 10kHz.

(d) Comment on the result in 1(c). What would happen if were increased?ω s

(e) Why could the previous method not be used if the filter output were across the resistor? 

Question 2

(a) Let  H ss s s s s s

cc( )

( )( )(=

+ + +

ω 3

1 2 3)where, s s j s jc c1 2 30 5 1 3 0 5 1 3= = + = −ω ω , . ( ) , . ( ) cω 

a d / s

.

This represents a third-order Butterworth LPF, with cut-off frequency . Expand

into three first-order terms, and using the impulse invariance method , obtain the ‘equivalent’

digital filter , as the sum of a first-order term and a second-order term.

ω c H sc( )

 H z( )

(b) Let the sampling frequency be . Plotω π π  s T = =2 2 104 / r H jc( )ω  and  H e j T 

( )ω 

 

against the same axes, using a normalised dB scale, and let f go from 0 to 10kHz.(c) Compare and contrast the results for 2(b) and 1(c).

Question 3

(a) Consider a second-order analogue RCL circuit, configured as a LPF. Sketch the appropriate

structure with input and output . x t c( ) y t c ( )

(b) Show thatd y t 

dt 

dy t 

dt   y t x t  c c

c

2

2 02

02

2( ) ( )

( ) ( )+ + =σ ω ω  c where .σ ω = =  R L LC   / , /  2 102

(c) To ‘discretise’ the eqn in 3(b), justify why we can make the substitution

dy t 

dt 

 y n y n

c

t nT 

( ) ( ) ( )

=

≈− −1

, where T  represents the sampling period and

.By using, and developing this substitution to obtain an expression for  y n y nT  c( ) ( )=

dy t 

dt 

c2

22

( ), show that the ‘equivalent’ digital filter , has the following LDE: H z( )

 

 y n a x n b y n b y n( ) ( ) ( ) ( )= + − + −0 1 21 2

 

where  y n y nT x n x nT a T D b T D b Dc c( ) ( ), ( ) ( ), / , ( ) , /  = = = = + =0 02 2

1 22 1 1ω σ   −

and . D T = + +1 2 02 2

σ ω 

(d) Show that, as expected, .  H e H j T   j T c( ) ( ),ω 

ω = →as 0

(e) Show why this technique for continuous to discrete-time modelling, is called the backward-difference method , and corresponds to the mapping . Explain why this

mapping will always transform

s z= −−

( ) / 11

stable analogue filters into stable digital filters.

Page 15: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 15/23

(f) Explain why the following is the mapping associated with the forward-difference method :

. Show that it may sometimes transforms z T = −( ) / 1 stable analogue filters into unstable

digital filters.

Question 4

Let  H ss s s s s sc

( ).

( . . )( . . )( . . )=

+ + + + + +

0 20238

0396 05871 1083 05871 14802 058712 2 2be the transfer

function of a pre-warped LP Butterworth filter - pre-warped in preparation for bilinear 

transformation to the z-domain. is a LPF with a very low cut-off frequency, and is to

be used to filter electro-mechanical signals with small bandwidths. Find as the cascade

of three second-order terms, and plot

 H zc ( )

 H z( )

 H e j T ( ω  ) , where T =1sec. Comment on the result, and

why the roll-off from passband to stopband is so sharp, compared to the impulse-invariance

method.

Finally, give the appropriate linear difference eqns for the cascade implementation.

Question 5

Let  H ss a

c ( ) =

+

1be a stable LP analogue filter. Show that if the sampling rate ( ) is

very high, then the bilinearly transformed digital filter equivalent can be approximated

by

 f T s = 1/ 

 H z( )

 H za

 z

 z eT aT 

( ) ≈

+

H G

K J 

+

F H G

I K J −

1 12

.

Comment on the zero at  z = -1 and the pole at  z eaT 

=− , and any similarities with the impulse

invariance method .

Question 6

Consider a first-order, low-pass, analogue RC filter, . Sketch the appropriate structure

with input and output . Using the bilinear transformation obtain , and show

that .

 H sc( )

 x t c( ) y t c( ) H z( )

  H e H j T   j T 

c( ) ( ),ω ω = →as 0

 

Question 7

Starting from the transfer functions for an ideal integrator and differentiator, obtain

the equivalent discrete-time linear difference eqns, derived via the bilinear transformation. 

Comment on any practical implementation problems, and how these might be resolved.

 H sc( )

 Question 8

Describe the input invariant simulation of with . Thus find the ramp-invariant

simulation of . Find the response of to the signal

 H sc ( ) H z( )

( ) 1/( 1)c  H s s= + H sc( ) ( ) 2 ( )t c  x t te u t  

−= .

Compare this with the response of to H z( ) ( ) ( )c  x n x nT  = , where T =0.6 secs. Is this what

you would expect? Make use of the following transforms: 1( / !) ( ) 1/  k k t k u t s

+↔ ;

; .1( / !) ( ) 1/( )k at k  t k e u t s a

− +↔ +

2( ) /( 1)nu n z z↔ −

 

DSP(6).DOC

Page 16: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 16/23

School of Electronic and Electrical Engineering

Dr D. McLernon 

DSP PROBLEM SHEET SEVEN 

Probability and Random Processes(1)

Question 1

(a) Which of the following functions, , could be p.d.f.’s? p x X ( )

 

(i)  p x (ii) (iii)e x

 x X 

 x

( ),

,=

<

RS|

T|

− 0

0 0 p x

e x

 x X 

 x

( ). ,

,=

− ≥

<

RS|

T|

−0 5 0

0 0 p x Ce C   X 

 x( ) ,= >−α α  0

(b) Let the voltage (V ) in a part of a receiver of a communications system be considered to be a

random variable with  p va v v

vV ( )

,

,=

>

RS|

T|

3

0 3. Sketch . Find a , , and the power

delivered across a one ohm resistor. Also find the probability that 1 2

 p vV ( ) μ V  σ V 2

< ≤V  .

(c) Two random variables,  X  and Y , representing respectively the instantaneous magnitude and

phase response of a time-varying system, have the following joint p.d.f. :

. p x y Ae x y

otherwise X Y 

 x y

,( )

( , ), ,

,= ≥RS|

T|

− +2 0

0

Find the value for  A. Sketch the joint p.d.f. Find the marginal p.d.f.’s, and ,

and sketch them.

 p x X ( )  p yY ( )

(d)  Let  X  and Y  be random variables representing two parameters within a communication

system. Also, let X and Y  be related as follows for the whole of this question: .Y aX b= +

(i)  Obtain and , in terms of and .μ Y   E Y = { } σ μ Y  Y  E Y 2 = −{( ) }2

μ  X  σ  X 2

(ii)  Derive an expression for the correlation coefficient ( ) relating  X  and Y .

Comment on the result.

 ρ  XY 

(iii) It is possible to prove that the p.d.f. of Y is  p ya

 p y b

aY X ( ) ( )=

−1. So if  X is now a

random variable with a Gaussian p.d.f.  p x e X  X 

 x  X ( ) ( ) /(= − −1

2

2 22

π σ 

μ σ  X )

.

, sketch

both p.d.f.’s and comment on the result. 

Question 2

(a)  Given a random variable with a p.d.f. , write down an expression for in terms of 

, and thus prove the result:

 p x X ( ) σ  X 2

 p x X ( )  E X   X X { }2 2 2= +σ μ 

(b)  At the front end of a DSP board in a communications receiver is an A/D converter with

sampling period, T secs. The A/D has 8-bits output, and its dynamic range is ±5V  . Let the

input analogue signal be , and the output sampled signal be . Sketch how the

quantisation error e n occurs, and derive and sketch its p.d.f., , justifying anyassumptions that you make, where:

( ) x t   x n( )

T ( )  p ee ( )

 x n x nT e nT  ( ) ( ) ( )= + .

Obtain numerical expressions for and and . Show why increasing the number

of bits for the A/D converter by one, increases the signal to noise ratio (SNR) at the output of 

the A/D converter by approximately 6dB.

μ e σ e2  E e{ }

2

 

Question 3

One of the most important random variables in communications is the Gaussian or Normal

random variable, X . Its p.d.f. is:

 p x e X  X 

 x  X X 

( )

( ) /(

=

− −1

2

2 22

π σ 

μ σ  )

.

(a)  Explain, with reference to the central limit theorem, why the Gaussian random variable occurs

so frequently.

Page 17: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 17/23

(b)  Explain the significance of the result:  p x dx X 

 X X 

 X X 

( ) .

μ σ 

μ σ 

+

+

z  =

2

2

0954 for a Gaussian random variable.

(c)  Explain why all the odd-order central moments of a Gaussian random variable,  X , are zero.

That is: . E X   X n

[( ) ]− =+μ 

2 10

(d)  In a cellular mobile communications system, we often talk about  Rayleigh fading channels.

This refers to the p.d.f. of the random variable ( X ) associated with the power spectrum of the

received r.f. signal at a particular frequency. We can say  p x  x x

 X 

 x

a

 x

a( ) exp( ),,

=− ≥

<

R

S|T|

2

2

22 00 0

.

(i)  Explain the above statement with the aid of a sketch.

(ii)  Show that and E X a{ }2 2

2= μ π  X  a=  / 2 .

(iii)  Thus give an expression for .σ  X 2

 

Question 4

(a) Let X  be a random variable represented the value of a received voltage in a communication

system. Let X  have the following uniform p.d.f. :

 p x

b a a x b

 X ( )

 / ( ),

,=

− ≤ ≤R

ST

1

0 otherwise .

(i)  Sketch . p x X ( )

(ii)  Is a valid function for a p.d.f.? p x X ( )

(iii)  Calculate , , and thus .μ  X  E X { }

2σ  X 

2

(b) The expectation operator is distributive over addition – that is,  E aX bY aE X bE Y  [ ] [ ] [ ]+ = + ,

where ‘ X ’ and ‘Y ’ are random variables, and ‘a’ and ‘b’ are constants. In addition, if ‘ X ’ and

‘Y ’ are statistically independent  (i.e. one does not ‘influence’ or ‘affect’ the other), then we

can also say: . E XY E X E Y  [ ] [ ] [= ]

2

2

 

(i)  Let be two random noise sources in a communications channel that

combine in the following fashion to produce Y  where: ,

constants. Find the mean value ( ) of  Y in terms of .

 X X 1 and

Y a X a X  = +1 1 2 2

a a1 2,

μ Y  μ μ  X X 1 2

and

(ii)  In addition, if are now also statistically independent , derive an

expression for the variance ( ) of  Y , in terms of .

 X X 1 and

 E Y  Y [( ) ]− μ 2 a a

 X X 1 22 2

1 2

, ,σ σ and

Question 5

(a)  For two random variables, ‘ A’ and ‘ B’, Baye’s rule states P B AP AB

P A( | )

( )

( )= , where

‘ ’ means ‘  probability of event B occurringP B A( | ) given that event A has occurred ’.

‘ ’ means ‘  probability of both A and B happening together ’. Finally, means

‘ probability of A happening’. Illustrate Baye’s rule with a Venn diagram.

P AB( ) P A( )

(b)  Two, and only two, random symbols ( A and  B) are transmitted over a binary channel. The

probabilitypof an ‘ A’ being sent is 0.6 (i.e. P( A sent)=0.6 ). The probability of a ‘ B’ being

received, given that an ‘ A’ had been sent, is 0.1 (i.e. P( B received | A sent)=0.1). The

probability of a ‘ B’ being received, given that a ‘ B’ had been sent, is 0.8 (i.e. P( B received | B

sent)=0.8). Draw the probability input/output signal flow diagram.

(c)  What is the probability of error for this channel?

(d)  Use Baye’s rule to obtain P( A sent| A received).

(e)  Use Baye’s rule to obtain P( B sent| B received).

(f)  Use Baye’s rule to obtain P( A sent| B received).

(g)  Use Baye’s rule to obtain P( B sent| A received).

(h)  Show that these last four results are consistent.

Page 18: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 18/23

Question 6

Let X and Y be two independent random variables with pdf’s ( ) X  p x and ( )Y  p y . Let Z = X +Y . Show

that the pdf of  Z is the convolution of the pdf’s of  X and Y :

( ) ( ) ( ) ( ) ( ) Z X Y X Y   p z p x p y p x p z x dx∞

−∞= ∗ = −∫  .

Question 7

A computer adds 1000 random numbers that have each been rounded off to the nearest 10th. Find the

probability that the total round-off error for the sum is Use the Central Limit Theorem.1.≥

Page 19: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 19/23

Page 20: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 20/23

(c)  Use the results of parts (a) and (b) to solve the following Wiener filtering problem. Let the

input to the filter be  x nn

 M ( ) sin( )= 4

2π  

. Let the output from the filter be

 y n h x n h x n( ) ( ) ( ) ( ) ( )= +0 1 − 1 - i.e. a first-order FIR filter. Let the desired response be

d nn

 M ( ) cos( )= −2

2π  

. If  M =5, find the optimal coefficients { ( for the filter. What is

in this case?

) ( )}h h0 1

 J E e n= { ( )}2

(d)  Using the optimal coefficients in part (c), evaluate { ( )} x n n=010 , { ( )} y n n=010 and { ( , thus

confirming that

)}d n n=010

 y n d n( ) ( )= for n = 1 1,2, , 0. Why not for n=0?

Question 5

(a)  Consider the following Wiener filtering problem. Let the input to the filter be

 x nn

 M ( ) cos( )=

2π  

. Let the output from the filter be  y n h x n h x n( ) ( ) ( ) ( ) ( )= + −0 1 1 - i.e. a first-

order FIR filter. Let the desired response be d nn

 M ( ) cos( )=

2π  

. This looks trivial (i.e.

h h( ) , ( )0 1 1 0= = is clearly a solution), but try and formally find the optimal coefficients

for the filter for M =2, using a similar method as in question 4. Is there a problem?Explain the result.{ ( ) ( )}h h0 1

Page 21: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 21/23

School of Electronic and Electrical Engineering

Dr D. McLernon

DSP PROBLEM SHEET NINE: FIR FILTERS – Time Domain 

Question 9.1

Question 9.2

Question 9.3

Page 22: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 22/23

Question 9.4

Question 9.5

Question 9.6

Question 9.7

Page 23: Problem Sheets 1-9

8/8/2019 Problem Sheets 1-9

http://slidepdf.com/reader/full/problem-sheets-1-9 23/23

Question 9.8