Académique Documents
Professionnel Documents
Culture Documents
University of Manchester
Department of Computer Science
First Semester Year 3 Examination Paper
CS3291: Digital Signal Processing
Date of Examination: January 2006
Answer THREE questions out of the five given.
Time allowed TWO HOURS
(Each question is marked out of 20). Electronic calculators may be used.
_____________________________________________________________________________
1
(a) Briefly outline four of the main advantages and one disadvantage of digital signal processing
(DSP) as opposed to analogue signal processing. [5 marks]
(b) Define each of the following terms as applied to discrete time signal processing systems:
(i) linearity
(ii) time-invariance
(iii) causality
(iv) stability [4 marks]
(c) Produce a signal-flow-graph for each of the following difference-equations
(i) y[n] = x[n] + 0.5 x[n-1] 0.5 x[n-2]
(ii) y[n] = x[n] + x[n-1] + 0.5 y[n-1]
Determine the impulse-response of each of these difference equations. [6 marks]
(d) Calculate, by tabulation or otherwise, the output from difference-equation (ii) when the input
is the impulse-response of difference-equation (i). [5 marks]
2.
(a) Given the impulse-response {h[n]} of a discrete time LTI system, show that the response to
any other input signal {x[n]} is {y[n]} where:
y[n] h[m] x[n m]
m
=
=
=
<
n
n h stability for 0 | ] [ |
CS3291 Exam Jan 2006 solutions 5 seagateBeng11
(c) SFGs
(i) {h[n]} = { , 0, 0, 1, 0.5, -0.5, 0, , 0, }
(ii) {h[n]} = {, 0, , 0, 1, 1.5, 0.75, 0.375, 0.1875, .. }
(d) By tabulation:
n x[n] x[n-1] y[n-1] y[n]
-1 0 0 0 0
0 1 0 0 1
1 0.5 1 1 2
2 -0.5 0.5 2 1
3 0 -0.5 1 0
4 0 0 0 0
5 etc.
{h[n]} = { , 0, 1, 2, 1, 0, .., 0 }
By otherwise: For (i) system function is H
1
(z) = 1 + 0.5 z
-1
- 0.5 z
-2
= (1 - 0.5z
-1
)(1+z
-1
)
For (ii) H
2
(z) = (1+z
-1
)/(1-0.5z
-1
)
Tranfser fn of (i) & (ii) is H
1
(z)H
2
(z) = (1 - 0.5z
-1
)(1+z
-1
)(1+z
-1
)/(1-0.5z
-1
)
= (1+z
-1
)(1+z
-1
) = 1 + 2z
-1
+ z
-2
Impulse response of H
1
(z) H
2
(z) = {, 0, , 0, 1, 2, 1, 0, , 0, )
z
-1
z
-1
+
+
x[n]
y[n]
-0.5
0.5
+
z
-1
0.5
{y[n]}
{x[n]}
z
-1
CS3291 Exam Jan 2006 solutions 6 seagateBeng11
2(a) Response to impulse {d[n]} is {h[n]}
Response to {d[n-k]} is {{h[n-k]} by time-invariance
Response to x[k] {d[n-k]} is x[k]{d[n-k]} by linearity, taking x[k] as a constant
=
=
k k
k n h k x k n d k x ]} [ ]{ [ is ]} [ ]{ [ to Response
Now
=
=
= =
)
`
=
=
=
k n
k n
k n d n x k n d k x k n d k x
k k
: 0
: 1
] [ since } ] [ { ] [ ] [ ]} [ ]{ [
n k n h k x y[n] y[n] x[n]
k
all for ]} [ ]{ [ with } { is } { to response
=
=
Now let m = n-k. When k = then m=-. When k = - then m=.It follows that:
=
=
= = =
m m k
m n x m h m h m n x k n h k x ] [ ] [ ] [ ] [ ] [ ] [ y[n]
(It doesnt matter what order you add things up in.)
If we set x[n] = z
n
for all n, where z is a complex number with |z| >1 then
=
= =
= = =
m
m n
m m
m n m n
m
z m h z H z H z
z m h z z m h m n x m h y[n]
] [ ) ( where ) (
] [ ] [ ] [ ] [
H(z) is the system function.
Replacing z by e
jO
gives the frequency-response as a function of relative frequency O in
radians per sample.
2(b)
Zeros do not affect stability.
Poles must lie inside unit circle for stability.
Gain response determined by the "distance rule":-
Gain at frequency O is:
Product of distances from each zero to the point z = e
j O
on unit circle
G(O) =
Product of distances from each pole to the point z = e
j O
on unit circle
y[n]=x[n]+1.21x[n-2]-0.8y[n-1]
) 8 . 0 (
) 1 . 1 )( 1 . 1 (
) 8 . 0 (
21 . 1
8 . 0 1
21 . 1 1
) (
2
1
2
+
+
=
+
+
=
+
+
=
z z
j z j z
z z
z
z
z
z H
Zeroes at z = -1.1j and z = +1.1j Poles at z = 0 and z = -0.8
Filter is causal as impulse response will be zero for n<0.
CS3291 Exam Jan 2006 solutions 7 seagateBeng11
Filter is stable as poles are inside unit circle.
To sketch gain response from pole-zero diagram:
O Prod zero distances Prod pole distances Gain estimate
0 1.5 * 1.5 1 * 1.8 1.25
t/4 0.6 * 1.5 1 * 1.5 0.6
t/2 0.1 * 2.1 1 * 0.8 0.26
3t/4 0.6 * 1.5 1 * 0.5 1.8
t
1.5 * 1.5 1 * 0.2 11.25
3 dB points : Assuming negligible changes to pole distances and distance to zero at z = -1.1j,
the gain may be estimated to increase by 3 dB at O = t/2 0.1 from its value at O = t/2. This is
because the zero is at a distance 0.1 from the unit circle.
Similarly gain may be estimated to fall by 3dB at O = t -0.2 radians per sample because the pole
is also at distance 0.2 from the unit circle.
Hence sketch gain response:
Real(z)
Imag(z)
Zero at z=1.1j
Zero at z=-1.1j
Pole
Pole
0.8
O
G(O)
10
CS3291 Exam Jan 2006 solutions 8 seagateBeng11
2(c)
Response is {2 G(O) cos(0.5n + |(O)} with O = 0.5
G(O) = (1+2cos(2O)) and |(O)=-2O
Response is 2(1+2cos(1))cos(0.5 n - 1) } = 2(2.08)cos(0.5 n - 1) }
i.e. {4.16 cos(0.5n - 1) }
CS3291 Exam Jan 2006 solutions 9 seagateBeng11
3(a)
Expressing the frequency-response H(e
jO
) = G(O)exp(j|(O)), a digital filter with phase response
|(O) is linear phase if the phase-delay |(O) / O is constant for all O. A linear phase response
graph is as follows:
Similarly for an analogue filter with e replacing O..
Linear phase is a desirable property because then the system delays all frequency components of
a periodic signal (say), expressed as a Fourier series say, by exactly the same amount of time. If
there are no amplitude changes, say because the signal falls within the pass-band of a low-pass
digital filter, the output waveform will not be distorted in shape by phase effects (different
frequency components being delayed by different amounts of time and therefore adding up
differently). All frequency components of a signal will be delayed by the same amount of time,
i.e. the phase delay. Hence phase distortion will not occur.
It is not true to say that all LTI systems have linear phase.
3 (b) With f
s
= 30 kHz and cut-off = 2.5 kHz,
the relative cut-off frequency O
C
= (2t / f
s
).2500 = t/6 radians per sample.
Take phase to be zero initially.
Therefore H(e
jO
) = G(O)
By the inverse DTFT formula:
h[n] =
} }
O
O
O = O O
6 /
6 /
2
1
) (
2
1
t
t
t
t
t t
d e d e G
n j n j
= | | | | 0 n when ) 6 / sin( 2
2
1
2
1
1
2
1
6 / 6 /
6 /
6 /
= = =
(
O
t
t t t
t t
t
t
j
jn
e e
jn
e
jn
j j n j
0 n when 1/6 1
2
1
/6
/6 -
= = O =
}
t
t
t
d
The impulse response is {h[n]} with
h[n] = (1/(tn)) sin(nt/6) when n = 0
and h[n] = 0.1667 when n=0.
______________________________
n h[n]
0 0.1667
1 0.160
2 0.138
3 0.106 etc
O
|(O)
CS3291 Exam Jan 2006 solutions 10 seagateBeng11
______________________________
On rectangularly windowing, we obtain the causal finite impulse response:
{h[n]} = { 0, 0.138, 0.16, 0.1667, 0.16 0.138, 0, , 0, }
After delaying by 2 samples to make the impulse response causal,
{h[n]} = { 0, 0, 0.138, 0.16, 0.1667, 0.16, .138, 0, , 0, }
H(z) = 0.138 + 0.16z
-1
+ 0.1667 z
-2
+ 0.16 z
-3
+ 0.138z
-4
Signal-flow graph
z-1 z-1 z-1 z-1
x[n]
y[n
]
0.138 0.16
0.16
0.138
+
Filter is now linear phase with phase delay of 2 sampling intervals (in the pass-band) .
It will have a well defined stop-band decreasing in gain from 0dB at 0 Hz to -6 dB at the cut-off
frequency. The stop-band gain will have ripples (illustration useful).
3(c)Increasing the order of the filter would mean that the phase delay would have to increase
also if the filter remains linear phase. The magnitude response would become closer to the ideal
low-pass response with more stop-band ripples. If the rectangular window is still used, the
highest stop-band ripple would not reduce significantly due to Gibb's Phenomenon.
The use of a Hann or similar raised cosine window would reduce the stop-band ripples at the
expense of a less sharp cut-off rate from pass-band to stop-band.
The phase response is not affected by the imposition of a non-rectangular window.
3 (d) The Remez exchange algorithm gives an 'equi-ripple approximation' to the ideal gain
response required; i.e. equal ripple peaks across pass-band and stop-band. [1]
With the windowing technique, the peaks of the stop-band ripples are not equal in amplitude
and reduce with increasing frequency. The stop-band approximation gets better with increasing
frequency . [1]
By making all ripple peaks equal, Remez minimises the difference between the ideal gain
response and the approximation across the whole of the frequency range. It is a 'mini-max'
approximation. Hence the highest stop-band ripple peak will be lower than for the windowing
technique. [1]
CS3291 Exam Jan 2006 solutions 11 seagateBeng11
4. (a) Comparison of IIR and FIR digital filters:
IIR type digital filters have the advantage of being economical in their use of delays, multipliers
and adders. [1]
They have the disadvantage of being sensitive to coefficient round-off inaccuracies and the
effects of overflow in fixed point arithmetic. These effects can lead to instability or serious
distortion. [1]
Also, an IIR filter cannot be exactly linear phase. [1]
FIR type digital filters may be realised by non-recursive structures which are simpler and
more convenient for programming especially on devices specifically designed for digital
signal processing.
These structures are always stable, and because there is no recursion, round-off and overflow
errors are easily controlled.
A FIR filter can be exactly linear phase. [1]
The main disadvantage of FIR filters is that large orders can be required to perform fairly simple
filtering tasks. [1]
4. (b) f
s
= 3000 Hz. Notch is at 250 Hz
Rel frequency of notch = (2t/3000).250 = t / 6 radians/sample.
3dB bandwidth = 38.2 Hz
= 38.2 / 3000 x 2t = 0.08 radians/sample
Therefore 3 dB points are at t / 6 0.04 radians/sample.
Poles must be placed at 0.04 from the unit circle
Distance from zeros on unit circle o = 0.04
Place zeros z
1
and z
2
at exp( j t /4).
Place poles p
1
and p
2
at 0.96 exp( j t /4)
(z - e
j t / 4
) (z - e
- j t / 4
)
H(z) =
(z - 0.96 e
j t / 4
) (z - 0.96 e
- j t / 4
)
z
2
- 2 cos (t/4) z
+ 1
=
z
2
- 1.92 cos (t / 4) z + 0.96
2
z
2
- 1.414 z
+ 1
H(z) =
z
2
- 1.92 z + 0.922
1 - 1.414 z
- 1
+ z
- 2
H(z) =
1 - 1.92 z
- 1
+ 0.922 z
- 2
CS3291 Exam Jan 2006 solutions 12 seagateBeng11
4(b) continued
Difference equation is:
y[n] = x[n] - 1.414 x[n-1] + x[n-2] + 1.92 y[n-1] - 0.922 y[n-2]
Sketch gain response.
4 (c) Signal flow graph:
1
t
O
G(O)
0.7
t/6
t/6+0.04 t/6-0.04
0
dB
-3 dB
x[n]
y[n]
z - 1
z - 1
- 1.414
W
W1
W2
1.92
- -0.922
CS3291 Exam Jan 2006 solutions 13 seagateBeng11
4(c) continued
% Direct Form II in fixed point arithmetic & shifting.
K=1024;
A0=K; A1=round(-1.414*K); A2=K;
B1=round(-1.92*K); B2=round(0.922*K);
W1 = 0; W2 = 0; %For delay boxes
while 1
Input X ; %Input a sample
W =K*X - B1*W1 - B2*W2; % Recursive part
W =round( W / K); % By arith shift
Y = W*A0+W1*A1+W2*A2; % Non-rec. part
W2 = W1;
W1 = W; %For next time
Y = round(Y/K); %By arith shift
Output Y;
end; %Back for next sample
CS3291 Exam Jan 2006 solutions 14 seagateBeng11
5.(a) Considering first the DTFT formula:
X(e
jO
) = | | mple radians/sa T f / = where e n x
s
j n -
e e = O
O
n
This transforms a (possibly complex) discrete time signal {x[n]} of infinite duration to the
relative frequency (O) domain.
Defining: | | k X =
O
) X(e
k
j
, the DFT transforms a finite (possibly complex valued) sequence
{x[n]}
0,N-1
to the finite complex valued sequence {X[k]}
0,N-1.
The DFT formula is:-
| | | | 1 - N ....., 2, 1, 0, = k for / 2 where
k
1
0
N k e n x k X
N
n
n j
k
t = O =
=
O
For each k = 0,1, 2, , N-1, X[k] is a sample of the spectrum X(e
jO
) at O=2tk/N. In this case,
X(e
jO
) is the spectrum (DTFT) of an infinite discrete time signal {x[n]} comprising {x[n]}
0,N-1
padded out to infinity (in both directions) with zeros.
Therefore O is in the range 0 to 2t is and X(e
jO
) is uniformly sampled over this range.
5 (b) The DTFT of {x[n]} obtained by sampling x
a
(t) at intervals of T seconds is :
T n j X
n
a
/ 2 ith w )) ( (
T
1
= ) X(e
0 0
T j
t e e e
e
=
=
If x
a
( t ) is band-limited between -t/T and +t/T radians/sec ( f
s
/2 Hz ), then
X
a
( je ) =0 for e > t/T.
It follows that :
X( e
jeT
) = ( 1/T ) X
a
( je ) for -t/T < e < t/T
This is because X
a
( j( e - 2t/T ) ), X
a
( j( e + 2t/T ) ) and X
a
( je ) do not overlap.
Where X
a
(je) is not band-limited to the frequency range -t/T to t/T, overlap occurs.
If now we take X
s
( e
jeT
) to represent X
a
( je )/T for -t/T < e< t/T, it will be distorted.
This is aliasing distortion.
To avoid aliasing distortion, low-pass filter x
a
( t ) to band-limit the signal to f
S
/2 Hz
before sampling at f
s
Hz. It then satisfies Nyquist sampling criterion .
5 (c)
(i) We obtain an aliased sine wave of frequency 5 -3 kHz = 2 kHz
(ii) we obtain aliased sine wave of frequency 2 kHz
(iii) A constant (dc) signal seen. No sine wave at all.
CS3291 Exam Jan 2006 solutions 15 seagateBeng11
5 (d) Quantisation noise power : A
2
/12 where A is quantisation step.
Sinusoidal signal power = A
2
/ 2 where A is the maximum possible signal amplitude.
16- bit ADC, therefore 2
16
quantisation levels.
A = 2
15
A
Signal-to-quantisation noise ratio (SQNR) = (A
2
/2) / (A
2
/ 2)
= 2
29
A
2
/ (A
2
/12)
= 2
31
x 3 = 25.166 x 10
6
In dB SQNR = 10 log10(2
31
x 3) = 97.7 dB ( = 6 x 16 + 1.7)
The quantisation noise spectrum may be assumed white in the frequency range 0 to fs / 2 Hz.
In the time-domain, the quantisation error samples may be assumed random and statistically
uniformly distributed between -A/2 and A/2.
CS3291 Exam Jan 2006 solutions 16 seagateBeng11