Chapter 2
Chapter 2
School
Electrical Engineering and Telecommunications
University of New South Wales (UNSW), Australia
Chapter 2
Chapter 2: Digital Signal Processing Fundamentals ........................ 20
2.1 Introduction........................................................................... 20
2.2 Overview of a DSP System .................................................. 21
2.3 Analogue to Digital Conversion Process.............................. 23
2.4 Quantisation and Encoding................................................... 25
2.5 Continuous-Time Fourier Transform (FT) ........................... 31
2.6 Sampling of continuous-time signal ..................................... 35
2.6.1 The Ideal Sampling Operation ........................................ 36
2.7 Aliasing ................................................................................. 37
2.8 Digital-to-Analogue Conversion (D/A) – Signal recovery .. 45
2.8.1 Reconstruction Filter ...................................................... 48
2.9 Summary ............................................................................... 49
Chapter 2: Problem Sheet 2
Chapter 2 19
Chapter 2: Digital Signal Processing
Fundamentals
2.1 Introduction
Digital Signal Processing (DSP) is a rapidly developing
technology for scientists and engineers. In the 1990s the digital
signal processing revolution started, both in terms of the
consumer boom in digital audio, digital telecommunications and
the wide used of technology in industry.
Chapter 2 20
video processing, seismic, radar and sonar processing and neural
computing.
Analogue Signal
Analogue Input Signal: Analogue Output Signal:
Processor
x(t) = s(t) + n(t) sˆ ( t ) s (t)
(e.g. Low-Pass Filter)
x(t) – incoming analogue signal
s(t) – desired analogue signal
Magnitude
Magnitude response
n(t) - noise of a Low Pass filter
0 frequency
Figure 2.1 A general description of analogue systems whose input and output
are in analogue form
Chapter 2 21
Analogue prefilter
or antialiasing filter
Analogue to Digital Digital to analogue
dB converter converter dB
-3 dB -3 dB
x[n] Digital s[n]
x(t) 0 A/D D/A 0 s(t)
Converter Signal converter
Analogue xa(t) Processor Analogue
input signal output signal
f f
fs fs
fc
2 2
Name Function
Anti-aliasing filter To band-limit the analogue input signal prior to
fs digitisation to reduce aliasing (see Section 2.7)
( fc )
2
Analogue-to-digital To convert analogue input signal into digital output
converter 1
signal by sampling ( f s )
T
Digital Signal Processor To process the digital signal according to the pre-defined
(heart of the system) rules
Chapter 2 22
2.3 Analogue to Digital Conversion Process
Before any DSP algorithm can be performed, the signal must be
in a digital form. The A/D conversion process involves the
following steps:
Analogue-to-Digital Converter
Band-limited Digital Output
Analogue Input Sample & Hold B-bits Quantiser Encoder Signal
Signal
1
fs 2B B bits
xa(t) T Logic
x[n]
Circuit
1
t
T = sampling period T
2B Quantisation
Levels
Sample & Hold
output signal Analogue
signal
0 t
T
Chapter 2 23
• If the voltage varies from –mp to mp and the number of levels are L then
Note: There are two types of quantizer: Mid riser and mid tread. If nothing is mentioned assume
mid tread.
Chapter 2 24
Example: 4-bit (B = 4) A/D converter (bipolar)
digital
5 0101
4 0100
3 0011
2 0010
1 0001
0
-1 1111 Analogue signal
-2 1110
-3 1101
-4 1100
-5 1011
Chapter 2 25
Quantisation level
7
6
5
4
3
2
1
1 2 3 4 5 6 7 8 9 n – sampling
instant
Quantisation level
7
6
5
4
3
2
1
Example
20
V 4.9 mV
212 1
-10V 1000 0000 0000
Chapter 2 26
For a B-bit A/D converter, the number of quantisation level is
2B, and the interval between levels, that is known as the
quantisation step size or resolution (V) is given by:
V V The approximation holds when
V B when B is large (say B > 10 bits)
2 1 2
B
level n+1
∆V
level n v ∆V/2
∆V/2 Quantisation error (e) =
∆V
level n-1
sampling instant
v: voltage at the
sampling instant
A/D output
signal
e[ n] A Aq
Quantisation
Actual Quantized error
amplitude
Chapter 2 amplitude 27
time
The probability density function of the error P(e) has the form as
shown below
V 3 V
e
V V
2
2
Hence, the quantisation noise power
V 2
2
e for uniform quantisation
12
Chapter 2 28
Example
1 N 1 N
Pin x[n]2 and PN e[n]2
N N
n 1 n 1
V 2
or e
2
12
N
P
x [ n]
2
Pin 12 Pin L2
SQNR( dB) 10 log 10 log
( R / L) 2 R2
12
Chapter 2 29
Example:
A2
For the sine wave input, the average signal power is , i.e.
2
2
A rms value
2
A2 A2
SQNR 10 log 2 2 10 log 2
V
2A/ 2
B
2
12 12
3 22B
10 log
2
Chapter 2 30
Exercise:
1
where 𝑃𝑠 is the signal power [𝑃𝑠 = ∑𝑁−1 𝑥 2 [𝑛]]; 𝐿 is the
𝑁 𝑛=0
number of quantisation levels and 𝑅 is the dynamic range of the
input signal. Using the above equation, show that for a B-bit
quantiser, 𝑆𝑄𝑁𝑅 = 6.02𝐵 + 1.76 (𝑑𝐵) if 𝑥 (𝑡) = 𝐴 cos(2𝜋𝑓𝑡)
The FT converts the time domain signal, x(t), into its frequency
domain representation, X ( ) and the IFT converts the frequency
domain representation, X ( ) , back into the time domain x(t).
Chapter 2 31
Fourier coefficients:
A0
x(t ) An cos(n0t ) Bn sin(n0t )
2 n 1
𝑇
2
2
𝐴0 = 𝑥 (𝑡)𝑑𝑡
𝑇
−𝑇
2
𝑇
2
2
𝐴𝑛 = 𝑥(𝑡) cos(𝑛𝜔0 𝑡) 𝑑𝑡
𝑇
−𝑇
2
𝑇
2
2
𝐵𝑛 = 𝑥 (𝑡) sin(𝑛𝜔0 𝑡) 𝑑𝑡
𝑇
−𝑇
2
Example:
Evaluate the Fourier transform of a rectangular pulse shown
below: x(t)
A
t
2 2
j j
A 2
2
x(t )e x(t )e
jt jt
X ( ) dt dt e e 2
j
2
X(w)
sin 2
X ( ) A
Sinc function
The FT is a continuous
function of frequency
2
2
Sinc function
2
4 0 4
frequency (w)
Chapter 2 32
(t)
(t) X(w)
( )
t
1 1 X ( ) (t )e jt dt 1
w
Example:
FT e e
j1t j1t jt
e dt e j (1 )t dt 2 (1 )
Using the properties:
2 ( )
jt
FT e j1t e dt 2 ( )
1
and (-1) = (1 - )
jω t
The magnitude spectrum of e 1 is show below:
|FT{ej1t}|
2
1 frequency,
Example:
e j1t e j1t 1
FT cos1t FT j t 1 j t
FT e 1 FT e 1
2 2 2
1 1
The magnitude spectrum of cos1t is show below
Chapter 2 -1 33 1
frequency,
Chapter 2 34
Example:
x (t ) A/D x[n] = T
converter fa
X ( ) X ( ) 2
fs
Chapter 2 35
Using Inverse Fourier Transforms in Continuous-time and
discrete-time domains, we can show that (see tutorial 2)
1 2
X ( ) X ( k ) .
T k T
Convolution
Chapter 2 36
2.7 Aliasing
Aliasing arises when a continuous-time signal is sampled at a rate
that is insufficient to capture the changes in the signal. If aliasing
occurs, the original continuous time signal cannot be recovered.
The Nyquist sampling theorem states that the sampling frequency,
𝑓𝑠 , should be at least twice the highest frequency, 𝑓𝑐 , contained in
the signal (𝑓𝑠 ≥ 2𝑓𝑐 ) to avoid aliasing.
Case 1: () = 0, (sampling theorem holds)
T
()
A Analogue spectrum
𝑓𝑠
2
fs
Note: corresponds to = (or f
fs
)
T 2
Chapter 2 37
The digital spectrum is the same as the original analogue
spectrum and repeats at multiples of the sampling frequency fs
(refer to figure 2.6) as given by:
fk = f0+kfs
2 0 2 digital frequency,
fs
fs f0 fs fs f1 analogue frequency, f
2 2
Fundamental region
f1 f 0 1. f s
Figure 2.6
Chapter 2 38
3
Case 2: () 0, , but () = 0,
T 2T
()
A
3 3
2T T T 2T
()
A/T
-3 -2 - 2 3
aliasing
Figure 2.7: Above: Frequency response of an analogue signal whose highest
frequency component is larger than the sampling frequency. Below: Frequency
response of the sampled analogue signal. The overlapped region represents aliasing.
Note:
fs – sampling frequency, fa – analog frequency
f s corresponds to =
2
f s is the highest frequency that can be represented uniquely with a sampling rate f
s
2
fs
is called half the sampling frequency or folding frequency.
2
fa
Digital frequency, T 2
fs
Chapter 2 39
Example: Suppose x(t) has the spectrum (f) as shown below.
Sketch the digital spectrum | ()| if the sampling frequency fs =
2 kHz.
|X(f)|
1
f (kHz)
-4 -3 -2 2 3 4
|X()|
1/T
2
-2 -
f (kHz)
-3 -2 2 3
Chapter 2 40
Example : Consider x(t) = 10 sin 300t
fs 2 f = 300 Hz x[n]
xn 10 sin300nT
300
10 sin n n
fs
10 sinn
Chapter 2 41
(b) Assume now that we sample this signal x(t) using a sampling
rate fs = 5 kHz (samples/sec). What is the discrete-time signal
obtained after sampling?
First Method:
fs
fs = 5000Hz 2500
2
x(t) = 3cos(2 1000t) + 5sin(2 3000t) + 10cos(2 6000t)
1 2
xn 13 cos 2 n 5 sin 2 n
5 5
Second Method:
fs
f s 5kHz 2.5kHz
2
We have fk = f0 + kfs
Chapter 2 42
fs
The frequency f1 = 1000 Hz is (= 2500 Hz) and thus it is not
2
affected by aliasing.
However, the other two frequencies f2 & f3 are above the folding
frequency and they will be changed by the aliasing effect.
(c) What is the analogue signal y(t) we can reconstruct from the
samples if we use ideal interpolation?
Exercise:
A digital communication link caries binary-coded words
representing samples of an input signal
x(t) = 5 cos(600t) + 4 cos (1800t) . The link is operated
at 10,000 bits/s and each input sample is quantised into 1024
different voltage levels.
(i) What are the frequencies in the resulting discrete-time
signal x(n)?
(ii) Determine the resulting discrete time signal x(n).
Chapter 2 43
Example:
|S(f)|
A
-3 -2 2 3 f(kHz)
fs = 2kHz, fk = fo + kfs
fo = fk − kfs , k = 0, ±1, ±2, …
For k = 1: fo = 2 − 1(2) = 0; fo = 3 − 1(2) = 1
For k = −1: fo = −2 + 1(2) = 0; fo = −3 + 1(2) = −1
|S()|
k=-1
k=2 k=1
A
T
-2 - 0 2
(-1kHz) (1kHz)
Chapter 2 44
2.8 Digital-to-Analogue Conversion (D/A) – Signal
recovery
The D/A conversion process is employed to convert the digital
signal into an analogue form after it has been digitally processed.
The reason for such conversion may be for example, to generate
an audio signal to drive a loudspeaker or to sound an alarm. The
D/A process is shown in Figure 2.8. A register is used to buffer
the D/A’s input to ensure that its output remains the same until
the D/A is fed the next digital input.
Note: The inputs to the D/A are series of impulses, while the
output of the DAC has a staircase shape as each impulse is held
for a time T sec.
reconstruction filter
y[n] or smoothing filter
n t
Chapter 2 45
By comparing its output yˆ (t ) and its input y[n], it is evident that
for each digital code fed into the D/A, its output is held for a time
T. The result is the characteristic staircase shape at the D/A
output.
t
T
The corresponding frequency response is
T
T
e jt
T
jT sin
T
H ( ) h(t )e jt dt e jt dt e 2 2
0 j 0 2 T
2
The magnitude of H() is plotted in Figure 2.9.
|H()|
0
Chapter 2 46
In the frequency domain, the staircase action of the DAC
sin x
introduces a type of distortion known as the or aperture
x
T
distortion, where x .
2
Y()
input to the D/A
D/A output
Chapter 2 47
2.8.1 Reconstruction Filter
Telephone speech
signal 8-bits 8-bit persample
x(t) (compressed PCM)
A/D
0-3.4 kHz converter
fs = 8000 Hz
(8000 samples/sec)
Bit rate (bits per second)
= sampling frequency bits/sample
= 8000 samples/second 8-bits/sample
= 64,000 bits/sec
(c)
CD
16 bit CD 16 bit lowpass AMP
fs= 44.1 Reader D/A filter
kHz
bit rate
16 bit fs = 44.1kHz =1644100 bits/sec
=0.7056 Mbits/sec
Chapter 2 48
2.9 Summary
At the end of this chapter, it is expected that you should know:
Chapter 2 49