Problem Sheets 1-9

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Department of Electronic and Electrical Engineering

Dr D. McLernon

DSP PROBLEM SHEET ONE

x i( t ) x (t) x (n ) D SP y(n ) y (t) y o(t)


LPF A D C D A C LPF
C H IP
a n ti- a lia s in g f ilte r s m o o th in g filte r
F s= 1 /T F s= 1 /T

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) ej(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) cos (nπ/16) (vi) cos(nπ/30)+cos(nπ/20)
2

(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.5y(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
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 2 y (t ) dy (t )
2
+5 + 6 y (t ) = 7 x (t ) .
dt dt

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

a0 y n + a1 y n −1 + a2 y n − 2 = 7 xn .

(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 x (t ) is the input and y (t ) is the output.
Using the backward difference method of approximation find the coefficients a0 and b1 (in
terms 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 yn is the output from the
LDE approximation:
y n = a0 xn + b1 y n −1 .

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

x (t ) =
RS1 volt, t≥0
.
T0 volts, otherwise

Compare the output of the LDE ( yn ) with the true output of the analogue circuit ( y(t ) ). How
would the result change if T=0.05sec? What would happen as T → 0 secs?

Question 6

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

y ( n) = a1 y ( n − 1) + b0 x ( n), n ≥ 0 .

Let the initial condition be y( −1) = 0 , and let the input be x ( n) = a n u( n) .Find an expression
for y (n) if y (n) = y p (n) + yc (n) where the terms on the right-hand side are respectively the
particular solution and the complimentary solution.

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

DSP(1).DOC
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
Question 10.4

Question 10.5

Question 10.6
School of Electronic and Electrical Engineering
Dr D. McLernon

DSP PROBLEM SHEET ELEVEN: DFT/DTFT


Question 11.1
N −1 N −1
∑ ∑
1
If x ( n ) = 1, 0 ≤ n ≤ N − 1, show that Parseval's Rule holds, i.e. x ( n) X (k )
2 2
= .
N
n =0 k =0
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:
N −1
X (k ) = ∑ x ( n )WNk n , WN = e− j 2π / N .
n =0
Note that Parseval’s Rule holds for any signal x(n) that has a DFT.

Question 11.2
N −1 N −1 π

∫ X ( e )
2
∑ ∑
1 1 jω
x ( n) X (k )
2 2
Show = = d ω is true for N = 3 in Example 11.1. Note
N 2π
n =0 k =0 −π

that the Discrete-Time Fourier Transform (DTFT) of x ( n) is X (e jω ) , so that



X (e jω ) = ∑ x(n)e− jω n . This is to distinguish the DTFT, X (e jω ) , from the DFT, X ( k ) .
n =−∞

Question 11.3
N −1
Let x(t ) = cos(ω 0t ) and sample x (t ) every T secs to get { x(n)}n=0 where x(n) = cos(ω 0 nT ) . Let the
radian sampling frequency be ω s = 2π / T and let the frequency of x (t ) lie exactly on a DFT line – i.e.
ω o = pω s / N where p is an integer, 0 ≤ p ≤ N − 1 , corresponding to the (p+1)-th DFT line. Thus we
can say that:
2π ω sT
x(n) = cos(ω0 nT ) = cos(np
) = cos(np ), n = 0,1,..., N − 1
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 x1 ( n ) = x2 ( n ) = 1, 0 ≤ n ≤ N − 1 . Show that x3 ( n ) ≠ x1 ( n ) ∗ x2 ( n ) where
N −1
x3 ( n ) = DFT −1 { X1 ( k ) X 2 ( k )} and x1 ( n ) ∗ x2 ( n ) = ∑ x1 ( k ) ∗ x2 ( n − k ) . That is, multiplying the
k =0
DFTs together is not equivalent to linear convolution. However, multiplying the DTFTs together is
equivalent 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, w( n) , and then take the
DFT/DTFT of the resulting product w(n) x(n) . The question is, how does windowing affect the value of

1
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:
⎡ ⎧ jω
2 ⎫⎤
⎢ ⎪ X N (e ) ⎪ ⎥
S xx (ω ) = Lim ⎢ E ⎨ ⎬⎥
N →∞ ⎢ ⎪ N ⎪⎥
⎢⎣ ⎩ ⎭⎥⎦
where
N −1
{ x(n)}nN=−01 ↔ X N (e jω ), X N (e jω ) = ∑ x(n)e− jω n .
n =0

For example, let {x( n)} be a zero-mean, white-noise process, with S xx (ω ) = 1 [i.e.
N −1 N −1
E{x( n) x( m)} = δ (n − m) ], but now let a window {w(n)} n =0
be applied to { x(n)} n =0
. So

{w(n) x(n)}nN=−01 is used instead of { x(n)}nN=−01 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:

x3 ( n ) = e j (ω 0 n +φ ) , n = 0,1,..., N − 1
 2π
with ω0 ≠ p , p integer . Note that the DFT lines are spaced at intervals of 2π / N .
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

ωˆ 0 = 2.25 .
N

Question 11.7

Consider a continuous-time signal xc (t ) = cos(ω 0 t ), − ∞ ≤ t ≤ ∞ where ω0 = 2π F0 = . Let the
T0
signal be windowed by a rectangular window to give xw (t ) = w(t ) xc (t ) where:

⎧ x (t ), 0 ≤ t ≤ Tw
xw (t ) = ⎨ c .
⎩0, otherwise

Let the windowed signal be sampled with a sampling frequency ω s = 2π Fs = :
Ts

⎧ x (nTs ), 0 ≤ n ≤ N −1
x ( n) = ⎨ w .
⎩0, otherwise

(i) Plot xc (t ) , xw (t ) and x (n) for the particular case of:


F0 = 300Hz; T0 = 3.33ms
Fs = 2000Hz; Ts = 0.5ms
Tw = ( N − 1)Ts = 5ms
N = 11

2
(ii) For the general case, derive expressions for the Fourier Transform (FT) of xc (t ) (i.e.
X (ω ) ), the FT of x (t ) (i.e. X (ω ) ), the DTFT of x ( n) (i.e. X (e jω ) ), and the DFT
c w w
N −1
of { x(n)} n =0
(i.e. Xˆ ( k ) );
(iii) For the particular values in (i), compare and contrast the plots for X c (ω ) , X w (ω ) ,

X (e jωTs ) 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:

∞ π
1

2
∫ X (e jω ) d ω
2
x ( n) =
n =−∞ 2π −π
where the sequence x ( n) may be complex, and the DTFT equations are

π
1
x ( n) = ∫ X (e jω )e jω n d ω
2π −π

X (e jω ) = ∑ x(n)e − jω n .
n =−∞

You may also wish to make use of the following:


ƒ ∫ f (t )δ (t − T )dt = f (T ), (Sifting Property of δ (t ))
−∞
where f (t ) is any function of any continuous variable, t, and δ (t ) is the
“delta function”. And also use:

∞ ∞
ƒ ∑ e jnω = 2π ∑ δ (ω − n2π ), (Poisson Sum Formula)
n =−∞ n =−∞
where ω is any continuous variable, and δ (ω ) is the “delta function”
such that:

⎧0, ω ≠ 0
δ (ω ) = ⎨
⎩undefined, ω = 0.

3
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)
n
(d) p(n) = u(n) − u(n − 5) (e) p( n 2 ) (f) ∑δ (k )
k =−∞
(g) α n u(n), α = −0.9 (h) − sin(nπ / 4)u( − n) (i) p(3n)
(j) p(2n)δ (n − 1) (k) u(4 − n) (l) u(15
.)

Question 2

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

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

(b) Let h(n) =


RS0.5n, n ≤4
. Sketch h( n) and the following functions:
T0 , otherwise

(i) h(2 − n) (ii) h(n + 2) (iii) h( − n)u( n) + h(n) (iv) h( n + 2) + h( −1 − n) (v) h(3n)δ (n − 1)
(vi) h( n + 1){u(n + 3) − u( − n)} .
(c) For x ( n) and h ( n ) in the last two parts sketch:

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

Question 3
x(n) y(n)
h(n)

(a) For the causal system above the sampling period is T secs. Give three general expressions
relating x (n) to 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) n=0 if y (n) = x (n) − 2 x (n − 1) + 0.9 y (n − 1) − 0.5 y (n − 2) . Assume zero initial
Find {h(n)}10
conditions.
n=0 , if {x ( n)}n= 0 = {1,2,3,4,5,6,7,8,9,10} . Assume zero initial
As in part (d), find {y (n)}10 10
(e)
conditions.

(f) For the following impulse responses, give the relationship between x ( n) and y (n) and plot
the frequency response ( H (e jωT ) ,0 ≤ f ≤ 21T for ‘real frequency’) where T=1ms.

(i) {h(n)}1n= 0 = {0.5,0.5} (ii) {h(n)}1n= 0 = {0.5,−0.5}


∞ ∞
0 = {1, a , a , a ,"}, a = 0.9 (iv) {h( n)}n= 0 = {1, a , a , a ,"}, a = −0.9 .
2 3 2 3
(iii) {h(n)}n=

Question 4
x(n) y(n)
h(n)

(a) For the causal system above let: y (n) = x (n) − ay (n − 1), n ≥ 0 . What is the impulse response,
{h(n)} , of the system? What is the requirement for the discrete-time filter above to be stable?
(b) From part (a), derive the frequency response H ( e jω ) . If a = 0.6 , plot both the magnitude
response{ H (e jω ) ,−π ≤ ω ≤ π } and the phase response { φ (ω ) =< H (e jω ),−π ≤ ω ≤ π }.

(c) If now {h(n)}n= 0 = {111111
, , , , , ,0,0,"} , what is the relationship between x ( n) and y (n) ? Plot
both the magnitude response{ H (e jω ) ,−π ≤ ω ≤ π } and the phase response

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

Question 5
x(n) y(n)
h(n)

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

(a)

INPUT
5

4.5

3.5

2.5
x(n)
2

1.5

0.5

0
0 1 2 3 4 5 6 7
n
IMPULSE RESPONSE
1

0.9

0.8

0.7

0.6

0.5
h(n)
0.4

0.3

0.2

0.1

0
0 1 2 3 4 5 6 7
n

(b)
INPUT
8

x(n)0

-2

-4

-6
0 1 2 3 4 5
n
IMPULSE RESPONSE
8

2
h(n)

-2

-4
0 1 2 3 4 5 6 7
n

Question 6
x(n) y(n)
h(n)

For the causal system above let: y (n) = x (n) + 0.5x (n − 1) + 0.9 y (n − 1), n ≥ 0 . Derive an
expression for the frequency content of the input [ X (e jω ) ], if y (n) = δ ( n) + δ ( n − 1) .

DSP(2).DOC
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 jωT ) ,0 ≤ f ≤ 21T }and phase

{ < H (e jωT ),0 ≤ f ≤ 1


2T
} responses of the folowing filters:

1 1 − 2 z −1
(i) H ( z) = (ii) H ( z ) = (iii) H ( z ) = 1 − 0.5z −1 (iv) 1 − 2 z −1
1 − 0.5z −1 1 − 0.5z −1

1 + z −2
(v) H ( z ) = 1 + z −2 (vi) H ( z ) =
1 + 0.81z −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) = sin(nω 0 ) u( n), ω 0 = . Iteratively calculate
2
the first 10 points of the output.

(b) Calculate, and plot, the the magnitude{ H (e jω ) ,0 ≤ ω ≤ π }and phase { < H ( e jω ),0 ≤ ω ≤ π } responses.
Does the output y (n) correspond to what is predicted for the steady-state output from the magnitude and phase
responses evaluated at ω = ω 0 ?

(c) Finally, derive an analytical expression for y (n) by using z-transforms, where Y ( z ) = H ( z ) X ( z ) . Evaluate
X ( z ) as X ( z ) = Z[Imag.{e jnω 0 u(n)}] . Is this expression for y (n) consistent with that obtained in parts (a)
and (b)?

Question 3

Design a second-order notch filter, with the notch at 200Hz. Assume that the sampling frequency is
Fs=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) + 0.5x (n − 1) . Calculate the system function
H ( z ) . Sketch the pole-zero plot, and the magnitude and phase response of the filter. Give an expression for
the phase response [ θ (ω ) =< H (e jω ) ] of the filter, and thus calculate the exact frequency [ ω 0 ] at which
θ ( ω ) is a minimum. Give the value for θ ( ω 0 ) . Compare these results with the phase response plot.

(b) Let y (n) now be filtered according to y1 ( n) = y ( n) + 2 y ( n − 1) − 0.5 y1 ( n − 1) . What can you say about the
Y1 ( z )
overall system response, H1 ( z ) = . Plot the magnitude and phase responses.
X ( z)

1
Department of Electronic and Electrical Engineering
Dr D. McLernon

DSP PROBLEM SHEET FOUR

Question 1

N
∑ ak z − N + k z − N + a1z − N +1 + " + a N
k =0
(a) Show that H ( z ) = = is an all-pass system function with a gain of one,
N
1 + a1z −1 + " + a N z − N
∑ ak z −k

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

z −1 − c*
(b) Show that H ( z ) = is an all-pass system function with a gain of one, where c is a complex coefficient.
1 − cz −1

(c) Show that the H ( z ) 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.

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

H ( z ) = H min H ap ( z )

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 s( n) passes through a distorting communications channel H d ( z ) to give x ( n) .


Show how a compensating filter Hc ( z ) might be applied to x ( n) to approximately ‘recover’ s( n) , even when
H d ( z ) is not minimum-phase.

(f) For part (e), assume Hd ( z ) = (1 − 0.9e j 0.6π z −1 )(1 − 0.9e − j 0.6π z −1 )(1 − 125
. e j 0.8π z −1 )(1 − 125
. e − j 0.8π z −1 ) .
Find the compensating filter H c ( z ) .

(g) Explain why reflecting zeros in the unit circle for any H ( z ) , according to ( z −1 − c * ) 6 (1 − cz −1 ) , does not
affect the magnitude response of H ( z ) .

(h) For the Hd ( z ) 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.

DSP(4).DOC

1
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 H ( z ) , 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( n) = r n sin[( n + 1)b] / sin(b) u( n)

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 jθ − e − jθ ) / 2 j ]
(b) Sketch the pole-zero plot for H ( z ) , and comment on the filter’s stability.
(c) From the pole-zero plot, approximately sketch the magnitude response of the filter, H (e jω ) . 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) + 12728


. y (n − 1) − 0.81y (n − 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 the
output. 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.
b1 y ( n − 1) and b2 y ( n − 2) ) 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?

Question 2

a0 + a1z −1 + a2 z −2
(a) Consider the filter with system function H ( z ) = . Show how the position of the poles and
1 + b1z −1 + b2 z −2
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.

1 1
(b) Consider the case where H ( z) = = has two real poles. Evaluate the
(1 − r1z )(1 − r2 z ) 1 + b1z + b2 z −2
−1 −1 −1

sensitivity of the pole r1 to changes in the coefficient b1 due to finite wordlength representation of b1 . That
∂r1
is, evaluate . Show that as r1 → r2 , then r1 becomes very sensitive to changes in b1 .
∂ b1 b2 constant

DSP(5).DOC

1
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, H c ( s ) . Sketch the appropriate structure
with input xc ( t ) and output yc ( t ) .
(b) Using the impulse invariance method, calculate the ‘equivalent’ digital filter H ( z ) , and then
give the corresponding linear difference eqn (LDE).
(c) Let the cut-off frequency for the RC filter be ω c = 2π 103 rad / s , and let the sampling
frequency be ω s = 2π / T = 2π 10 4 rad / s . Plot H c ( jω ) 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 ω s were increased?
(e) Why could the previous method not be used if the filter output were across the resistor?

Question 2

ω c3
(a) Let Hc ( s) = where, s1 = ω c , s2 = 0.5(1 + j 3 )ω c , s3 = 0.5(1 − j 3 )ω c .
( s + s1 )( s + s2 )( s + s3 )
This represents a third-order Butterworth LPF, with cut-off frequency ω c . Expand H c ( s )
into three first-order terms, and using the impulse invariance method, obtain the ‘equivalent’
digital filter H ( z ) , as the sum of a first-order term and a second-order term.
(b) Let the sampling frequency be ω s = 2π / T = 2π 10 4 rad / s . Plot H c ( jω ) 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 xc ( t ) and output yc ( t ) .
d 2 yc ( t )
dyc ( t )
(b) Show that 2
+ 2σ + ω 20 yc ( t ) = ω 20 xc ( t ) where σ = R / 2 L, ω 20 = 1 / LC .
dt dt
(c) To ‘discretise’ the eqn in 3(b), justify why we can make the substitution
dyc ( t ) y ( n ) − y( n −1)
≈ , where T represents the sampling period and
dt t = nT T
y ( n ) = yc ( nT ) .By using, and developing this substitution to obtain an expression for
dyc2 ( t )
, show that the ‘equivalent’ digital filter H ( z ) , has the following LDE:
dt22

y ( n ) = a0 x ( n ) + b1 y ( n − 1) + b2 y ( n − 2 )

where y ( n ) = yc ( nT ), x ( n ) = xc ( nT ), a0 = ω 20T 2 / D, b1 = 2(1 + σT ) D, b2 = −1 / D


and D = 1 + 2σT + ω 20T 2 .
(d) Show that, as expected, H ( e jωT ) = H c ( jω ), as T → 0 .
(e) Show why this technique for continuous to discrete-time modelling, is called the backward-
difference method, and corresponds to the mapping s = (1 − z −1 ) / T . Explain why this
mapping will always transform stable analogue filters into stable digital filters.
(f) Explain why the following is the mapping associated with the forward-difference method:
s = ( z − 1) / T . Show that it may sometimes transform stable analogue filters into unstable
digital filters.

Question 4

0.20238
Let H c ( s ) = be the transfer
( s + 0.396s + 0.5871)( s + 1083
2
. s + 0.5871)( s 2 + 14802
2
. s + 0.5871)
function of a pre-warped LP Butterworth filter - pre-warped in preparation for bilinear
transformation to the z-domain. H c ( z ) is a LPF with a very low cut-off frequency, and is to
be used to filter electro-mechanical signals with small bandwidths. Find H ( z ) as the cascade
of three second-order terms, and plot 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

1
Let H c ( s ) = be a stable LP analogue filter. Show that if the sampling rate ( f s = 1 / T ) is
s+a
very high, then the bilinearly transformed digital filter equivalent H ( z ) can be approximated
F 1 I FG z + 1 IJ .
by H ( z ) ≈ GH a + 2
T
JK H z − e K
− aT

Comment on the zero at z = -1 and the pole at z = e − aT , and any similarities with the impulse
invariance method.

Question 6

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


with input xc ( t ) and output yc ( t ) . Using the bilinear transformation obtain H ( z ) , and show
that H ( e jωT ) = H c ( jω ), as T → 0 .

Question 7

Starting from the H c ( s ) 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.

Question 8

Describe the input invariant simulation of H c ( s ) with H ( z ) . Thus find the ramp-invariant
simulation of H c ( s ) = 1/( s + 1) . Find the response of H c ( s ) to the signal xc (t ) = 2te−t u (t ) .
Compare this with the response of H ( z ) to x(n) = xc ( nT ) , where T=0.6 secs. Is this what
you would expect? Make use of the following transforms: (t k / k !)u (t ) ↔ 1/ s k +1 ;
(t k / k !)e− at u (t ) ↔ 1/( s + a ) k +1 ; nu (n) ↔ z /( z − 1)2 .

DSP(6).DOC
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, p X ( x ) , could be p.d.f.’s?

(i) p X ( x ) =
|RSe , x ≥ 0
−x
(ii) p X ( x ) =
|RS0.5 − e , x ≥ 0
−x
(iii) p X ( x ) = Ce −αx C,α > 0
|T0, x < 0 |T0, x < 0
(b) Let the voltage (V) in a part of a receiver of a communications system be considered to be a
R|
av, v ≤3
random variable with pV ( v ) = S| . Sketch pV (v ) . Find a , μ V , σ V2 and the power
T
0, v > 3
delivered across a one ohm resistor. Also find the probability that 1 < V ≤ 2 .
(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 ( x , y ) =
|RS Ae −(2 x + y )
, x, y ≥ 0
|T0, otherwise
.

Find the value for A. Sketch the joint p.d.f. Find the marginal p.d.f.’s, p X ( x ) and pY ( y ) ,
and sketch them.
(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 μ Y = E {Y} and σ Y2 = E {(Y − μ Y ) 2 } , in terms of μ X and σ 2X .
(ii) Derive an expression for the correlation coefficient ( ρ XY ) relating X and Y.
Comment on the result.
1 y −b
(iii) It is possible to prove that the p.d.f. of Y is pY ( y ) = pX ( ) . So if X is now a
a a
1
e −( x − μ X ) /( 2σ 2X )
2
random variable with a Gaussian p.d.f. p X ( x ) = , sketch
2πσ X
both p.d.f.’s and comment on the result.
Question 2

(a) Given a random variable with a p.d.f. p X ( x ) , write down an expression for σ 2X in terms of
p X ( x ) , and thus prove the result: E { X 2 } = σ 2X + μ 2X .
(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 x (t ) , and the output sampled signal be x (n) . Sketch how the
quantisation error e( nT ) occurs, and derive and sketch its p.d.f., pe ( e) , justifying any
assumptions that you make, where:
x (n) = x (nT ) + e(nT ) .
Obtain numerical expressions for μ e and σ 2e and E {e 2 } . 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.

Question 3

One of the most important random variables in communications is the Gaussian or Normal
random variable, X. Its p.d.f. is:
1
e − ( x − μ X ) /( 2σ X ) .
2 2
p X ( x) =
2πσ X
(a) Explain, with reference to the central limit theorem, why the Gaussian random variable occurs
so frequently.
z
μ X + 2σ X
(b) Explain the significance of the result: p X ( x )dx = 0.954 for a Gaussian random variable.
μ X + 2σ X
(c) Explain why all the odd-order central moments of a Gaussian random variable, X, are zero.
That is: E [( X − μ X ) 2 n +1 ] = 0 .
(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
R| x exp(− 2xa ), x ≥ 0 .
received r.f. signal at a particular frequency. We can say p X ( x ) = S a 2
2
2

T|0, x < 0
(i) Explain the above statement with the aid of a sketch.
(ii) Show that E { X 2 } = 2a 2 and μ X = a π / 2 .
(iii) Thus give an expression for σ 2X .

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 ( x) =
RS
1 / (b − a ), a ≤ x ≤ b
.
T
0, otherwise
(i) Sketch p X ( x ) .
(ii) Is p X ( x ) a valid function for a p.d.f.?
(iii) Calculate μ X , E { X 2 } , and thus σ 2X .
(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 ] .

(i) Let X 1 and X 2 be two random noise sources in a communications channel that
combine in the following fashion to produce Y where: Y = a1 X 1 + a2 X 2 , a1 , a2
constants. Find the mean value ( μ Y ) of Y in terms of μ X and μ X .
1 2

(ii) In addition, if X 1 and X 2 are now also statistically independent, derive an


expression for the variance ( E [(Y − μ Y ) 2 ] ) of Y, in terms of a1 , a 2 , σ 2X and σ 2X .
1 2

Question 5

P ( AB )
(a) For two random variables, ‘A’ and ‘B’, Baye’s rule states P ( B| A) = , where
P ( A)
‘ P ( B| A) ’ means ‘probability of event B occurring given that event A has occurred’.
‘ P( AB ) ’ means ‘probability of both A and B happening together ’. Finally, P ( A) means
‘probability of A happening’. Illustrate Baye’s rule with a Venn diagram.
(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.
Question 6

Let X and Y be two independent random variables with pdf’s p X ( x) and pY ( y ) . Let Z=X+Y. Show
that the pdf of Z is the convolution of the pdf’s of X and Y:

pZ ( z ) = p X ( x) ∗ pY ( y ) = ∫
−∞
p X ( x) pY ( 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 ≥ 1. Use the Central Limit Theorem.
School of Electronic and Electrical Engineering
Dr D. McLernon

DSP PROBLEM SHEET EIGHT


Random Processes
Question 1

(a) Given a real, stationary, random process,{x (n)} (from a received communication signal), give
an expression for the definition of the autocorrelation function, Rxx ( m) . Describe, in your
own words, what Rxx (m) measures. What would Rxx ( m) look like if {x (n)} were also a white
process.
(b) Give an expression for how we may estimate Rxx ( m) from {x (n)}, if {x (n)} is also an ergodic
process.
(c) If we have a sample sequence from a white random process, {x(n)}={-2,-4,2,2,5,-1,1,4,-4,-4},
obtain an estimate for Rxx ( m) and comment on how accurate this estimate is.

Question 2

Let us examine some of the properties of the autocorrelation function, Rxx ( m) for a real, stationary,
random process.

(a) Prove that Rxx ( m) = Rxx (− m) . That is, the autocorrelation function is symmetric.
(b) Prove that Rxx (0) is always positive.
(c) Show that the autocorrelation function Rxx ( m) takes on its maximum absolute value for lag
m=0. That is Rxx (0) ≥ Rxx ( m ) . Start by expanding the inequality: E{( x (n + k ) − ax(n)) 2} ≥ 0 ,
where a is a real constant. Then set a = ±1 .
(d) Show that the autocorrelation function Rxx ( m) carries no phase information – that is, let
y(n) = x (n − P) for some integer P, then show that Ryy ( m) = Rxx (m) .

Question 3

Let us examine some of the properties of the cross-correlation functions, Rxy ( m) and Ryx (m) for real,
stationary, random processes.

a) Prove that Rxy ( m) = Ryx ( − m) . That is, the cross-correlation function has odd symmetry.
b) Prove that Rxy ( m ) ≤ Rxx ( 0 ) Ryy( 0 ) . Expand E{( ax ( n) + by( n + m )) 2 } ≥ 0 , where a and b are
non-zero, real constants.
c) If x ( n ) and y(n) are two stationary random processes that are uncorrelated with each other, show
that if z(n) = x (n) + w(n) , then Rzz ( m) = Rxx ( m) + Ryy ( m) . What does this say about the powers of
the three random processes?

Question 4

Use the following results, where appropriate: sin A sin B = 0.5[cos( A − B) − cos( A + B)] and
sin A cos B = 0.5[sin( A − B) + sin( A + B)] .
2πn
(a) Show that the autocorrelation function, Rxx ( m) , for x (n) = A sin( ), is
M
A2 2πm
Rxx ( m) = cos . Comment on this result.
2 M
2πn
(b) Show that the crosscorrelation function, Rxy ( m) , for x (n) = A sin( ) and
M
2πn AB 2πm
y(n) = B cos( ) , is Rxy ( m ) = − sin . Comment on this result.
M 2 M
(c) Use the results of parts (a) and (b) to solve the following Wiener filtering problem. Let the
2πn
input to the filter be x (n) = 4 sin( ) . Let the output from the filter be
M
y(n) = h(0) x (n) + h(1) x (n − 1) - i.e. a first-order FIR filter. Let the desired response be
2πn
d (n) = −2 cos( ) . If M=5, find the optimal coefficients {h(0) h(1)} for the filter. What is
M
J = E{e 2 (n)} in this case?
(d) Using the optimal coefficients in part (c), evaluate {x ( n)}10 10 10
n=0 , {y( n )}n=0 and {d ( n)}n=0 , thus
confirming that y(n) = d (n) for n = 1,2,",10 . Why not for n=0?

Question 5

(a) Consider the following Wiener filtering problem. Let the input to the filter be
2πn
x (n) = cos( ) . Let the output from the filter be y(n) = h(0) x (n) + h(1) x (n − 1) - i.e. a first-
M
2πn
order FIR filter. Let the desired response be d (n) = cos( ) . This looks trivial (i.e.
M
h(0 ) = 1, h(1) = 0 is clearly a solution), but try and formally find the optimal coefficients
{h(0) h(1)} for the filter for M=2, using a similar method as in question 4. Is there a problem?
Explain the result.
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
Question 9.4

Question 9.5

Question 9.6

Question 9.7
Question 9.8

You might also like