Sampling
• In DSP, sampling is the reduction of a continuous signal to
a discrete signal.
• A common example is the conversion of a sound wave (a
continuous signal) to a sequence of samples (a discrete-time
signal).
• A sample refers to a value or set of values at a point in time
and/or space.
• A sampler is a subsystem or operation that extracts samples
from a continuous signal.
• A theoretical ideal sampler produces samples equivalent to
the instantaneous value of the continuous signal at the
desired points.
Periodic Sampling
Periodic Sampling
Two
Motivation
• Signals are time-continuous in nature;
• DSP: processing of digital signals
• How to convert analog signals to digital
ones?
Motivation (contd.)
• The sampling process should not yield any loss of
the information.
• In other words, the original analog signal should be
reconstructed (restored) based on the time-discrete
sequence.
x(t ) x[n] x(nTs )
sampling
Analog Discrete-time
signal sequence
Motivation (contd.)
• The problem is how to choose the sampling
interval Ts so that the original analog signal
can be reconstructed.
x(t ) x[n] x(nTs )
sampling
Analog Discrete-time
signal sequence
Sampling
• The sampler takes a snapshot of the x(t) for
every Ts
x(t ) x[n] x(nTs )
Analog Discrete-time
signal sequence
Sampling of a sinusoid
• Given an analog sinusoid
x(t ) A cos(t )
• The discrete sequence after sampling is
x[n] x(nTs ) A cos(nTs ) A cos(ˆ n )
• ̂ is called the normalized radian frequency
f
ˆ Ts 2
fs
Sampling of a sinusoid
• What is the difference between x(t) and x[n]?
• Radian frequency has the unit of rad/sec;
• Normalized frequency has the unit of rad—
dimensionless quantity;
• X(t) is a continuous time function. x[n] is just a
number sequence carrying no information about the
sampling period.
x(t ) A cos(t )
x[n] x(nTs ) A cos(nTs ) A cos(ˆ n )
Sampling of a sinusoid
Sampling of a sinusoid
• With different sampling frequency, sampling
of an analog signal will different discrete
sequence
• Sampling of different analog signals may
yield the same discrete sequence
• Sampling frequency must be employed in
order to reconstruct the original analog signal
Shannon Sampling Theorem
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, which is called Nyquist
sampling rate (or frequency)
Aliasing distortion
• Aliasing refers to an effect that causes
different signals to become indistinguishable
(or aliases of one another) when sampled.
• It also refers to the distortion or artifact that
results when the signal reconstructed from
samples is different from the original
continuous signal.
Aliasing and Folding
• Aliasing:
• when the sampling rate is lower than the
Nyquist rate, the reconstruction is not possible
as the solution is not unique.
Aliasing and Folding
• Consider the following signals
x(t ) A cos(2f 0t ) and
y(t ) A cos(2 ( f 0 lf s )t ) and
w(t ) A cos(2 ( f 0 lf s )t )
• Sampling of above signals at the rate of fs will yield
the same discrete sequence
Aliasing and Folding
x[n] x(nTs ) A cos(2f 0 nTs )
Note: the frequency is f0
Aliasing and Folding
y[n ] y ( nTs ) A cos(2 ( f 0 lf s )nTs )
A cos(2f 0 nTs 2nl )
A cos(2f 0 nTs ) x[n ]
The frequency is f 0 lf s
Aliasing and Folding
w[n ] w(nTs ) A cos(2 ( f 0 lf s )nTs )
A cos( 2f 0 nTs 2nl )
A cos(2f 0 nTs ) x[n ]
The frequency is f 0 lf
Aliasing and Folding
• Hence x[n] might be the samples of the
following signals:
– A sinusoid with the frequency of f 0
– Sinusoids with frequencies f 0 lf
– Sinusoids with frequencies f 0 lf
• However, only one of the above is the
original signal
Aliasing and Folding
• Aliasing frequencies
f 0 lf f 0 lf
Where l is a positive or negative integer
aliasing
500Hz
Aliasing and Folding
• The way for signal reconstruction is to take
the sinusoid with the frequency less than half
of the sampling rate.
fs
2
• Wrong decision may be made if the following frequencies are within
the above range.
f 0 lf f 0 lf
Aliasing and Folding
• If we consider the frequency component
within the following range
1
[0, f s )
2
• All aliasing components are outside the
range, and hence correct signal
reconstruction is possible
Aliasing and Folding
However, if f s 2 f0 ( f s / 2) f 0
then
f 0 lf s
may also fall within the range [0,fs/2). So the signal restored will not
be the true original one.
Aliasing and Folding
• The way for determining the occurring of aliasing to
see if the following aliasing frequencies
f 0 lf s
fall within the range [0,fs/2). In other words if the
following conditions are met:
( f 0 / f s ) l 0.5
Spectrum View of Sampling:
Over-sampling
• Example
x(t ) A cos(2 (100)t )
sampled at rate of 1000Hz >>100Hz
x[n] A cos(2 (0.1)n )
the aliasing frequencies are
100 1000l 0.1 l
Normalized frequency
Spectrum View of Sampling:
Over-sampling (fs>>f0) aliasing
500Hz
Spectrum View of Sampling:
Over-sampling
• In the cases of over-sampling, the aliasing
frequencies are outside the range [0,0.5]
(normalized frequency) or [0,0.5fs].
• There is no overlap between the aliasing
frequencies and f0 . Hence it is possible to
reconstruct the original signal
Spectrum View of Sampling:
Under-sampling (fs<f0)
• We still consider a sinusoid
x(t ) A cos(2 (100)t )
sampled at rate of 80Hz
x[n] A cos(2 (1.25)n )
the aliasing frequencies are
100 80l or
1.25 l
Spectrum View of Sampling:
Under-sampling (fs<faliasing
0)
20Hz
Spectrum View of Sampling:
Under-sampling (fs=f0)
• We still consider the same sinusoid
x(t ) A cos(2 (100)t )
sampled at rate of 100Hz
x[n] A cos(2n )
the aliasing frequencies are
100 100l or
1 l
Spectrum View of Sampling:
Under-sampling (fs=faliasing
0)
Spectrum View of Sampling:
Under-sampling (f0 <fs<2f0)
• We still consider a sinusoid
x(t ) A cos(2 (100)t )
sampled at rate of 125Hz
x[n] A cos(2 (0.8)n )
the aliasing frequencies are
100 125l or
0.8 l
Spectrum View of Sampling:
Under-sampling (fs<faliasing
0)
25Hz
Signal Reconstruction
• In DSP, reconstruction usually means the
determination of an original continuous signal
from a sequence of equally spaced samples
(discrete time signal).
Interpolation
• In the mathematical field of numerical
analysis, interpolation is a method of
constructing new data points within the range
of a discrete set of known data points.
• In DSP, the term interpolation refers to the
process of converting a sampled digital signal
(such as a sampled audio signal) to a higher
sampling rate (Upsampling) using various
digital filtering techniques (e.g., convolution
with a frequency-limited impulse signal)
Interpolation (contd.)
Discrete-to-Continuous Conversion
y(n) y(t)
D-to-C
D-to-C conversion is implemented based on the principle of
interpolation:
y (t ) y[n] p(t nT )
n
s
p(t) is the characteristic pulse shape of the converter.
Discrete-to-Continuous Conversion
y (t ) y[n] p(t nT )
n
s
• choose an interpolation pulse p(t);
• shift the pulse by nTs,
n=…-3,-2,-1,0,1,2,3,…
• modify the amplitude of the shifted pulse
by y[n]
• add the modified pulses together to yield
the output
Discrete-to-Continuous Conversion
y (t ) y[n] p(t nT )
n
s
• The operation is equivalent to pass the discrete sequence through
a system with the impulse response of p(t)
Discrete-to-Continuous Conversion
• Interpolation pulses
Discrete-to-Continuous Conversion
• Zero-Order Hold Interpolation
1 1
1 Ts t Ts
p (t ) 2 2
0 otherwise
1 Rectangle pulse
t
1 1
Ts Ts
2 2
Spectrum of Product of sinusoids
Discrete-to-Continuous Conversion
• Linear Interpolation
t
1 Ts t Ts
p(t ) Ts
0 otherwise
Triangle pulse
1
t
Ts Ts
Spectrum of Product of sinusoids
Discrete-to-Continuous Conversion
• Parabolic Interpolation
Four parabolic segments (the
2nd order polynomial)
Duration 4Ts
Note: p( t ) 0 for t 0,Ts ,2Ts ,...
Discrete-to-Continuous Conversion
• Parabolic Interpolation
Discrete-to-Continuous Conversion
• None of the interpolation pulses give the
perfect reconstruction;
• The error can be reduced if small Ts is used
• Hence over-sampling helps to reconstruct the
signal
Discrete-to-Continuous Conversion
Discrete-to-Continuous Conversion
• Ideal band-limited interpolation: the following pulse shape will result
in perfect reconstruction:
Discrete-to-Continuous Conversion
• Ideal band-limited interpolation: the following pulse shape will result
in perfect reconstruction:
sin t
Ts
p(t ) sin c( t ) for t
Ts
t
Ts
Discrete-to-Continuous Conversion
Discrete-to-Continuous Conversion
y (t ) y[n] p(t nT )
n
s
• The operation is equivalent to pass the discrete sequence through
a system with the impulse response of p(t)
• system with sinc impulse response behaves as an ideal band-limited
filter
Discrete-to-Continuous Conversion
•
sin t
Ts
p(t ) for t
t
Ts
Fourier transform
1
fs
2
Ideal C-to-D Converter
• Mathematical Model for A-to-D
x[n] x(nTs )
FOURIER
TRANSFORM
of xs(t) ???
Periodic Impulse Train
2
p (t ) (t nTs ) ak e jk s t
s
Ts
n k
Ts / 2
1 jk s t 1 Fourier Series
ak
Ts ( t )e dt
Ts
Ts / 2
FT of Impulse Train
2
p(t ) (t nTs ) P( j ) ( k s )
n k Ts
2
s
Ts
Impulse Train Sampling
xs (t) x(t) (t nTs ) x(t) (t nTs )
n n
xs (t) x(nTs ) (t nTs )
n
Illustration of Sampling
x(t)
t
xs ( t ) x(nTs ) (t nTs )
n
x[n] x(nTs )
n
Sampling: Freq. Domain
ak e jk s t EXPECT
FREQUENCY
k SHIFTING !!!
p (t ) (t nTs ) ak e jk s t
n k
Frequency-Domain Analysis
xs (t) x(t) (t nTs ) x(nTs ) (t nTs )
n n
1 jk st 1 jk st
xs (t) x(t) e x(t)e
Ts
k Ts k
1
Xs ( j ) X( j( k s ))
Ts
k 2
s
Ts
Frequency-Domain Representation of
Sampling
“Typical”
bandlimited signal
1
Xs ( j ) X( j( k s ))
Ts
k
Aliasing Distortion
“Typical”
bandlimited signal
• If s < 2b , the copies of X(j) overlap, and we
have aliasing distortion.
Reconstruction of x(t)
xs (t) x(nTs ) (t nTs )
n
1
Xs ( j ) X( j( k s ))
Ts
k
Xr ( j ) Hr ( j )Xs ( j )
Reconstruction: Frequency-Domain
If s 2b , the copies of
H r ( j ) X ( j ) do not overlap, so
X r ( j ) H r ( j ) X s ( j )
Ideal Reconstruction Filter
Ts
Ts
Hr ( j )
0
Ts
sin T t hr (0) 1
hr (t)
s
Ts
t hr (nTs ) 0, n 1, 2,
Signal Reconstruction
xr (t) hr (t) xs (t) hr (t) x(nTs ) (t nTs )
n
xr (t) x(nTs )hr (t nTs )
n
sin T (t nTs )
xr (t) x(nTs )
s
n Ts
(t nTs )
Ideal bandlimited interpolation formula
Shannon Sampling Theorem
• “SINC” Interpolation is the ideal
– PERFECT RECONSTRUCTION
– of BANDLIMITED SIGNALS
Reconstruction in Time-Domain
Ideal C-to-D and D-to-C
sin T (t nTs )
xr (t) x[n]
s
x[n] x(nTs ) n Ts
(t nTs )
Ideal Sampler Ideal bandlimited interpolator
1 Xr ( j ) Hr ( j )Xs ( j )
Xs ( j ) X( j( k s ))
Ts
k
Summary and Exercise
Summary
• Sampling
• Reconstruction
Next
• System Analysis
Exercise
Solve examples # 4.2, 4.3
Digital Signal Processing, Lecture 9, Spring
2013