#### You've reached the end of your free preview.

Want to read all 22 pages?

**Unformatted text preview: **ECE3221 Digital Signal Processing
Sampling
Prof. Dr. Othman O. Khalifa
Electrical and Computer Engineering
Kulliyyah of Engineering
International Islamic University Malaysia Sampling
Def. A digital signal can be obtained
from an analogue signal by the
following steps:
1. Sampling
2. Quantization
3. Coding
The process of converting a
continuous-time signal to a sequence
of numbers is called Sampling. Event Name Basic ADC Analog to Digital Conversion
ADC is an acronym for Analog to Digital Converter which
converts the analog signal x(t) into the digital signal
sequence x(n). Analog-to-digital conversion or
Analog- todigitization consists of the sampling and quantization
processes. The sampling process depicts a
continuously varying analog signal as a sequence of
values. The quantization process approximates a
waveform by assigning an actual number for each
sample. An ADC consists of two fundamental blocks;
an ideal sampler and a quantizer.
A/D converter
Quantizer Ideal Sampler
x(t) Event Name x(nT) x(n) Analog to Digital Conversion
Analog-to-digital conversion carries out the following steps:
Analog- to1. The bandlimited signal x(t) is sampled at uniformly spaced
instants of time , nT, where n is a positive integer, and T is the
nT,
sampling period in seconds. This sampling process converts an
analog signal into a discrete-time signal, x(nT), with
discretex(nT),
continuous amplitude value.
2. The amplitude of each discrete-time sample is quantized
discreteinto one of the 2B levels, where B is the number of bits the
2B
ADC has to represent for each sample. The discrete amplitude
levels are represented (or encoded) into distinct binary words
x(n) with a fixed wordlength B. This binary sequence, x(n), is
x(n),
the digital signal for DSP hardware. Sampling Process
Use A-to-D converters to turn x(t) into numbers
x[n]
Take a sample every sampling period Ts – uniform
sampling
Continuous- x(t) time to
Discrete-time x[n] x[n]=x(nTs) fs=2 kHz
f=100 Hz
fs=500 Hz Event Name Sampling Theorem
Bridge between continuous-time and discrete-time
continuousdiscreteTell us HOW OFTEN WE MUST SAMPLE in order not to loose any
information Sampling Theorem
A continuous-time signal x(t) with frequencies no higher than
fmax (Hz) 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.
For example, the sinewave on previous slide is 100 Hz. We need to
sample this at higher than 200 Hz (i.e. 200 samples per second) in order
NOT to loose any data, i.e. to be able to reconstruct the 100 Hz sinewave
exactly.
fmax refers to the maximum frequency component in the signal that has
has
significant energy.
Consequence of violating sampling theorem is corruption of the signal
signal
in digital form. Whose theorem is this ?
The sampling theorem is usually known as the Shannon
Sampling Theorem due to Claude E. Shannon’s paper “A
mathematical theory of communciation” in 1948. The
minimum required sampling rate fs (i.e. 2xB) is known as
the Nyquist sampling rate or Nyquist frequency because of H.
Nyquist’s work on telegraph transmission in 1924 with K.
Küpfmüller.
The first formulation of the sampling theorem precisely and
applied it to communication is probably a Russian scientist
by the name of V. A. Kotelnikov in 1933.
However, mathematician already knew about this in a
different form and called this the interpolation formula. E.
T. Whittaker published the paper “On the functions which
are represented by the expansions of the interpolation
theory” back in 1915! Event Name Whose theorem is this ?...
The discovery of the sampling theorem is attributed
to Harry Nyquist and Claude Shannon. In 1928,
Nyquist referenced the existence of the theorem in his
paper, "Certain Topics in Telegraph Transmission
Theory," but he did not explicitly explore it. It
remains a mystery why Nyquist is considered one of
the founders of the principal, except for the fact that
the company he worked for--Bell Labs--referred to
the concept as the Nyquist Sampling Theorem in
their texts. In 1949, credit for the theorem was also
given to Shannon, a mathematical engineer, based on
the results outlined in his published work,
"Communication in the Presence of Noise." This
altered the official name to the Nyquist-Shannon
Sampling Theorem. This stick even though other
scientists--including E. T. Whittaker and V. A.
Kotelnikov--had published similar findings in 1915
and 1933 respectively. Sampling
An ideal sampler can be considered as a switch that is, it
is periodically open and closed every T seconds which is
expressed as:
T = f1s x[n] = xa (t ) t = nT = xa (nT ) xa(t) x[n] where fs is the sampling frequency (or sampling rate) in
hertz (Hz, or cycles per second). Event Name Sampling …
In order to represent an analog signal x(t) by a
x(t)
discrete-time signal x(nT) accurately, the following
discretex(nT)
conditions must be met: fs ≥ 2 fM − Shannon’s sampling theorem 1. The analog signal, x(t), must be bandlimited by
x(t)
the bandwidth of the signal fM 2. The sampling frequency, fs, must be at least
twice the maximum frequency component fM in the
analog signal x(t). That is,
x(t). Sampling …
Shannon’s Sampling Theorem: This states that when
Shannon’
the sampling frequency is greater than twice the
highest frequency component contained in the analog
signal, the original signal x(t) can be perfectly
reconstructed from the discrete signal x(nT).
nT).
The minimum sampling frequency fs=2fM is the
fs=
Nyquist rate while fN= fs / 2 is the Nyquist frequency
fN=
(or folding frequency). The frequency interval [−fs / 2,
[−
fs / 2] is called the Nyquist interval.
When an analog signal is sampled at sampling
frequency, fs, frequency components higher than fs / 2
fs,
fold back into the sampling range [0, fs / 2]. This
[0
undesired effect is known as aliasing. An anti-aliasing
antifilter is an analog lowpass filter with the cut-off
cutfrequency of
f
fc ≤ s
2 Event Name Sampling
The intermediate signal, x(nT), is a discrete-time
nT),
discretesignal with a continuous value (a number has infinite
precision) at discrete time nT, n = 0, 1, …, ∞ as
nT,
illustrated in the figure below. The signal x(nT) is an
nT)
impulse train with values equal to the amplitude of x(t)
at time nT. The analog input signal x(t) is continuous in
nT.
both time and amplitude while the sampled signal x(nT)
nT)
is continuous in amplitude, but defined only at discrete
points in time. Thus the signal is zero except at
sampling instants t = nT.
nT.
x(nT) 0 T 2T 3T Time, t 4T Impulse Sampling
Sampled waveform Signal waveform 0
0
1 201 1 201 Impulse sampler 0
1 Event Name 201 Sampling proof
Consider a
bandlimited signal
x(t) and is
x(t)
spectrum X(ω):
X(ω Ideal sampling =
multiply x(t) with
x(t)
impulse train:
train: * Therefore the
sampled signal
has a spectrum: Sampling proof …
Therefore, to reconstruct the original signal
x(t), we can use an ideal lowpass filter on the
sampled spectrum: This is only possible if the shaded parts do
not overlap. This means that fs must be more
than TWICE that of B. Event Name Sampling Theorem: Mathematical proof
The sampled version can be expressed as: x(t ) = x(t )δTs (t ) = ∑ x(nT )δ (t − nTs ) n
We can express the impulse train as a Fourier series: δ T (t ) = T1 [1 + 2 cos ωs t + 2 cos 2ω s t + ....] where ω s = Therefore:
s s 2π
Ts x(t )δ Ts (t ) = T1s [ x(t ) + 2 x(t ) cos ωs t + 2 x(t ) cos 2ω s t + ....]
Since 2 x(t ) cos ω s t
X (ω ) = ⇔
1
Ts X (ω − ω s ) + X (ω + ω s ) ∞ ∑ X (ω − nω ) n = −∞ s Which is essentially the spectrum shown in the previous slide. What happens if we sample too slowly?
What are the effects of sampling a signal at,
above, and below the Nyquist rate? Consider a
signal bandlimited to 5Hz: Sampling at Nyquist rate of 10Hz give: Event Name What happens if we sample too slowly?
Sampling at higher than Nyquist rate at 20Hz
makes reconstruction much easier. Sampling below Nyquist rate at 5Hz corrupts
the signal.
ALIASING Anti-aliasing filter
Anti-aliasing filter
To prevent aliasing effect
A low-pass analog filter with cut-off
frequency less than half of sampling
frequency
Pre-filtering to ensure all frequency
components outside band-limited
signal sufficiently attenuated Event Name Anti-aliasing filter ,,,,
To avoid corruption of signal after sampling, one must ensure that
that
the signal being sampled at fs is bandlimited to a frequency B,
where B < fs/2.
Consider this signal spectrum:
After sampling: After reconstruction: Nyquist Sampling & Aliasing
Given a sequence
of number
representing a
sinusoidal signal,
the original
waveform of the
signal
(continuous-time
signal) cannot be
determined
Ambiguity caused
by spectral
replicating effect of
sampling Event Name Practical Sampling
Impulse train is not a very practical sampling
signal. Let us consider a train of pulses pT(t) of
pulse width t=0.025 sec. * Ideal Signal Reconstruction
Use ideal lowpass filter: That’s why the sinc function is also known as the interpolation
That’
function: Event Name Practical Signal Reconstruction
Ideal reconstruction system is therefore: In practice, we normally sample at higher frequency
than Nyquist rate: Example of sample and
hold Event Name Example 1 :
If the analog signal is in the form of :
xa[t] = 3cos(1000πt-0.1π)- 2cos(1500πt+0.6π) +
5cos(2500πt+0.2π)
Determine the signal bandwidth and how fast
to sample the signal without losing data ? Solution :
1. There are 3 frequencies components in the signal which is w1 = 1000π, w2 = 1500π, w3 = 2500π
1000π
1500π
2500π
2. The Input frequencies are :
F1 = w1 / 2π = 500 Hz, F2 = w2 / 2π = 750 Hz, F3 = w3 / 2π =1250 Hz
2π
2π
2π
3. Thus the Bandwidth Input signal is :
fmax = 1250 Hz or 1.25 kHz
4. Thus the signal should be sampled at
frequency more than twice the Bandwidth
Input Frequency,
F T > 2 fm
Thus the signal should be sampled at 2.5 kHz
in order to not lose the data. In other words, we need
more than 2500 samples per seconds in order to not lose the data Event Name Example 2 : The input continuous signal which have frequency of 2kHz enter
the DTS system and being sampled at every 0.1ms. Calculate the
digital and normalized frequency of the signal in Hz and rad.
rad. Solution :
1. Calculate the Sampling Rate :
FT = 1 / T = 1 / (0.1ms) = 10 kHz.
2. Now, calculate the digital frequency.
f = F / FT = 2 kHz / 10 kHz = 0.2
3. The digital frequency in radian,
ω = 2πf = 2π (0.2) = 0.4π rad.
4. The normalized digital frequency in radian,
ω = ΩT = 2πFT = 2π(2kHz)(0.1ms) = 0.4. Event Name Example :
The analog signal that enters the DTS is in the form of :
xa[t] = 3cos(50πt) + 10sin(300πt) - cos(100πt)
[t] 3cos(50π
10sin(300π
cos(100π
a. Determine the input signal bandwidth.
b. Determine the Nyquist rate for the signal.
c. Determine the minimum sampling rate required to
avoid aliasing.
d. Determine the digital (discrete) frequency after
being sampled at sampling rate determined from c.
e. Determine the discrete signal obtained after DTS. Solutions :
a. The frequencies existing in the signals are :
F1 = w1 / 2π = 50π / 2π = 25 Hz.
2π
50π 2π
π
F2 = w2 / 2π = 300π / 2π = 150 Hz.
2
300π 2π
F3 = w3 / 2π = 100π / 2π = 50 Hz.
2π
100π 2π
f m = Maximum input frequency = 150 Hz.
Hz.
b. The Nyquist rate is defined as :
2 f m = f T = 2(150 Hz) = 300 Hz.
Hz.
c. The minimum sampling rate required to avoid aliasing is
f T ≥ 2 f m = 300 Hz.
Hz.
d. f1 = F1 / FT = 25 Hz / 300 Hz = 1/12
f2 = F2 / FT = 150 Hz / 300 Hz = 1/2
f3 = F3 / FT = 50 Hz / 300 Hz = 1/6
e. The discrete signal after DTS is :
x[n] = xa[nTs] = 3cos[2πn(1/12)] + 10sin[2πn(1/2)]- cos[2πn(1/6)]
3cos[2π
10sin[2π (1/2)]- cos[2π Event Name Quantizing and Encoding
The fundamental distinction between discrete-time
discretesignal processing and DSP is the wordlength. The
former assumes that discrete-time signals values x(nT)
discretenT)
have infinite wordlength while the latter assumes that
digital signal values x(n) only have a limited B-bit.
The quantizing and encoding process is a method of
representing the sampled discrete-time signal x(nT) as
discretenT)
a binary number that can be processed with DSP
hardware. To process or store the discrete-time signal
discretewith DSP hardware, the signal must be quantized to a
digital signal x(n) with a finite number of bits. If the
wordlength of an ADC is B bits, there are 2B different
2B
values (levels) that can be used to represent a sample.
Quantization is therefore a process that represents
an analog-valued sample x(nT) with its nearest level
analognT)
that correspnds to the digital signal x(n). Quantizer (Quantization)
The real-valued signal has to be stored as a code for
realdigital processing. This step is called quantization.
quantization. ˆ
x[n] = Q( x[n]) Event Name Quantizer (Quantization) Quantizer (Quantization)
In general, if we have a (B+1)-bit binary two’s
(B+1)two’
complement fraction of the form: a0◊ a1a2 ...aB then its value is − a0 20 + a1 2 −1 + a2 2 −2 + ... + aB 2 − B The step size of the quantizer is Δ = 2 X m / 2 B +1 = X m / 2 B
where Xm is the full scale level of the A/D converter.
The numerical relationship beween the code words and
the quantizer samples is ˆ
ˆ
x[n] = X m xB [n] Event Name Example of quantization Analysis of quantization errors ˆ
e[n] = x[n] − x[n]
Quantization error
In general, for a quantizer with step size Δ, the
quantization error satisfies that
when − Δ / 2 < e[n] ≤ Δ / 2 (− X m − Δ / 2) < x[n] ≤ ( X m − Δ / 2) If x[n] is outside this range, then the quantization
x[n]
error is larger in magnitude than Δ/2, and such
samples are saided to be clipped.
clipped. Event Name Analysis of quantization errors
Analyzing the quantization by introducing an error
source and linearizing the system: The model is equivalent to quantizer if we know e[n].
e[n]. Example of quantization error original signal 3-bit quantization result 3-bit quantization error Event Name Example of quantization error 8-bit quantization error In a heuristic sense, the assumptions of the statistical
model appear to be valid if the signal is sufficiently
complex and the quantization steps are sufficiently
small, so that the amplitude of the signal is likely to
traverse many quantization steps from sample to
sample. Quantization Noise Event Name Quantization error analysis
The mean value of e[n] is zero, and its variance is
e[n] σ =
2
e Δ/2 ∫ e2 −Δ / 2 Since Δ= Δ2
1
de =
Δ
12 Xm
2B For a (B+1)-bit quantizer with full-scale value Xm, the
(B+1)fullnoise variance, or power, is σ e2 = 2
2 −2 B X m
12 Quantization error analysis
A common measure of the amount of degradation of a
signal by additive noise is the signal-to-noise ratio (SNR),
signal- to(SNR),
defined as the ratio of signal variance (power) to noise
variance. Expressed in decibels (dB), the SNR of a (B+1)(B+1)bit quantizer is
2
⎛σ 2 ⎞
⎛ 12 ⋅ 2 2 B σ x ⎞
⎟
SNR = 10 log10 ⎜ x ⎟ = 10 log10 ⎜
2
⎜σ 2 ⎟
⎜
⎟
Xm
⎝ e⎠
⎝
⎠
⎛X ⎞
= 6.02 B + 10.8 − 20 log10 ⎜ m ⎟
⎜σ ⎟
⎝ x ⎠ Hence, the SNR increases approximately 6dB for each bit
added to the world length of the quantized samples. Event Name ...

View
Full Document

- Summer '10
- ProfOthmanOKhalifa
- Digital Signal Processing, Signal Processing, sampling rate