Digital Signal Processing
Lect. 04
Signal Conversion
Sampling and Aliasing
Sampling Theorem
Quantization and Coding
Analogue vs Digital
0.3
0.3
0.2
0.2
Amplitude
Amplitude
0.1
0.1
0 0
-0.1 -0.1 Ts
-0.2 -0.2
0 2 4 6 8 10 0 2 4 6 8 10
sampling time
time
Time Continuous Time Discrete
Amplitude Continuous Amplitude Quantized
Why Convert ?
Benefits of the Digital Domain
Ease of Storage and reproduction
Easier to Ensure Accuracy
Challenges of Digital Domain
A/D & signal processor speed
Finite word-length effect
Conversion Chain
x(t) Analogue Circuit y(t)
x[n] Digital Processor y[n]
x(t) A-to-D D-to-A y(t)
(e.g. Computer)
Analogue-to-Digital Digital-to-Analogue
Conversion Conversion
Analogue-to-Digital
Conversion
Sampling
Filter + Sample & Hold
Digitization
Quantization + Coding
Sample
x[n] Quanti-
x(t) Filter Coding x[n]
& Hold zation
Binary Output: 0 1 0 1 1
ADC
Analogue-to-Digital Converter
Sampling
Convert x(t) to sequence of numbers x[n]
n is an integer
Uniform Sampling
T = nTs
Sampling Period = Ts
Sampling Frequency/Rate = fs = 1/Ts
Ideal
Continuous-
x(t) to-Discrete x[n]=x(nTs)
Converter
f=100Hz
fs=2kHz
fs=500Hz
fs=3*f/4 fo=f/3
Aliasing
Sampling Rate
Maximum frequency that can be
correctly represented by a sampling
rate fs is fs/2
Sampling Theorem
Shannon / Nyquist
A continuous time signal x(t) with
frequencies no higher than fmax can be
reconstructed exactly from its samples
x[n]=x(nTs), if the samples are taken at
a rate fs=1/Ts, that is greater than 2fmax
2fmax is called the Nyquist rate
Sample and Hold
Input signal is sampled at the clock
edge and the sample signal is held at
the output until the next clock edge.
input
i/p o/p
output
T 2T
Analogue-to-Digital Converter
ADC
An analogue signal is quantized and
converted to digital (binary) samples, to
a given precision.
ADC Resolution
ADC Accuracy
ADC - Number of bits N
Continuous input signal digitized into 2N levels.
1113
Uniform quantization
2 Bipolar Quantizer
1
0
-4 -3 -2 -1 0 1 2 3 4
-1 V
010
-2
V FSR
001
-3 Quantisation Step q =
000 2N
-4
VFSR
1
q/2
0.5
-4 -3 -2 -1
0
0 1 2 3 4
Quantization Error eq
-0.5
-q/2
-1
ADC - Quantisation error
Quantisation Error eq is in the range
[-0.5 q , +0.5 q ].
eq limits ability to resolve small signals
Higher resolution (N) means lower eq
E.g. Telephony 8 bits/sample
E.g. CD Audio 16 bits/sample
Digital-to-Analogue Conversion
x[n]
De- Filter x(t)
x[n] ZOH
coding
DAC
Digital-to-Analogue Converter
Digital binary samples at input are
converted to analogue signals and
signal between samples is estimated.
Zero-order hold (ZOH)
Interpolates between samples
output
t
Low-pass Filter (LPF)
Reconstruction Filter
Smoothes the signal (removes high
frequency signal components created by
the ZOH)
LPF output
output
t
MATLAB Assignment
Create This Figure!
MATLAB Assignment
Hint
%First Plot f=100 Hz
t=-0.01:0.0001:0.02;
y=cos(2*pi*100*t);
subplot(3,1,1),plot(t,y)
axis([-0.01 0.02 -1 1])
title('Continuous Waveform: x(t)=cos(2\pi 100t)')
xlabel('Time (secs)')
ylabel('Amplitude')
…
Reading Assignments
Signal Processing First
Chapter 4, Sections 4-1 and 4-2
Appendix B: MATLAB