AAU/AAIT
CENTER OF BIOMEDICAL ENGINEERING
DIGITAL SIGNAL PROCESSING
Chapter 2:
Sampling and Reconstruction of Continuous-
Time Signals
Introduction
to Digital Signal Processing (DSP)
What is Digital Signal Processing (DSP)?
• Digital: Operating by the use of discrete signals to represent
data in the form of numbers.
• Signal: A parameter (Electrical quantity or effect) that can
be varied in such a way as to convey information.
• Processing: A series operations performed according to
programmed instructions.
➢ Changing or analyzing information which is measured as
discrete sequences of numbers.
Application of DSP-Biomedical
➢ Biomedical: Analysis of biomedical signals, diagnosis, patient
monitoring, preventive health care, artificial organs.
Examples:
1. Electrocardiogram (ECG) signal-provides doctor
with information about the condition of the
patient heart.
2. Electroencephalogram (EEG) signals- provides
information about the activity of the brain
Cont…
➢ Speech Applications
Examples:
1. Noise reduction-reducing background noise in the sequence
produced by a sensing device (Microphone)
2. Speech recognition-differentiating between various speech
sounds.
3. Synthesis of artificial speech- text to speech system for blind.
Cont…
➢ Image Processing
1. Content based image retrieval- browsing, searching and
retrieving images from database.
2. Image enhancement
3. Compression- reducing the redundancy in the image data
to optimize transmission/storage
DSP Implementation
➢ To Implement DSP we must be able to
1) Perform Numerical operations including for example
additions, multiplications, data transfers and logical
operations
✓ Either using computer or special-purpose hardware
• DSP chip- a programmable device with its own native
instruction code.
• Designed specifically to meet numerically-intensive
requirements of DSP.
Cont…
➢ To Implement DSP we must be able to
2) Convert analog signals into the digital information
✓ sampling & involves analog-to-digital conversion
e.g: touchtone system of telephone dialing (when button is
pushed two sinusoid signals are generated (tones) and
transmitted, a digital system determines the frequencies and
uniquely identifies the button – digital (1 to 12) output.
Cont…
➢ To Implement DSP we must be able to
3) Convert the digital information, after being processed back
to an analog signal
✓ involves digital to analog conversion & reconstruction
e.g: text-to-speech signal (characters are used to generated
artificial sound).
Cont…
➢ To Implement DSP we must be able to
✓ Perform both A/D and D/A Conversions
e.g: digital recording and playback of music (Signal is sensed
by microphones, amplified, converted to digital, processed,
and converted back to analog to be played.
Limitations of DSP
Most signal are analog in nature and have to be sampled
✓ Loss of information: We only take samples of signals at
intervals and don’t know what happens in between.
✓ Aliasing: Can’t distinguish between higher and lower
frequencies.
✓ Limited frequency resolution: We only take samples for a
limited period of time does not pick up “relatively” slow
changes.
❑ Sampling Theorem: to avoid aliasing sampling rate must be at
least twice the maximum frequency component (bandwidth) of
signal
Advantages of Digital over Analog Signal
Processing
Why we Still do it?
1)Digital system can be simply reprogrammed for other
applications/ported to different
hardware/duplicated(Reconfiguring Analog system means
hardware redesign, testing, verification)
2)DSP provides better control of accuracy requirements (Analog
system depends on strict components tolerance, response may
drift with temperature)
Cont…
3) Digital signals can be easily stored without deterioration
(Analog Signal are not easily transportable and often can’t be
processed offline)
4) More Sophisticated signal processing algorithms can
Implemented (Difficult to perform precise mathematical
operations in analog form)
Sampling and
Reconstruction
Sampling
• Sampling is the processes of converting continuous by taking
the “samples” at discrete-time intervals
✓ Sampling analog signals makes them discrete in time but
still continuous valued
✓ If done properly (Nyquist theorem is satisfied), sampling
does not introduce distortion
• Sampled values:
✓ The value of the function at the sampling points
Cont…
• Sampling interval:
✓ The time that separates sampling points (interval b/w
samples), Ts
✓ If the signal is slowly varying, then fewer samples per second
will be required than if the waveform is rapidly varying
✓ So, the optimum sampling rate depends on the maximum
frequency component present in the signal.
• Sampling Rate (or sampling frequency fs): The rate at which
the signal is sampled, expressed as the number of samples per
second reciprocal of the sampling interval), 1/Ts = fs
Cont…
• Nyquist Sampling Theorem (or Nyquist Criterion): the
sampling is performed at a proper rate, no info is lost
about the original signal and it can be properly
reconstructed later on
Statement:
• “If a signal is sampled at a rate at least, but not exactly
equal twice the max frequency to component of the
waveform, then the waveform can be exactly reconstructed
from the samples without any distortion”
Periodic Sampling
• In this method x[n] obtained
from xc(t) according to the
relation :
x [n ] = x c (nT ) − n
T → sampling period f s = 1/T → sampling frequency
• The sampling operation is generally not invertible i.e.,
given the output x[n] it is not possible in general to
reconstruct xc(t). Although we remove this ambiguity by
restricting xc(t).
Sampling with a Periodic Impulse
Train
• Figure(a) is not a representation of
any physical circuits, but it is
convenient for gaining insight in both
the time and frequency domain.
+
s (t ) = (t − nT )
n =−
(a) Overall system
(b) xs(t) for two sampling rates
(c) Output for two sampling
rates
Chapter 4: Sampling of Continuous-Time Signals 18
Frequency Domain Representation
of Sampling
+
x s (t ) = x c (t )s (t ) = x c (t ) (t − nT ) (Modulation )
n =−
+
x s (t ) = x
n =−
c (nT ) (t − nT ) (Shifting property )
• Let us now consider the Fourier transform of xs(t):
• If s (t ) ⎯⎯→
Fourier
S ( j ) and x c (t ) ⎯⎯→
Fourier
X C ( j )
2
S ( j) =
T
( − k )
k = −
s where s = 2 / T is the sampling rate in radians/s.
1 1
X s ( j ) =
2
X c ( j )* S ( j ) =
T
X ( j ( − k ) )
k =−
c s
Chapter 4: Sampling of Continuous-Time Signals 19
Frequency Domain Representation
of Sampling
• By applying the continuous-time Fourier transform to
equation +
x s (t ) = x c (nT ) (t − nT )
n =−
We obtain +
X S ( j ) =
n =−
x c (nT )e − j Tn
+
x [n ] = x c (nT ) and j
X (e ) =
n =−
x [n ]e − j n
consequently
j
X s ( j ) = X (e ) = X (e j T 1
) X (e ) = X c
j 2k
=T
j −
T k =− T T
Chapter 4: Sampling of Continuous-Time Signals 20
Exact Recovery of Continuous-Time
from Its Samples
• (a) represents a band
limited Fourier
transform of xc(t)
Whose highest nonzero
frequency is N .
• (b) represents a
periodic impulse train
with S frequency.
• (c) shows the output of
impulse modulator in
the case
S − N N S 2N
Chapter 4: Sampling of Continuous-Time Signals 21
Exact Recovery of Continuous-Time
from Its Samples
• In this case X C ( j )
don’t overlap
• therefore xc(t) can be
recovered from xs(t)
with an ideal low pass
filter H r ( j ) with gain
T and cutoff frequency
N C S − N
• It means X r ( j ) = X C ( j )
=
Chapter 4: Sampling of Continuous-Time Signals 22
Aliasing Distortion
• (a) represents a band
limited Fourier
transform of xc(t)
Whose highest nonzero
frequency is N .
• (b) represents a
periodic impulse train
with S frequency.
• (c) shows the output of
impulse modulator in
the case
S − N N S 2N
Chapter 4: Sampling of Continuous-Time Signals 23
Aliasing Distortion
• In this case the copies of X C ( j ) overlap and is not longer
recoverable by lowpass filtering therefore the reconstructed signal
is related to original continuous-time signal through a distortion
referred to as aliasing distortion.
Chapter 4: Sampling of Continuous-Time Signals 24
Example: The effect of aliasing in the
sampling of cosine signal
• Suppose x c (t ) = cos(0t )
Chapter 4: Sampling of Continuous-Time Signals 25
Nyquist Sampling Theorem
• Sampling theorem describes precisely how much information is
retained when a function is sampled, or whether a band-limited
function can be exactly reconstructed from its samples.
• Sampling Theorem: Suppose that x c (t ) X C ( j ) is band-limited
to a frequency interval −N , N , i.e., X ( j )
C
X C ( j ) = 0 for N
−N 0 N
Then xc(t) can be exactly reconstructed from equidistant samples
x [n ] = x c (nT s ) = x c (2 n / s ) s 2N
where Ts = 2 / s is the sampling period, f s = 1 / Ts is the sampling
frequency (samples/second), s = 2 / Ts is for radians/second.
Chapter 4: Sampling of Continuous-Time Signals 26
Oversampled
• Suppose that x c (t ) X C ( j ) is band-limited:
X C ()
A
0
−N N
• Then if T S is sufficiently small, X (e j
) appears as:
A X (e j )
Ts
−N T S N TS
− 2 −
0
2
• Condition: 2 − NTS N TS or N TS or S 2N
Chapter 4: Sampling of Continuous-Time Signals 27
Critically Sampled
Critically sampled: N TS = or S = 2N
A X (e j )
Ts
− 2 − 0 2
According to the Sampling Theorem, in general the signal cannot be
reconstructed from samples at the rate T S = / N .
This is because of errors will occur if X c (N ) 0 , the folded
frequencies will add at = .
Consider the case: x c (t ) = A sin(N t ) Aj ( − N ) − ( + N )
and note that for TS = / N .
x (nT s ) = A sin(c nT s ) = A sin(n ) = 0 (for all n )
Chapter 4: Sampling of Continuous-Time Signals 28
Undersampled (aliased)
If sampling theorem condition is not satisfied N TS or S 2N
A X (e j )
Ts
− 2 − 0 2
• The frequencies are folded - summed. This changes the shape of the
spectrum. There is no process whereby the added frequencies can be
discriminated - so the process is not reversible.
• Thus, the original (continuous) signal cannot be reconstructed exactly.
Information is lost, and false (alias) information is created.
Chapter 4: Sampling of Continuous-Time Signals 29
Reconstruction of a Band limited Signal
from Its Samples
• Figure(a) represents an ideal
reconstruction system.
• Ideal reconstruction filter has
the gain of T and cutoff
frequency c
N C S − N
we choice C = S / 2 = /T.
This choice is appropriate for
any relationship between S
and N .
Chapter 4: Sampling of Continuous-Time Signals 30
Reconstruction of a Bandlimited
Signal from Its Samples
• Therefore
+
x S (t ) = x [n ] (t − nT )
n =−
+
x r (t ) = x [n ]h (t − nT )
n =−
r
sin( t /T )
hr (t ) =
t /T
+
sin( (t − nT ) /T )
x r (t ) = x [n ]
n =− (t − nT ) /T
Chapter 4: Sampling of Continuous-Time Signals 31
Reconstruction of a Bandlimited
Signal from Its Samples
+
x r (t ) = x [n ]h (t − nT )
n =−
r
hr (0) = 1 x r (mT ) = x c (mT ) For all integer
values of m. independent from the
hr (nT ) = 0 n = 1, 2,...
sampling period T.
Therefore the resulting signal is an exact reconstruction of xc(t)
at the sampling times. the fact that, if there is no aliasing, the
low pass filter interpolates the correct reconstruction between
the samples, and if there is aliasing, it can’t interpolate them
correctly.
Chapter 4: Sampling of Continuous-Time Signals 32
Ideal D/C Converter
• The properties of the ideal D/C converter are most easily seen in the
frequency domain.
+ +
x r (t ) =
n =−
x [n ]hr (t − nT ) X r ( j ) =
n =−
x [n ]H r ( j )e − j Tn
+
X r ( j ) = H r ( j ) x [n ]e − j Tn
n =−
X r ( j ) = H r ( j )X (e j T )
Chapter 4: Sampling of Continuous-Time Signals 33