Week 5 Discrete Time Signals Lecture
Week 5 Discrete Time Signals Lecture
1
Lecture Outline
2
Analogue to digital conversion
• Most real world recorded signals are analogue signals
• To process analogue signals by digital means (like using a PC), we need to convert
them to digital form
• I.e. to convert them to a sequence of numbers having finite precision
• This process is known as analogue to digital (A/D) conversion, which involves
• i) Sampling
• ii) Quantisation
• iii) Coding
x[n]
x(t) 0 1 0 11 .....
Sampler Quantiser Coder
3
The Sampling Process
• Often, a discrete time sequence x[n] is developed by uniformly sampling
an analogue signal x(t) as indicated below
• I.e. conversion of a continuous-time, continuous amplitude signal into
discrete-time signal (i.e. continuous-amplitude, discrete-time)
• Done by taking samples at specific uniform intervals of time
• The sampling interval is the time of one of these uniform intervals
• Sampling frequency is the number of uniform time intervals in one second
• Aliasing
• Aliasing causes ambiguities in reconstruction, i.e. distorts the sampled
signal
5
Aliasing problem – an example
• Consider the following sampling of analogue signal
Discrete-time
Analogue signal
signal
t t t
Discrete-time
Longer interval sampling
signal
t t
6
Aliasing demo – an example
• (from S.K.Mitra, DSP 3rd ed)
• The phenomenon of aliasing happens when the sampling frequency is less than twice
the highest frequency of the input signal
• Three output sound signals are generated using sampling rates of 8KHz, 4KHz and
2.6667KHz
• Among these three outputs, aliasing arises only at sampling frequency of 2.6667KHz,
which is less than twice of the highest input frequency of 3.6KHz
7
Example – Nyquist rate computation
• Consider the analogue signal
• x(t)=3 cos 50t + 10 sin 300 t – cos 100 t
• What is the Nyquist frequency (rate) to sample this signal?
Answer
• Use the generic term, A cos 2ft (or A sin 2ft) to compute the
frequencies present in the signal => which are 25 Hz, 150 Hz and
50 Hz
• So, Nyquist frequency is 2* highest frequency= 2*150 Hz=300 Hz
• In practise, we normally sample at a much higher rate than
Nyquist frequency
8
Quantisation and coding
• Quantisation
– This is the conversion of discrete-time continuous amplitude
signal (after sampling) into discrete-time discrete amplitude
signal
• Quantisation levels
– The value of each sample is represented by a value selected
from a finite set of possible values
– Quantisation width= (xmax-xmin)/(No of levels -1)
– Quantisation error is the error in the quantisation process by
rounding to the nearest level
• Coding
– In the coding process, each discrete value is represented by a
certain number of bits
– Relationship between bits and levels: 2number of bits no of levels
9
Example of performing quantisation and coding
• The possible quantised values are 0, 0.25, 0.5, 0.75, 1.00, 1.25,
1.50, 1.75, 2.00
• So, x(5) =1.75 volts (rounded to nearest level) = 7th quantised level
10
Quantisation error
• Quantisation error
• But for the purpose of this course, we will round to the nearest level
11
Quantisation and coding – further example
• Quantisation error
– 1.66 V is represented as 1.625 V, so there is an error of 0.035 V, this
is the quantisation error
– This error is reduced by the increase of bits/quantisation levels
12
Sequences
x[n] n 3 , 1 n 4
n3, 1 n 4
x pad [n ] {
0, 4 n 5
13
Discrete-time systems
• Discrete-time systems operates on an input sequence, according
to some prescribed transfer function and produces another output
sequence
• Example, the input sequence could be a noisy ECG signal and the
system outputs a noise reduced ECG signal
Real ECG signal from MGH database Real ECG signal from MGH database (after noise reduction)
1.2 0.5
1 0.4
0.3
0.6
0.1
0.4
0.2
Discrete time system 0
-0.1
0 -0.2
-0.2 -0.3
-0.4
-0.4 0 100 200 300 400 500 600 700
0 100 200 300 400 500 600 700 Sampling points
Sampling points
14
Basic system operations
• Product (modulation) This is the system!
• y[n]=x[n].w[n] modulator
x[n] X y[n]
w[n]
x[n] + y[n]
w[n]
• Multiplication
• y[n]=A.x[n]
multiplier
x[n] A y[n]
15
Basic system operations (cont.)
• Time reversal (folding)
• y[n]=x[-n]
• Important operation in filtering/convolution
• Time shifting
z-N
• y[n]=x[n-N] (delay) x[n] y[n]
16
Basic system operations (cont.)
• Time scaling (downsampling/upsampling)
• Downsampling, y[n]=x[nM]
• In downsampling, every Mth sample of the input sequence is kept and
M-1 in between samples are removed
• No. of samples is reduced
• Eg: y[n]=x[3n]
17
Basic system operations (cont.)
• Upsampling, y[n]=x[n/N]
• In upsampling, N-1 equidistant zero-values samples are inserted by
the upsampler between each consecutive samples of the input
sequence
• No. of samples is increased
• Eg: y[n]=x[n/3]
18
Combination of basic operations
• Often, a system includes a combination of operations
• Example - figure shows a discrete time system block diagram
19
Example – sequence computation
• For the following sequences, defined for 0 n 4 (length=5),
• a[n]={3 4 6 -9 0}
• b[n]={2 -1 4 5 -3}
• Ans
• c[n]={6 -4 24 -45 0}
• d[n]={5 3 10 -4 -3}
• e[n]={4.5 6 9 -13.5 0}
• These are easy as both a[n] and b[n] have same length. What if
their lengths differ?
20
Example – differing sequence lengths
• If the lengths of sequences differ, then pad with zeros (in front or end or
in between) to obtain same length sequences and same defined ranges
BEFORE applying the operations
• Hint: f[n] has length 3, while a[n] has length five, so pad f[n] with 2 zeros
• Sometimes, making a table will make it easier
• Answer
• a[n]={3 4 6 -9 0} defined for 0 n 4
• fpad[n]={-2 1 -3 0 0} defined for 0 n 4
• f[n] is padded with 2 zeros at the end as to make the defined ranges of
a[n] and fpad[n] equal.
• So, g[n]={1 5 3 -9 0}
21
Advanced example
• Consider the following sequences:
• x[n]={-4 5 1 -2 -3 0 2}, -3 n 3
• y[n]={6 -3 -1 0 8 7 -2}, -1 n 5 Answer
• w[n]={3 2 2 -1 0 -2 5}, 2 n 8 c[n]={2 0 -3 -2 1 5 -4}
22
Solution
• Prepare tables
• Min range, n=-3
• Max range, n=8
(a) c[n]=x[-n+2]
(b) d[n]=y[-n-3]
(c) e[n]=w[-n]
(d) u[n]=x[n]+y[n-2]
23
Study guide
• From this lecture, you should know
– A/D
– Sampling, quantisation, coding procedures
– Nyquist theorem
– Basic system operations
– Computation of combined sequence operations
– Obtaining output sequence given a discrete-time system block
diagram and vice versa
End of lecture
24