0% found this document useful (0 votes)
159 views

Sampling PDF

This document provides an overview of periodic (uniform) sampling and related topics in digital signal processing. It introduces sampling, interpolation, aliasing, and discrete-time processing of continuous-time signals. It also discusses sampling of discrete-time signals and quantization. The key topics covered include representing a continuous-time signal using its samples, reconstructing a signal from its samples, and the effect of under-sampling known as aliasing. Real-world considerations like analog-to-digital conversion are also briefly discussed.

Uploaded by

Ahmed Shuja
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
159 views

Sampling PDF

This document provides an overview of periodic (uniform) sampling and related topics in digital signal processing. It introduces sampling, interpolation, aliasing, and discrete-time processing of continuous-time signals. It also discusses sampling of discrete-time signals and quantization. The key topics covered include representing a continuous-time signal using its samples, reconstructing a signal from its samples, and the effect of under-sampling known as aliasing. Real-world considerations like analog-to-digital conversion are also briefly discussed.

Uploaded by

Ahmed Shuja
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 187

Periodic (Uniform) Sampling

ELEC364 & ELEC442


 Introduction to sampling
 Introduction to filter

 Ideal sampling: Representation of a CT Signal by Its Samples

 Interpolation: Reconstruction of a Signal from Its Samples

 Aliasing: The Effect of under-sampling

 Examples

 Discrete-Time Processing of Continuous-Time Signals

 Real sampling: A/D and D/A Conversion (ELEC442)

 Sampling of Discrete-Time Signals (ELEC442)

 Quantization (ELEC442)

M.A. Amer  Summary


Concordia University
Electrical and Computer Engineering

Content and Figures are from:


•A. Oppenheim, A.S. Willsky and S.H. Nawab, Signals and Systems (S&S), 2nd Edition, Prentice-Hall, 1997
•Oppenheim, Shafer, Discrete-Time Signal Processing (DTSP), 3e,
•Dr. Güner Arslan, 351M Digital Signal Processing, http://signal.ece.utexas.edu/~arslan/courses/dsp
•Dr. Zheng-Hua Tan, Digital Signal Processing III, 2009, http://kom.aau.dk/~zt/cources/DSP/
1
Course at a glance
Discrete-time
signals and systems

Advanced
topics
Fourier transform
Sampling and
and Z-transform System
reconstruction
Function analysis:
magnitude, phase, &
group delay
DFT/FFT
Filter structures &
design

2
The Sampling Theorem

A continuous-time signal xc(t), whose spectral


content is limited to frequencies smaller
than N (i.e., it is band-limited to | 
 |s  N )
can be perfectly recovered from its sampled
version x[n], if the sampling rate is larger
than twice the bandwidth (i.e., if  2
s N )

Xc j
-N N

3
Introduction
 Sampling is an operation that transforms a CT signal
xc(t) into a DT signal x[n]
x[n] gives the values of x(t) read at intervals of T
seconds x[n]=xc(nT)
 Sampling:
 With x[n] we can take advantage of the advanced
discrete time systems technologies to process them

 How do we perform sampling?


 Taking snap shots of x(t) every T second
• x(nT), n=…,-1,0,1,…

4
Introduction

 Most common sampling is periodic

xn  xc nT     n   n
-3 -2 -1 0 1 2 3 4
 T: the sampling period in second
 Fs = 1/T: the sampling frequency in Hz
 The reciprocal of the sampling period
 s=2Fs rad/sec: Sampling frequency in radian-per-second

 This is the ideal case not the practical but close enough
 In practice it is implement with an analog-to-digital converters

5
Introduction

 Sampling is, in general, not reversible: Given a sampled signal


one could fit infinite continuous signals through the samples
1
0.5
0
-0.5
-1
0 20 40 60 80 100

x1(t), x2(t), x3(t) have the same samples

 Fundamental issue in DSP: if we loose information (the values of x(t)


between the sampling points) during processing we cannot recover it
6
Introduction
 Key Questions for Sampling:
 How do we determine T?
Look at the frequency range of the signal
 Can we (perfectly) reconstruct the original
CT signal x(t) from its samples x[n] ?
Nyquist sampling theorem

7
Introduction

8
Fourier symbols

Variable Period Continuous Discrete


Frequency Frequency

DT x[n] n N  k
k  2k / N

CT x(t) t T  k
k  2k / T
• DT-FS: Discrete in time; Periodic in time; Discrete in Frequency; Periodic in Frequency
• DT-FT: Discrete in time; Aperiodic in time; Continuous in Frequency; Periodic in Frequency
• CT-FS: Continuous in time; Periodic in time; Discrete in Frequency; Aperiodic in Frequency
• CT-FT: Continuous in time; Aperiodic in time; Continuous in Frequency; Aperiodic in Frequency

9
Fourier symbols
Sampling in time Discrete-time
Continuous-time Sampling period = Ts
analog signal analog sequence
x(t) C x [n] D

Laplace Continuous-time z-Transform Discrete-Time Discrete


Transform Fourier Transform X(z) Fourier Transform Fourier Transform
X ( j) X(F) j C X(k)
X(s) C z  re X (e j )
C
s    j  C N 1 2 n k

 x [n] e
 -j

 x [n] z  x [n] e - jn


-n N

 x(t) e
-j t

st dt n =  n = - n=0 D
x(t) e dt
       k integer
j
ze
  f
s  j
  2F  frequency of DT signals Sampling in frequency
 frequency of CT signals N = Length of x[n]
   / T ;   T
10 Scaling of DT freq. by T
Outline
 Introduction to sampling
 Introduction to filters
 Representation of a CT Signal by Its Samples: Sampling
 The Effect of Under-sampling: Aliasing
o Reconstruction of a Signal from Its Samples: Interpolation
o Discrete-Time Processing of Continuous-Time Signals
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals
o Quantization
o Summary

11
Filters:
Why frequency representation?
 Sinusoidal signals have a distinct (unique) frequency f0
 An arbitrary signal x(n) does not have a unique frequency

 x(n) can be decomposed into many sinusoidal signals with different


frequencies, each with different magnitude and phase
1

j jn
x[n]  X ( e ) e d
2 2

 Fourier transform: given a value of ω, the FT gives back a complex X (e j )


number
 It is magnitude and phase (translation in time) of the sinusoidal component at
that frequency 
X (e j )   x[ n
n  
]e  jn

12 We know: the function e^jω is periodic with N=2π


Filters:
Why frequency representation?
 Clearly shows the frequency composition a signal
 Can change the magnitude of any frequency
component arbitrarily by a filtering operation
 A filter blocks some frequency content from a signal
 Can shift the central frequency by modulation
 A core technique for communication, which uses
modulation to multiplex many signals into a single
composite signal, to be carried over the same physical
medium
 Processing of signals (e.g. speech and music)
 Speech recognition; motion estimation; …
13
Filters
 Filters separate what is desired from what is not desired
 A filter blocks some frequency content from a signal
 It may change the shape of the signal
 A filter can be seen as a transfer function H(f)
 Y(f) = H(f)X(f) or y[n]=h[n]*x[n]
 An ideal filter
 passes all signal power in its passband without distortion
 completely blocks signal power outside its passband
 Distortion means that the signal shape is changed after the
filtering
 A distortion-less filter has an impulse response of the form
h[n]= A δ(n-m) H( f ) =
14 A filter can multiply by a constant or shift in time without distortion
Low Pass Filtering
(Remove high freq, make signal
smoother)

15
High Pass Filtering
(remove low freq, detect edges)

16
Ideal Filters: frequency domain

 Lowpass: smoothing, noise removal

 Highpass: edge/transition detection

 Bandpass: Retain only a certain frequency range

 Bandstop: most frequencies unaltered, attenuates those in a


17 specific range to very low levels
Ideal Filters: time domain

 sinc functions

18
Ideal Filters

All the impulse responses of ideal filters are


sinc functions, or related functions, which are
infinite in extent
Two-sided impulse responses, i.e., all ideal
filter impulse responses begin before time, t = 0
This makes ideal filters non-causal
 Ideal filters cannot be physically realized, but
closely approximated

19
Real filters

20
Example: Noise filter
 Noise is present in most signals
 Noise is high frequency content
 If the noise band is much wider than the signal band a large
improvement in signal fidelity is possible

21
Outline
 Introduction
 Introduction to filters
 Sampling: Representation of a CT Signal by Its Samples
o Reconstruction of a Signal from Its Samples: Interpolation
o The Effect of Under-sampling: Aliasing
o Discrete-Time Processing of Continuous-Time Signals
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals
o Quantization
o Summary

22
Sampling methods

 Impulse train: an ideal system that samples


x(t) at the given instant “n”
-3 -2 -1 0 1 2 3 4

 Zero-order hold: A non-ideal system that


samples x(t) at a given instant and holds that
value until the next instant, at which a sample
should be taken
x(t ) Zero-order x0 (t )
hold
23
Impulse-Train Sampling

o Use a periodic impulse train multiplied


by the continuous-time signal x(t)
xs (t )  x(t )s(t ) (7.1)

sampling period

sampling function s (t )    (t  nT )
n   (7.2)

 s  2 / T

24
sampling frequency or rate
Impulse-Train Sampling

s(t)
xs (t )   x[nT ] (t  nT )
n  
(7.3) x(t) × xs(t)

s(t )
x(t) T
1
 
0 t
0 t

xs(t)
T x(0) x(T)

0 t Fig. 7.2
25
s (t )

Illustration x(t ) x s (t )

x(t )

0 t

s (t )

1
… …

 3T  2T  T 0 T 2T 3T t

x(T ) x(0)
x s (t )

26 0 t
Impulse-Train Sampling
 Mathematically convenient to represent in two stages
 Multiply with s(t)= Impulse train modulator tnT
 Conversion of impulse train to a sequence nT  n

s(t)
Convert
impulse train to
xc(t) x discrete-time x[n]=xc(nT)
sequence

xc(t)
s(t) x[n]

t n
-3T-2T -T 0 T 2T 3T 4T

 In time domain: we scale the x-axis: divide t by T to get n


27
the nth sample is associated with the impulse at t=nT
Impulse-Train Sampling


s (t )    (t  nT )
n  

x s (t )  xc (t ) s (t )

 xc (t )   (t  nT )
n  

  xc (nT ) (t  nT )
n  

x[n]  xc (nT ),   n  


xc (t )   xc ( ) (t  )d


28
Frequency analysis of Sampling

o Modulate (multiply) continuous-time signal with pulse train:


 
xs t   xc t st    x t t  nT
c
s(t)   t  nT 
n  
n  

o Take the FT of xs(t) and s(t)


1 2 
Xs j  Xc j  Sj Sj     ks 
2 T k  

FT of pulse train is again a pulse train


oThe FT of xs(t)
1 
Xs j   Xc j  ks 
T k  

oThe sampling frequency s = 2Fs

29
Frequency analysis of Sampling

2 
S ( j ) 
T
  (  k s )
k  


1
X s ( j ) 
T
 X c ( j (  k s ))
k  

 s   N   N or  s  2 N

30
Frequency analysis of Sampling

Convolution with pulse creates replicas at pulse location:


1 
Xs j   Xc j  ks 
The impulse train modulator T k  
- Creates images of the FT of the input signal
- Images are periodic with sampling frequency
- If s< N sampling maybe irreversible due to aliasing of replicas

Xc j
-N N

Xs j s>2N
-
3s 2s s -N N s 2s 3s

Xs j s<2N
- s -N N s 2s 3s
31 3s 2s
The Sampling Theorem
 How to recover xc(t) EXACTLY from its samples?
Low pass
filter

Xs j s>2N
-
3s 2s s -N N s 2s 3s

Xs j s<2
- N
3s 2s s -N N s 2s 3s

 Let xc(t) be a band-limited signal: X c ( j)  0 for    N

 xc(t) is uniquely determined by its samples x[n]= xc(nT) if

2
s   2Fs  2 N
32 T
The Sampling Theorem

 N The maximum frequency of xc(t) : the Nyquist Frequency

 2N The minimum sampling rate that must be exceeded : the Nyquist Rate
2
s   2fs  2N
T
 T The Sampling Period

 [- , ] The Nyquist Interval

 c   s / 2   / T The cutoff frequency


33
Sampling: Applications
 Audio sampling:
 Human hearing: 20–20,000 Hz range
 Sampling rate is at
• 44.1 kHz (CD), 48 kHz (professional audio), or 96kHz
 The sampling rate is a consequence of the Nyquist theorem
 Speech sampling:
 The energy of human speech: 5Hz - 4 kHz range
 Sampling rate: 8 kHz
(Used by nearly all telephony systems)
 Video sampling:
 Standard-definition television (SDTV): 720x480 pixels (US) or 704x576 pixels (UE)
 High-definition television (HDTV): 1440x1080
 Sampling-rate conversion: Given a digital signal, change its sampling rate
 Necessary for image display when original image size differs from the display size
 Necessary for converting speech/audio/image/video from one format to another
 Sometimes we reduce sample rate to reduce the data rate
• Down-sampling: reduce the sampling rate
• Up-Sampling: increase the sampling rate

34
Practically estimate Fs from x(t)

 Find the shortest ripple in x(t)


 In the shortest ripple, there should be at least two
samples
 The inverse of its length Tmin is approximately the
maximum frequency Fmax of x(t)
 Need at least two samples in this interval (ripple), in
order not to miss the rise and fall pattern

 Note: Sometimes the highest frequency components of a


signal are simply noise, or do not contain useful information
35
Outline
 Introduction
 Introduction to filters
 Representation of a CT Signal by Its Samples: Sampling
o Interpolation: Reconstruction of a Signal from Its Samples
o The Effect of Under-sampling: Aliasing
o Discrete-Time Processing of Continuous-Time Signals
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals
o Quantization
o Summary

36
Reconstruction Methods

 Reconstruction is interpolation:
Connecting samples x[n] using interpolation kernels
 Ideal: Band-limited (ideal) Interpolation
 Practical interpolation:
• Zero-Order Hold:
• e.g. scanned images
• First-Order Hold:
• Linear interpolation: commonly used in plotting

37
Band-limited Interpolation

X r ( j)  H r ( j) X (e jT )

38
Band-limited Interpolation

s(t )    (t  nT )
n  


x (t )
s
x[n]
H r
( j )


xr (t )  xs (t )  h(t )   x(nT )h (t  nT )
n  
r

cT sin(ct ) sin(t / T )


hr (t )    sinc function
ct t / T
39
Normalized Sinc Properties
sin t / T 
hr t  
t / T

t/T integer

T0

40
Ideal Reconstruction Filter
 Ideal LPF with cut of frequency of c=/T or Fc=2/T

 Normalized Sinc Function

sin t / T 
hr t  
t / T

41
Band-limited Interpolation
If there is no overlap between shifted spectra, a LPF can
recover x(t) from xs(t)

X ( j) Xs ( j)
1
1 s  2M
T

 M 0 M   s  M 0 M s 

X r ( j)
Hr( j)
1
T M  c  (s  M )
 M 0 M 
 c 0  c 
42
Band-limited Interpolation
xs(t)
T x(0) x(T)
 Given the samples x[n]

0 t
 We can reconstruct x(t) by generating a periodic
impulse train with amplitudes that are
successive sample values
 This impulse train is then processed through an
ideal lowpass filter with gain T and cutoff
 
frequency greater than  and less than
N s N

 The resulting output signal x(t) will exactly be


equal x(t)

43
Band-limited Interpolation

 Requirement for perfect reconstruction:


 Sampling Theorem is satisfied
1. Band-limited signal x(t)
2. Enough sampling frequency
 Exact recovery of x(t) by an Ideal Lowpass
Filter (LPF)

44
Band-limited Interpolation 
xr (t )  xs (t )  h(t )   x(nT )h (t  nT )
n  
r

45

sint  nT  / T 
xr t    xn
n   t  nT  / T

46
sinc (ideal) Reconstruction


sint  nT  / T 
xr t    xn
n   t  nT  / T

sin t / T 
hr t  
t / T
sinc function is 1 at t=0

sinc function is 0 at t=nT

X r  j  X e jT  H r  j

47
Reconstruction: overview

sin(t / T )
hr (t ) 
t / T
Cutoff frequncy : c  s / 2   / T

48
Reconstruction: overview
CT signal

Modulated impulse train


sin( (t  nT ) / T )
xr (t )   x[n]
n    (t  nT ) / T

49
Outline
 Introduction
 Introduction to filters
 Representation of a CT Signal by Its Samples: Sampling
o Reconstruction of a Signal from Its Samples: Interpolation
o The Effect of Under-sampling: Aliasing
o Discrete-Time Processing of Continuous-Time Signals
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals
o Quantization
o Summary

50
The Effect of Undersampling: Aliasing
When s≤2N undersampling

Xc j
-N N

Xs j s>2N
3s - s -N N s 2s 3s
2s
Xs j s<2N
- s -N N s 2s 3s
3s 2s

o Aliasing: overlapping of replicas of Xs in frequency domain

51
The Effect of Undersampling: Aliasing

H  j
s(t )   (t  nT )
n  

x  
s
(t )
H j

 s  s 
2 2
X r ( j)  X ( j)

 s  s

2 2

52
The Effect of Undersampling: Aliasing

 Aliasing is
 the presence of unwanted components in the reconstructed signal
• These components were not present when the original signal was sampled
 some of the frequencies in the original signal may be lost in the
reconstructed signal

 Aliasing occurs because signal frequencies can overlap if the sampling


frequency is too low

 Frequencies "fold" around half the sampling frequency


 Sometimes this frequency is often referred to as the folding frequency

53
The Effect of Undersampling: Aliasing
Sometimes the highest frequency components of a signal
are simply noise, or do not contain useful information
To prevent aliasing of these frequencies, filter out these
components before sampling the signal using ANTI-
Aliasing filter: a low-pass filter BEFORE SAMPLING that
filters out high frequency components and lets lower
frequency components through

54
The Effect of Undersampling: Aliasing

An example:  
)
X( jj
X

x(t )  cos (0t )


00
 0 0

0

X ps ( jj
X )

 s  60
 s 0 
00  s s 

x (t )  cos( t )  x(t )
r 0 2 ( s  0 )

55
The Effect of Undersampling: Aliasing

s 
6 0
4
x (t )  cos(   )t  x(t )
r
s 0

Aliasing
X s ( j)

 s 0  s 0  s 
( s  0 ) 2
56
The Effect of Undersampling: Aliasing

s
0 
6

2 s
0 
6

57
The Effect of Undersampling: Aliasing

4 s
0 
6

5 s
0 
6

58
Demo: Aliasing

1. Run applet under


http://www2.egr.uh.edu/~glover/applets/
Sampling/Sampling.html
2. Aliasing and Folding Demo: Samplemania
from John Hopkins University

59
Outline
 Introduction
 Introduction to filters
 Representation of a CT Signal by Its Samples: Sampling
o Reconstruction of a Signal from Its Samples: Interpolation
o The Effect of Under-sampling: Aliasing
o Examples
o Discrete-Time Processing of Continuous-Time Signals
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals
o Quantization
o Summary

60
Example 1:
Sampling of sinusoidal Signals
Given : xc (t )  cos(4000t ) & T  1 / 6000
Find x[n] & X (e j )
1) xc (t )  cos(4000t )   0  4000
T  1 / 6000   s  2 / T  12000  no aliasing
x[n]  xc (nT )  cos(4000nT )  cos((2 / 3)n)  cos(0 n)
2) xc (t )  X c ( j)   (  4000 )   (  4000 )
Note :  (at )   (t ) / | a |
1 
X s ( j)   X c ( j (  k s ))
T k 
X (e j )  X s ( j) | / T  X s ( j / T ) with normalized frequency   T
61
Example 1: Sampling of sinusoidal Signals

Since  (at )   (t ) / | a |  ( / T )  T () How about


xc (t )  cos(16000t )
62
Example 2:Sampling system

(t nT)
n

For the following system x c (t ) x[n]xc(nT


)
 Conversion to a
sequence
x (t )
s

find the FT of the output signal x[n] if


 
1  ,  M    0
M

 
X c ( j )   1  , 0    M
 M
 0,   M
Suppose s  2M 

63
Example 2:Sampling system
1 
2
X s ( j ) 
T
X
k  
c ( j (  k s )), s 
T
j 1 
  2k
X (e jw )  X s (
T
)
T

k  
X c ( j(
T
))

1 
T (1  ),   M    0
M

 1 
X (e jw )   (1  ), 0     M
 T M
 0,   M


Periodic with 

64
Example 2:Sampling system

The Fourier transform of x[n] is

1/T


-2 -wM -2 -2 +wM -wM 0 wM 2 -wM 2 2 +wM

65
Example 3: audio sampling
A signal at frequency 50Hz is sampled with Fs=80 Hz.
1- What frequency will be recovered ?
2- Repeat when it is sampled at 120Hz.
Part 1: investigation
 Data collection: x(t )  e j 2F0t  e j 2 50t
 With F0 = 50Hz and sampling with Fs=80 Hz, the signal is undersampled (the
sampling theorem is not statisfied)
 The Nyquist interval is [-40Hz, 40Hz]
 The samples do not only represent the frequency F = 50Hz but all frequencies
F± k*Fs=50±m80 , k=0, 1, 2..., i.e. the frequencies
F0=50, 50±80, 50±160, 50±240...= 50,130 ,-30,210,-110,290,-190

 Analysis: xr (t )  e j 2 ( 30)t
Only the frequency -30Hz lies within the Nyquist interval
Then the recovered signal will be -30Hz (30Hz and phase reversal)
This signal is the alias of the original signal at 50Hz
 Notice that 30Hz is just the difference 80Hz – 50Hz
"Source: http://cnx.org/content/m28684/latest/ "
66
Example 3: audio sampling

Part 2:

 Data collection:
 Now, the sampling frequency is 120Hz, the sampling theorem is statisfied

 Analysis:
 Then the original frequency of 50Hz will be recovered xr (t )  e j 2 (50)t
 But none of other frequencies

F0=50±k*120=50, 170, −70, 290, −190...

lie in the Nyquist interval [-60Hz, 60Hz], except the original frequency of 50Hz
as already known.

67
Example 4: audio sampling
 A system uses the sampling frequency Fs=20 kHz
to process audio signal that is frequency-limited at 10 kHz, but the anti-
aliasing filter still allows frequencies up to 30 khz pass through even at small
amplitudes. What signal will we get back from the samples?
 For sampling rate Fs=20 kHz, the Nyquist interval is [-10kHz, 10kHz]
 the audio frequency 0 –10 kHz will be recovered as is
 The audio frequency from 10 – 20 kHz will be aliased into the frequency
range -10 – 0 kHz
 The audio frequency from 20 – 30 kHz will be aliased into the frequency
range 0 – 10 kHz
The resulting audio will be distorted due to the superposition of the 3
frequency bands caused by the too high Fc of the anti-aliasing filter compared
to Fs

68
Example 5: Prob 7.39 S&S
Problem 7.39

A signal x p (t ) is obtained through impulse train


sampling of a sinusoidal signal x(t ) whose frequence
is equal to half the sampling frequence s .
s 
x(t ) = cos( t   ) and x p (t )   x(nT ) (t  nT ),
2 n
2
where T 
s
69
Example 5: Prob 7.39 S&S

s
(a) Find g (t ) such that x(t ) =cos( )cos( t )+ g (t )
2

Using Trigonometric identities,


s s s
cos( t   )=cos( t )cos( ) - sin( t )sin( )
2 2 2
s
 g (t )  -sin( t )sin( ) (1)
2

70
Example 5: Prob 7.39 S&S

(b) Show that g (nT ) = 0, for n=0,  1,  2,...

2
By replacing s with , and t by nT in the equation (1), we get
T
2
g (nT ) = - sin( nT )sin( )= - sin(n )sin( ), the right hand side of the
2T
equation is equal to zero for n=0,  1,  2,...

71
Example 5: Prob 7.39 S&S

(c) Using the results of the previous two parts, show


that if x p (t ) is applied as the input to an ideal lowpass
s
filter with cutoff frequence , the resulting output is
2
s
y(t ) =cos( )cos( t ).
2

72
Example 5 Prob 7.39 S&S
From parts (a) and (b), we get

x p (t )   x ( nT ) (t  nT )
n
  s 
   (t  nT ) cos( nT )cos( )+g ( NT ) 
n  2 
 s
   (t  nT )cos( nT )cos( ).
n 2

When the system is passed through a lowpass filter,


we are performing a band-limited interpolation, the
s
result is the signal y (t )=cos( t )cos( ).
2
73
Example 6: Prob 7.1 S&S

s
Consider Sinusoidal signal x(t ) = cos( t  )
2

Suppose that this signal is sampled, using impulse sampling, at


exactly twice the frequency of the sinusoid, i.e., at sampling
frequency ωS

As shown in Problem 7.39, if this impulse-sampled signal is applied


as the input to an ideal lowpass filter with cut frequency ωS/2., the
resulting output is:

s
xr (t )=cos( t )cos( )
2
74
Example 6: Prob 7.1 S&S

 As a consequence, we see that perfect reconstruction of


x(t) occurs only in the case in which the phase Φ is zero
(or an integer multiple of 2π. Otherwise, the signal xr(t)
does not equal x(t).

 As an extreme example, consider the case in which

Φ = - π/2, so that

s
x(t )=sin( t)
2

75
Example 6 : Prob 7.1 S&S

 The values of the signal at integer multiples of the sampling


period 2π / ωS are zero.

 Consequently. sampling at this rate produces a signal that


is identically zero, and when this zero input is applied to the
ideal lowpass filter, the resulting output xr(t) is also
identically zero.

Fig. 7.17
76
Example 7
 Consider the following sinusoidal signal with the
fundamental frequency F = 4kHz:
g(t) = 5cos(2πFt) = 5cos(8000πt).
 The sinusoidal signal is sampled at a sampling rate
Fs = 6000 samples/second and reconstructed with an
ideas low-pass filter (LPF) with the following transfer
function:
H1(jW) = 1/6000 : |W| <= 6000π
0 : otherwise
i) a) Determine the reconstructed signal y(t). Give details
of derivations of Gs(jW).
b) Is the reconstruction perfect? If yes, justify and if no,
suggest how can it be achieved. Give details.

77 from “Continuous and Discrete Time Signals and Systems”; Mandal & Asif
78
79
80
81
82
Outline
 Introduction
 Introduction to filters
 Representation of a CT Signal by Its Samples: Sampling
 Reconstruction of a Signal from Its Samples: Interpolation
 The Effect of Under-sampling: Aliasing
 Examples
o Discrete-Time Processing of Continuous-Time Signals
o DT processing: Effective CT Frequency Response
o DT from CT: Impulse invariance
o CT processing: Effective DT Frequency Response
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals
o Quantization
83 o Summary
DT Processing; CT Processing
H eff  j  
 
H e j    ;   T
 0 otherwise

Hc j    ;   T
He j

 0 otherwise

84
DT Processing of CT
Signals

Reason for this:


We can take advantage of the vast variety of
general- or special-purpose discrete time signal processing devices

C/D xd [n]  xc (nT ) yd [n]  yc (nT ) D/C


xc (t ) DT-S yc (t )
Conversion Conversion

T T
xd [n]  xc (nT ) yd [n]  yc (nT )

85
DT Processing of CT Signals

 Overall system is equivalent to a CT system: Input and output are CT


 The CT system depends on
 Discrete-time system
 Sampling rate
 What is the equivalent (effective) frequency response of the overall
system?
1. Find the relation between xc(t) and x[n]
2. Next between y[n] and x[n]
3. Finally between yr(t) and y[n]  
H e j    ;   T
H eff  j  
 0 otherwise
86
C/D Conversion

Fig. 7.21

87
C/D Conversion
Illustration in the Frequency Domain

88
C/D Conversion
Illustration in the Frequency Domain

 
xs t   xc t st    x t  t  nT 
c   x nt  t  nT 
c
n   n  

CT

1  
Xs j   Xc j  ks   xc (nT ) e
 jnT

T k   n  

2
 Periodic with period s  T

89
C/D Conversion
Illustration in the Frequency Domain

 

 x [ n] e  x (nT ) e
 jn  jn
DT
Xd (e ) 
j
d  c
n   n  

Periodic with period N=2Π

 = CT frequency
 = DT frequency (   T )

90
D/C Conversion
 yd[n] → yc(t)
 Reverse of the process of C/D conversion

91
C/D & D/C conversion
Effective Frequency Response

 So what is the frequency response of the overall system


 First step is the relation between xc(t) and x[n]
 Next between y[n] and x[n]
 Finally between yr(t) and y[n]

H eff  j  
 
H e j    ;   T
92  0 otherwise
Effective Frequency Response
   2k  
 Input CT to DT xn  xc nT  Xe j

1 
 Xc  j 
T k     T
 
T 
 Assume a DT LTI system

   H e X e     X  j T  2Tk  



j j j 1
Ye  H e j c
T  
k   
 Output DT to CT

sint  nT  / T  TY e jT
Yr j  
    /T
yr t    yn
n   t  nT  / T  0 otherwise

 Output frequency response Yr j  


 
H e jT Xc j    / T
 0 otherwise
 Effective Frequency Response

Yr  j  H eff  jX c  j


H e jT
Heff j  
    /T
93  0 otherwise
Example 4.3 (DTSP): Ideal low-pass filter
implemented as a DT system

CT input signal

Sampled CT input signal

Apply DT LPF

94
Example 4.3: Ideal low-pass filter
implemented as a DT system

Signal after DT LPF


is applied

Application of
reconstruction filter

Output CT signal
after reconstruction

95
Freq. response of
Differentiator

96
Freq. response of
integrator

97
Example 4.4: Digital Differentiator
Construction of Band-limited Digital Differentiator

j |  | c
Desired: Hc( j)
|  | c
2 
Set s  2c  T  
s c M  c

98
Example 4.4: Digital Differentiator

99
Example: Problem 7.29 S&S

100
Outline
 Introduction
 Introduction to filters
 Representation of a CT Signal by Its Samples: Sampling
 Reconstruction of a Signal from Its Samples: Interpolation
 The Effect of Under-sampling: Aliasing
o Discrete-Time Processing of Continuous-Time Signals
o DT processing: Effective CT Frequency Response
o DT from CT: Impulse invariance
o CT processing: Effective DT Frequency Response
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals
o Quantization
o Summary
101
Impulse Invariance
 Impulse Invariance:
 The sampling of the CT impulse response h(t) to produce
the DT impulse response h[n]
 If h(t) is appropriately band-limited
j
 H(e ), the frequency response of the DT system will be
defined as H( j) the CT system's frequency response with
linearly-scaled frequency i.e.,
 If the CT filter has poles at s = sk, these poles are
translated to poles at ; T is sampling period
if the CT filter is causal and stable, then the DT filter will
be causal and stable as well

102
Impulse Invariance
 Given a CT system Hc(j)
 how to choose DT system response H(ej)
 so that effective response of DT system Heff(j)=Hc(j)

 Answer:  
H e j  H c  j / T   

 Condition: Hc j  0   /T

 Given these conditions, the DT impulse response can be written in terms


of CT impulse response as
hn  Thc nT 

Resulting system is the impulse-invariant version of the CT system

103
Example: Impulse Invariance

1   c
 Ideal low-pass DT filter by impulse invariance Hc j  
0 else

sinc t 
 The impulse response of CT system is hc t  
t

 Obtain DT impulse response via impulse invariance

sincnT  sincn
hn  Thc nT   T 
nT n

 The frequency response of the DT system is



1   c
 
Hc e j

104 0 c    

Outline
 Introduction
 Introduction to filters
 Representation of a CT Signal by Its Samples: Sampling
 Reconstruction of a Signal from Its Samples: Interpolation
 The Effect of Under-sampling: Aliasing
o Discrete-Time Processing of Continuous-Time Signals
o DT processing: Effective CT Frequency Response
o DT from CT: Impulse invariance
o CT processing: Effective DT Frequency Response
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals
o Quantization
o Summary

105
CT processing of DT signals

Hc j    ;   T


 
He j

 0 otherwise

106
Discrete-Time System for Arbitrary Delay
y[n]  x[n    real or integer
 
H e j  e j ;   
H ( z)  z 
• For integer delay values:
 This DT system is meaningful: the samples y(n) are equal to the
delayed samples of x(n)

• For real delay values:


 y(n) would lie somewhere between the known samples of x(n)
The unknown y(n) would then have to be obtained by way of interpolation
from the known x(n)

y[n]  x[n     xn sinc(n    k );
k  

N integer;  real; T  1 sampling period

• Conclusion: producing a fractional delay requires reconstruction of the


discrete-time signal and shifted resampling of the resulting continuous-time
107
(T=1 to simplify notation)
108
Discrete-Time Moving Average System

1 M
y[n]  
M 1 k = 0
x [n - k]
M
1
j
H (e )  
M 1 k = 0
e - jk

1 sin( ( M  1) / 2) - jM / 2
 e
M 1 sin()
 1
 M  1 , M  n  0

h[n]  
 0, otherwise

109 
For even M, this moving
average will cause a non-
integer delay to the input

110
Summary

o DT processing: Effective CT Frequency Response

H eff  j  
 
H e j    ;   T
 0 otherwise

o DT from CT: Impulse invariance


o Sampling of hc(t)
hn  Thc nT 

o CT processing: Effective DT Frequency Response

Hc j    ;   T
He j

 0 otherwise
111
Outline
 Introduction
 Introduction to filters
 Representation of a CT Signal by Its Samples: Sampling
 Reconstruction of a Signal from Its Samples: Interpolation
 The Effect of Under-sampling: Aliasing
o Examples
o Discrete-Time Processing of Continuous-Time Signals
o A/D and D/A Conversion:
o Practical sampling & reconstruction
o Sampling of Discrete-Time Signals
o Quantization
o Summary
112
A/D and D/A Conversion

Ideal impulse sampling Practical rectangular sampling

A non-ideal system samples x(t) at a given instant and holds that value
until the next instant, at which a sample should be taken

x(t ) Zero-order x0 (t )
hold
113
A/D and D/A Conversion

 Up to this point we assumed ideal D/C and C/D conversion

 In practice, CT signals are not perfectly band-limited


D/C and C/D converters can only be approximated with D/A and A/D
converters
 A more realistic model for digital signal processing

H e j 

H eff  j

 In the following we discuss each block of this figure


114
1) AntiAliasing filter AAF
 Desirable
1. to minimize sampling rate: Minimizes amount of data to process
2. to reduce noise: no point of sampling high frequencies that are not of interest
(e.g., noise)
 A low-pass anti-aliasing filter would improve both aspects
1   c   / T
An ideal anti-aliasing filter AAF H aa  j  

0   c

 The effective response via DT LPF is H  j  


 H e jT
    c

  c
eff
 0

 In practice an ideal AAF is not possible; hence 


H eff  j  H aa  jH e jT 
 Haa() is a sharp-cutoff analog filters which are expensive
115
Simplifying AAF :
Oversampled A/D Conversion
1. have a simple (gradual cutoff) analog anti-aliasing filter

1 
2. use higher than required sampling rate  s  2M N  T 
M N

3. implement sharp DT anti-aliasing filter c 
M
4. downsample to desired sampling rate 's  2M N /M  2 N

116
Oversampled A/D Conversion:
simplifying AAF

x(at )    X  j / a 

351M Digital Signal Processing


117
2) A/D Conversion

 Two steps: sampling in time t and quantization


of the amplitude x
 Sampling  x[n] = x(nT)

 Quantization: map amplitude values into a set


of discrete values x’[n] = Q(x[n])
 Quantization error: e[n] = x[n]-x’[n]

118
2) A/D Conversion
 Ideal C/D converters convert CT signals into infinite-precision DT signals
 In practice we implement C/D converters as the cascade of

 The sample-and-hold device holds current/voltage constant


 The A/D converter converts current/voltage into finite-precisions number
 The ideal sample-and-hold device has the output


1, 0  t  T
x0 t    xnh0 t  nT  h0 t   
n   0, else

 2 sin(T / 2) 
H 0 ( j)  e  jT / 2
 
119   
A/D Conversion :
Ideal Sample and Hold


x0 t    xnh t  nT 
n  
0

 Time-domain:

120
A/D Conversion:
Sampling with Zero-Order Hold

o Zero-order hold: impulse-train sampling followed


by an LTI system with a rectangular impulse
response s(t )
x (t )
s

xs (t ) x (t)  x (t ) * h (t )
0 s 0

121
Example: Prob 7.24 S&S

 Sampling with a square signal …

122
Outline
 Introduction
 Filters for sampling
 Representation of a CT Signal by Its Samples: Sampling
 The Effect of Under-sampling: Aliasing
o Sampling with Zero-Order Hold
o Reconstruction of a Signal from Its Samples: Interpolation
o Examples
o Discrete-Time Processing of Continuous-Time Signals
o Quantization
o Sampling of Discrete-Time Signals
o A/D and D/A Conversion
o A/D conversion
o D/A conversion
o Quantization
o Summary

123
3) D/A conversion:
Reconstruction Methods
 Reconstruction: connecting samples x[n] using
interpolation kernels
a) Zero-Order Hold: D/A Conversion
e.g. scanned images
b) First-Order Hold: D/A Conversion
Linear interpolation: commonly used in plotting
xzoh t  x foh t 

124
Ideal, zero-order hold, and first-order hold reconstruction

125
D/A Conversion: Zero-Order Hold:

 Perfect reconstruction requires filtering with ideal LPF

 
X r  j   X e jT H r  j 
 
X e jT : DTFT of sampled signal
X r  j  : FT of reconstructed signal
 The ideal reconstruction filter

T   /T
Hr j   
0
   /T
 The time domain reconstructed signal is

sint  nT  / T 
xr t    xn
n   t  nT  / T
 In practice we cannot implement an ideal reconstruction filter

126
D/A Conversion: Reconstruction with Zero-
Order Hold

| H r ( j) |
T Ideal interpolating
Zero-order filter
hold

s s 
 s  0 s
2 2

127
D/A Conversion

 The practical D/A converter: Digital to analog converter + Analog LPF

 It takes a binary code and converts it into CT output


 
xDA t   X m xˆ B n h0 t  nT    xˆnh0 t  nT 
n   n  
 Using the additive noise model for quantization
 
xDA t   x0 t   e0 t    xnh t  nT    enh t  nT 
n  
0
n  
0

 The signal component in frequency domain can be written as


Note: x[n]=xa(nT)
X0 j  X e H0 j
jT
 X e jT
1 

  X a  j   k s   T k  
 To recover the desired signal component we need a compensated
reconstruction filter of the form to get xa(t) back
~ H j 
Hr j   r
128 H0 j 
D/A Conversion:
Reconstruction with Zero-Order Hold

o Cascade of a zero-order hold with a reconstruction filter


H ( j)
sp(t(t))
hr (t )
x(t) ×
xx p(t(t))
s 1
h0 (t )
x0 (t )
rx(t
r (t))
0 T t
H r ( j)

 2 sin(T / 2) 
H 0 ( j)  e 
 jT / 2

  
e jT / 2 H ( j)
H r ( j) 
2 sin(T / 2)
129

4) Compensated Reconstruction Filter
~ Hr j 
Hr j  
H0 j 
2 sinT / 2  jT / 2
 The frequency response of zero-order hold is H0 j  e

 Therefore the compensated reconstruction filter should be
 T / 2 jT / 2
~  e   /T
Hr j    sinT / 2
 0   /T

130
D/A Conversion: Reconstruction with Zero-
Order Hold

Reconstruction filter
| H r ( j) | | H r ( j) |

s
2
s 
2
s s 
2 2

Magnitude and phase for the reconstruction filter for a zero-order hold

131
First-Order Hold: Linear interpolation

Impulse-train sampling followed by convolution with a triangular impulse response


x s (t )
s(t )   (t  nT )
n  

( j)
x (t )
s
x[n]
H r

132
First-Order Hold: Linear interpolation
s(t )
x s (t )
x[n]

x s (t )

133
First-order versus
zero-order hold
 First-order hold filter: the signal is
reconstructed as a piecewise linear
approximation to the original signal xc(t)
 h(t) is a triangle
 Zero-order hold filter converts a DT signal
to a CT signal by holding each sample
value for one sample interval
 h(t) is a square

134
Comparison of frequency responses of ideal lowpass, zero-
order hold, and first-order hold reconstruction filters

• “zero-order” since the CT signal is a zeroth order polynomial between


the sampling points
• “first-order” since the CT signal is a first order polynomial between the
sampling points
135
Sampling and Interpolation of Images

136 Fig. 7.12 & Fig 7.14


Outline
 Introduction
 Introduction to filters
 Representation of a CT Signal by Its Samples: Sampling
 Reconstruction of a Signal from Its Samples: Interpolation
 The Effect of Under-sampling: Aliasing
o Discrete-Time Processing of Continuous-Time Signals
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals:
o Up-Sampling (more samples)
o Down-sampling (less samples)
o Quantization
o Summary
137
Up & Down Sampling: Applications

 Sampling-rate conversion: Given a digital signal,


change its sampling rate
 Necessary for image display when original image
size differs from the display size
 Necessary for converting speech, audio, image,
video from one format to another
 Sometimes we reduce sample rate to reduce the
data rate
• Down-sampling: reduce the sampling rate
• Up-Sampling: increase the sampling rate
 Audio CD DVD
 Film TV Signal
 Underwater signal Upsampling
138
Recall: Time-Scaling of signals x(at)

x(t)

x(2t) Ex: Upsampling


Compression a>1

x(t/2) Linearly stretching a<1


Ex: Downsampling

139
Down-Sampling of DT Signals

 Impulse-Train Sampling

x[n] × xp[n]


p[n]    [n  kN]
k  
N sampling period

 x[n], if n=an integer multiple of N


x p [ n]  
 0, otherwise

x p [ n]  x[ n] p[ n]

 
k 
x[kN ]  [n  kN ]
140
Down-Sampling of DT Signals
Time domain illustration by a factor of 2

x[n]

p[n]

xp[n]

n
Fig. 7.31
141
Down-Sampling of DT Signals
X (e j )
1
Frequency domain analysis
 2  M 0 M 2 
1
X p (e j )  2 P(e j )X (e j (  ) )d
2 2 P(e j )
N

2 s 2 
P(e j ) 
N
  (  k s ) X p (e j )
k   1  s  2 M
N
N 1
1
j
X p (e ) 
N
 X (e j (  k s )
)  2  M 0 M  s
( s   M )
2 
k 0
Aliasing 1
N
s  2M

142
Fig. 7.32
0 s 2 
Down-Sampling of DT Signals
Exact Recovery Using Ideal Lowpass Filter:

143
Fig 7.33
Down-Sampling of DT Signals
DT Decimation & Interpolation

DT Sampling

Decimation

144
Fig. 7.34
Down-Sampling of DT Signals
Frequency domain illustration of the relationship between DT
Sampling and decimation
j j / N
X (e ) j X (e )  X (e
b p )

X b (e j )

X P (e j )

145 Fig. 7.35


Up-Sampling of DT Signals
Higher Equivalent Sampling Rate

146
Fig. 7.37
Up-Sampling of DT Signals
Spectra for upsampling by a factor of 2

Fig. 7.37
147
Example: Ex. 7.5 S&S
Down-sampling + up-sampling

2
4 
9

2 9
 
9 2

148
Example: Ex. 7.5 S&S
Down-sampling + up-sampling

2 1 
 
9 2 9
2 1 
 
9 2 9


9  
9
Fig. 7.38
149
Sampling of Discrete-Time Signals:
Changing Sampling Rate (Integer Factor)

 A CT signal can be represented by its samples as


xn  xc nT 

 Some applications require us to change the sampling rate


 Or to obtain a new DT representation of the same CT signal of the form

x' n  xc nT ' where T  T' Changing the time axis

 The problem is to get x’[n] given x[n]

 One way of accomplishing this is to


 Reconstruct the CT signal from x[n]
 Re-sample the CT signal using new rate to get x’[n]
 This requires analog processing which is often undesired

150
Sampling of Discrete-Time Signals
Decreasing the Sampling Rate by Integer Factor:
Down-Sampling/Decimation

 We reduce the sampling rate of a sequence by “sampling” it


xd n  xnM   xc nMT 
 This is accomplished with a sampling rate compressor

2 2 
 There will be no aliasing if 's    2 N  's   N
T ' MT MT

 Note that we may obtain xd n by reconstructing the signal and re-sampling it with
151
T’=MT
Sampling of Discrete-Time Signals
Frequency domain analysis of Down Sampling

 Recall the DTFT of x[n]=xc(nT)


   2k  
 
X e j 1 
  X c  j 
T k    T
 
T 
 The DTFT of the down-sampled signal can similarly written as
   2r      2r  
  1  
1
Xd e j
  X c  j      X 
c j    
T ' r    T ' T '   MT r     MT MT  
 With r=i+kM,
1     2k 2i  
 
M 1
1
Xd e j
    c  X  j    
M i 0  T r     MT T MT  
 And finally
 j  M  2Mi    M copies of X(e^jw),
X d e  
M 1
1
j

M
 X e 



frequency-scaled by M and
shifted by multiple of 2
152
i 0  
Frequency domain analysis of Down sampling: No aliasing

frequency-scaled by M

Normalized freq :
  T '  TM
153
Down-sampling
  
  


X d e   ( X e
1  2
j   j  
j
 X  e  2  )
2  




 Down-sampling
1) expands each 2π-periodic repetition of X(e^jw) by
a factor of M along the ω axis
 new period is then M2π
2) reduces the gain by a factor of M
 If x[n] is not bandlimited to π/M, aliasing may
result from spectral overlap
154
Frequency domain analysis of Down sampling: No aliasing

Downsampling stretches frequency-scaled by M


the DTFT by a factor of M
along with the ω axis

shifted by multiple of 2
+ reduces the gain by M

155
If x[m] is not band limited to π/M  aliasing Source: http://cnx.org
Downsampling without filtering (causes aliasing) and with filter

156
Sampling of Discrete-Time Signals
Increasing the Sampling Rate by Integer Factor:
Up-sampling/Interpolation

 Increase the sampling rate of a sequence by interpolating it

xi n  xn / L  xc nT / L


 Sampling rate expander

 We obtain xi[n] that is identical to what we would get by reconstructing the signal
and re-sampling it with T’=T/L

 Up sampling consists of two steps: Expanding & Interpolating


 xn / L n  0, L,2 L,... 
xe n     xk  n  kL
157  0 else k 
158
Sampling of Discrete-Time Signals:
Expanding
 The DTFT of xe[n] can be written as
    jn 
   

Xe e j
    xk  n  kLe   xk e  jLk  X e jL
n    k    k  

 The output of the expander is


frequency-scaled

159
Interpolating sampled DT signals

 The DTFT of the desired interpolated signals is

 The extrapolator output is given as

 To get interpolated signal we apply the following ideal LPF

160
Upsampling: insertion of L−1 zeros
between every sample of the input signal

Upsampling compresses the DTFT by a factor of L along with the ω axis

161
Interpolator in Time Domain

 xi[n] in a low-pass filtered version of x[n]


sin n / L 
The low-pass filter impulse response is hi n 
n / L

 Hence the interpolated signal is written as



sin  n  kL / L 
xi n   xk 
k    n  kL / L
 Note that hi 0  1
hi n  0 n  L,2L,...

 the filter output can be written as

xi n  xn / L  xc nT / L  xc nT ' for n  0,L,2L,...


162
Non-ideal LPF: Linear interpolation

163
Sampling of Discrete-Time Signals:
Changing the Sampling Rate by Non-Integer Factor:
combine decimation and interpolation

• Since both interpolation and anti-aliasing filters are low-pass filters, the filter with the
smallest bandwidth is more restrictive and can therefore be used in place of both filters

164
Sampling of Discrete-Time Signals:
Changing the Sampling Rate by Non-Integer Factor

 If M>L: net increase of sampling period (or decrease in


sampling frequency)
net operation is downsampling
 π / M is the dominant cutoff frequency & the low-pass
filter should have cutoff at π / M
 If M<L and T respects Nyquist theorem
 π / L is the dominant cutoff frequency
no need to further limit the bandwidth of the signal
below Nyquist frequency

 Interpolation and downsampling are not reversible, due to


165 loss of data
Changing the rate by 2/3

166
Outline
 Introduction
 Filters for sampling
 Representation of a CT Signal by Its Samples: Sampling
 The Effect of Under-sampling: Aliasing
o Reconstruction of a Signal from Its Samples: Interpolation
o Discrete-Time Processing of Continuous-Time Signals
o A/D and D/A Conversion
o Sampling of Discrete-Time Signals
o Quantization
o Summary

167
Quantization

x̂n  Qxn
 C/D converter can be modeled as

 Quantizer transforms input into a finite set of numbers


 Most of the time uniform quantizers are used

 Quantization is the process of approximating ("mapping") a continuous


set of values by a relatively small ("finite") set of discrete symbols or
integer values
 For example, rounding a real number in the interval [0,100] to an
integer
• (a continuous set or a very large set of possible discrete values)
• (to discrete values or to values which can still take on continuous
range)
 Quantization can be described as a mapping that represents a finite
continuous interval I = [a,b] of the range of a continuous valued signal,
with a single number c, which is also on that interval

168
Quantization
x̂n  Qxn

 The step-size Q depends on


the dynamic range of the signal amplitude and
 perceptual sensitivity
 The signal range D (or also Xm) & step-size Q
determine the bitrate R bits/sample
 2^B=D/Q  Q=Xm/2^B
 For speech: B = 8 bits; For music: B =16 bits
 One can trade off T (or fs) and Q (or B):
 lower B -> higher fs; higher B -> lower fs

169
Uniform Quantizer

 Applicable when the signal is


in a finite range (fmin, fmax)
 The entire data range is
divided into L equal intervals of
length Q
 Q=(fmax-fmin)/L
 Q quantization interval or
quantization step-size
 Interval i is mapped to the
middle value of this interval
 We store/send only the
index of quantized value  Index of quantized value
Qi(f) = f-fmin/Q
 Quantized value
Q(f) = Qi(f)*Q +Q/2+fmin
170
Source: http://eeweb.poly.edu/~yao/EE3414/quantization.pdf
Uniform Quantizer: Example

Source: http://eeweb.poly.edu/~yao/EE3414/quantization.pdf
171
Quantization: applications

 Telephony system: 8-bit quantization


 Values of the analog sound are rounded to the closest of 256
distinct voltage values represented by an 8-bit binary number
 This causes quantization noise into the signal, but the result is still
more than adequate to represent human speech

 Music: CDs use 16-bit quantization:


 allowing 65,536 distinct voltage levels

 Image processing: lossy compression achieved by quantization or


compressing a range of values to a single quantum value
 For example, reducing the number of colors required to represent
a digital image
 Ex: DCT data quantization in JPEG
172
Audio Quantization

173
Effect of Quantization Step-size:
quantization noise/error

174
Source: http://eeweb.poly.edu/~yao/EE3414/quantization.pdf
en  x̂n  xn
Quantization Error
 Quantization error: difference between the original
and quantized value
 If quantization step is , the quantization error will
satisfy   / 2  en   / 2 if the input does not clip

we may use the following simplified model

 ( Xm   / 2)  x[n]  ( Xm   / 2)
175
en  x̂n  xn
Quantization Error
 In most cases we can assume that e[n]
 is uniformly distributed random variable
 Is uncorrelated with the signal x[n]
e[n] is Gaussian white noise

 The variance of e[n] is then 2


2e 
12
 The signal-to-noise ratio SNR of e[n] for B+1 bits
X 
SNR  6.02 B  10.8  20 log10  m 
 x 
 SNR is proportional to the bitrate B

176
Derivation of e[n]:
Assume x[n] is
bipolar, i.e.,
varying in [-A A]

177
Measuring Quantizer
Performance
 Performance measure:
 how close the quantized signal (e.g., sound) to
the original signal to the human ears -
Perceptual Quality
 No objective measure correlates very well with
the perceptual quality
 Frequently used objective measure:
 mean square error (MSE) between original and
quantized samples or signal to noise ratio

178
Problems with uniform
quantization

 Only optimal for uniformly distributed signal


 Real audio signals (speech and music) are more
concentrated near zeros
 Human ear is more sensitive to quantization
errors at small values
 Solution: Using non-uniform quantization
 quantization interval is smaller near zero

179
Quantizer & coder

180
Xm signal range
Quantizer & coder
Two’s Complement Numbers

 Representation for signed numbers in computers


 Integer two’s-complement  a0 2B  a12B 1  ...  aB 20
 Fractional two’s-complement  a0 20  a121  ...  aB 2B
 Example B+1=3 bit two’s-complement numbers

-a022+ a121+ a220 -a020+ a12-1+ a22-2


Binary Symbol Numerical Value Binary Symbol Numerical Value

011 3 0.11 3/4


010 2 0.10 2/4
001 1 0.01 1/4
000 0 0.00 0
111 -1 1.11 -1/4
110 -2 1.10 -2/4
101 -3 1.01 -3/4
181 100 -4 1.00 -4/4
Example

182
Outline
 Introduction
 Filters for sampling
 Representation of a CT Signal by Its Samples: Sampling
 The Effect of Under-sampling: Aliasing
o Sampling with Zero-Order Hold
o Reconstruction of a Signal from Its Samples: Interpolation
o Examples
o Discrete-Time Processing of Continuous-Time Signals
o Sampling of Discrete-Time Signals
o A/D and D/A Conversion
o Summary

183
Summary

 The information carried by a signal can be defined either in


terms of its Time Domain pattern or its Frequency Domain
spectrum
 The amount of information in a continuous analog signal x(t)
can be specified by a finite number of values: samples x[n]
 The Sampling Theorem states that we can collect all the
information in a signal by sampling at a rate 2xωm, where ωm
is the signal bandwidth of x(t)
 We can, therefore, reconstruct the actual shape of the
original continuous signal at any instant ‘in between’ the
sampled instants
 This reconstruction is not a guess but a true
reconstruction

184
Summary

 The FT of a DT signal is a function of the continuous variable ω, and it


is periodic with period 2π
 Given a value of ω, the FT gives back a complex number that can be
interpreted as magnitude and phase (translation in time) of the
sinusoidal component at that frequency ω
 Sampling is a multiplication with a periodic impulse train
 FT of sampled signal: original FT + shifted versions at multiples of ωs
 Sampling the CT signal x(t) with interval T, we get the DT signal
x[n]=x[nT] which is a function of the discrete variable n
 Sampling a CT signal with sampling rate fs produces a DT signal whose
FT is the periodic replication of the original signal, and the replication
period is Ts
 The Fourier variable ω for functions of discrete variable is converted
into the frequency variable f (in Hertz) by means of f=ω/(2πT)

185
Summary
 A-to-D converters convert CT signals into sequences with discrete
sample values
 Operates with the use of sampling and quantization
 D-to-A converters convert sequences with discrete sample values
into continuous-time signals
 Analyzed as conversion to impulse train followed by reconstruction
filtering
 Zero-order hold is a simple but low performance filter
 Upsampling and downsampling allow for changes in the effective
sample rate of sequences
 Allows matching of sample rates of A-to-D, D-to-A, and digital
processor
 Analysis: downsampler/upsampler similar to A-to-D/D-to-A
 When performing a frequency-domain analysis of systems with
up/downsamplers, it is strongly recommended to carry out the
analysis in the z-domain until the last step
 Working directly in the ω domain can easily lead to errors

186
Summary: to know ..
 How the sampling is derived using the FT ..
 Lowpass filters for reconstruction ..
 The sampled signal spectrum contains the original spectrum and its
replicas (aliases) at kws, k=+/- 1,2,….
 We need a prefilter when sampling a signal
 To avoid aliasing
 The filter should be a lowpass filter with cutoff frequency at fs /2
 Sample-and-hold and linear interpolation
 Why the ideal interpolation filter is a lowpass filter with cutoff frequency
at fs/2
 The ideal interpolation kernel is the sinc function.
 Why to apply a pre-filter before sampling
 ….

187

You might also like