Lecture #9:
SAMPLING OF CT SIGNALS
Motivation:
- Some data acquisition inherently samples a CT signal, e.g., in image acquisition. Signal processing of a CT signal on a digital computer requires that the CT signal be sampled.
- One method of signal processing, recording, or transmission is to convert CT signals to digital signals, process, record, or transmit the digital signals, and then convert the processed digital signals to CT signals.
- Problems with aliasing of sampled signals — distortion.
- Opportunities with aliasing of sampled signals — stop action imaging
Outline:
- Examples of the use of sampling — digital image acquisition, digital audio
- Model of sampling — impulse modulation
- The CTFT of a sampled signal
- Recovering a bandlimited signal from its samples; the Sampling Theorem
- Effects of sampling above, at, or below the Nyquist rate
- Sampling sinusoidal time functions — under and over sampling
- Demonstration of effect of aliasing on audio signals
- Demonstration of stroboscopic illumination
- Sampling images
- Conclusion
I. EXAMPLES OF THE USE OF SAMPLING
Image acquisition — photographic emulsion
Photographic emulsions are generally made with photoreactive crystals of AgBr with grain size in the range 0.04-1.5 μm.
Image acquisition — CCD camera
CCD (charge coupled device) chips are the basis of digital cameras and displays. CCD chips are fabricated with VLSI technology. The phototransducer is a solid-state, back-biased diode whose current is sensitive to light intensity.
Photomicrograph of a CCD camera surface showing portions of 16 unit cells each with dimensions 13 × 11 μm. Each unit cell corresponds to a pixel. The chip has 500 × 582 pixels in an area of 10 × 9.3 mm.
Image acquisition — retina
The human retina contains photoreceptors (rods and cones) whose dimensions and spacings are of the order of 10 μm.
Image acquisition — conclusion
Therefore, for each of these image acquisition systems — photographic emulsion, CCD camera, and retina — the light striking the surface of the phototransducer is sampled at discrete points in space (pixels) to produce a discrete time image.
Digital audio — recording system
In a number of applications, analog audio signals (e.g., speech or music) are converted into digital signals and processed by DT systems and then converted back to analog audio. Applications include compact discs, digital audio tape, digital broadcasting, digital telephony, etc. A single channel of such a recording system is shown below. If stereo is recorded then there are two channels — one for the left and the other for the right channel — that are passed through a multiplexer which is typically interposed before the error correction block.
Digital audio — reproduction system
A single channel of a digital audio reproduction system is illustrated with a block diagram. The reproduction system input is the digital data from the recording medium or from the incoming transmitted data. The output of the reproductions system is designed to reproduce the originally recorded/transmitted audio signal.
Sample-and-hold circuit
In this lecture we are concerned only with the sampling of a CT signal to produce a sampled CT signal. Later we will discuss how to form a DT signal from the sampled CT signal. We will not describe how to form a digital signal which involves converting infinite precision numbers to finite precision numbers, a process called analog-to-digital conversion. A schematic diagram of a sample-and-hold circuit that produces samples of a CT signal is shown below.
Definition
Sampling a one-dimensional signal x(t) at t = nT where T is the sampling period yields the samples x(nT). Sampling a two dimensional signal f(x, y) at x = nδx and y = mδy yields the samples f(nδx,mδy).
Key issues
We shall consider the sampling of one-dimensional signals only. The issues are as follows.
- How should we model the sampling process?
- Under which conditions can you recover x(t) from x(nT)?
- How do you recover x(t) from x(nT) when these conditions are met?
- What happens when these conditions are not met?
II. MODEL OF SAMPLING — IMPULSE MODULATION
1/ Definition
Let x(t) be a continuous time function and let s(t) be a uniform impulse train of period T,
s
(
t
)
=
∑
n
δ
(
t
−
nT
)
s
(
t
)
=
∑
n
δ
(
t
−
nT
)
The sampled time function is
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
=
x
(
t
)
∑
n
δ
(
t
−
nT
)
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
=
x
(
t
)
∑
n
δ
(
t
−
nT
)
=
∑
n
x
(
t
)
δ
(
t
−
nT
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
=
∑
n
x
(
t
)
δ
(
t
−
nT
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
Multiplication of time functions is called modulation. Therefore, multiplication by an impulse train is called impulse modulation.
Therefore, we have
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
2/ The essence of sampling is captured by impulse modulation
Note that with impulse modulation, the sampled signal is represented as a sequence of impulses whose areas are the sample values, i.e.,
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
The only property of the impulses that have any consequences are their areas and these are the sample values. Hence, impulse modulation is an effective model of sampling; the sample values, and only the sample values, are preserved by impulse modulation.
3/ Physical samplers can be modeled with an impulse modulator and a filter
A sampler that produces rectangular pulses can be represented.
y
(
t
)
=
x
^
(
t
)
*
p
(
t
)
=
(
∑
n
x
(
nT
)
δ
(
t
−
nT
)
)
*
p
(
t
)
y
(
t
)
=
x
^
(
t
)
*
p
(
t
)
=
(
∑
n
x
(
nT
)
δ
(
t
−
nT
)
)
*
p
(
t
)
=
∑
n
x
(
nT
)
(
δ
(
t
−
nT
)
*
p
(
t
)
)
=
∑
n
x
(
nT
)
p
(
t
−
nT
)
.
=
∑
n
x
(
nT
)
(
δ
(
t
−
nT
)
*
p
(
t
)
)
=
∑
n
x
(
nT
)
p
(
t
−
nT
)
.
III. THE CTFT OF A SAMPLED SIGNAL
The condition for recovering x(t) from _x(t) is more readily seen in the frequency domain.
1/ Derivation
x
(
t
)
⟺
F
X
(
f
)
x
(
t
)
⟺
F
X
(
f
)
s
(
t
)
=
∑
n
δ
(
t
−
nT
)
⟺
F
S
(
f
)
=
1
T
∑
n
δ
(
f
−
n
T
)
s
(
t
)
=
∑
n
δ
(
t
−
nT
)
⟺
F
S
(
f
)
=
1
T
∑
n
δ
(
f
−
n
T
)
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
⟺
F
X
^
(
f
)
=
X
(
f
)
*
S
(
f
)
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
⟺
F
X
^
(
f
)
=
X
(
f
)
*
S
(
f
)
x
^
(
t
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
⟺
F
X
^
(
f
)
=
1
T
∑
n
X
(
f
−
n
T
)
x
^
(
t
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
⟺
F
X
^
(
f
)
=
1
T
∑
n
X
(
f
−
n
T
)
2/ Sampling Theorem
The Fourier transform of the sampled time function equals that of the unsampled time function repeated periodically at the sampling frequency fs = 1/T and scaled by 1 /T .
No overlap of lobes occurs for
1
T
−
W
>
W
⇒
1
T
=
f
s
>
2
W
1
T
−
W
>
W
⇒
1
T
=
f
s
>
2
W
Thus, if a band-limited time function, i.e.,
X
(
f
)
=
0
for
|
f
|
>
W
X
(
f
)
=
0
for
|
f
|
>
W
is sampled with a sampling frequency fs > 2W, then in principle the time function can be recovered perfectly from the samples. This is called the Sampling Theorem, and 2W is called the Nyquist sampling rate.
IV. RECOVERING A BANDLIMITED SIGNAL FROM ITS SAMPLES
1/ Frequency domain
X
(
f
)
=
X
^
(
f
)
H
(
f
)
X
(
f
)
=
X
^
(
f
)
H
(
f
)
2/ Frequency and time domain
3/ The impulse response of the ideal lowpass filter
4/ Interpolating the sampled time function with a sinc function
Since
X
(
f
)
=
X
^
(
f
)
H
(
f
)
⟺
F
x
(
t
)
=
x
^
(
t
)
*
h
(
t
)
X
(
f
)
=
X
^
(
f
)
H
(
f
)
⟺
F
x
(
t
)
=
x
^
(
t
)
*
h
(
t
)
we have
x
(
t
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
*
2
WT
(
sin
(
2
πWt
)
2
πWt
)
x
(
t
)
=
∑
n
x
(
nT
)
δ
(
t
−
nT
)
*
2
WT
(
sin
(
2
πWt
)
2
πWt
)
The convolution reproduces the sinc function every nT as follows
x
(
t
)
=
∑
n
x
(
nT
)
×
2
WT
(
sin
2
πW
(
t
−
nT
)
2
πW
(
t
−
nT
)
)
x
(
t
)
=
∑
n
x
(
nT
)
×
2
WT
(
sin
2
πW
(
t
−
nT
)
2
πW
(
t
−
nT
)
)
The interpolation is particularly simple to visualize when 1/T = 2W, i.e, when the sampling frequency equals the Nyquist rate,
x
(
t
)
=
∑
n
x
(
nT
)
×
(
sin
π
(
t
−
nT
T
)
π
(
t
−
nT
T
)
)
x
(
t
)
=
∑
n
x
(
nT
)
×
(
sin
π
(
t
−
nT
T
)
π
(
t
−
nT
T
)
)
For 1/T = 2W,
x
(
t
)
=
∑
n
x
(
nT
)
×
(
sin
π
(
t
−
nT
T
)
π
(
t
−
nT
T
)
)
x
(
t
)
=
∑
n
x
(
nT
)
×
(
sin
π
(
t
−
nT
T
)
π
(
t
−
nT
T
)
)
we can sketch the interpolation simply.
V. EFFECTS OF SAMPLING ABOVE, AT, AND BELOW THE NYQUIST RATE
1/ Effect of varying the sampling rate
2/ Aliasing and truncation
In general, if x(t) is sampled below the Nyquist rate
1
T
<
2
W
1
T
<
2
W
x(t) cannot be recovered from its samples. Two types of errors occur — aliasing in which a high frequency component of the signal appears (under an alias) at a lower frequency, and truncation in which high frequency components of the signal are filtered out.
Two-minute miniquiz problem
Problem 19-1 — Design of a digital audio system
Human hearing extends over the approximate frequency range 20Hz to 20KHz. Therefore, it is proposed to design a digital audio music reproduction system whose front end is as shown.
The sample-and-hold circuit samples the music at 40 kHz which is twice the rate required to reproduce audible sounds. What is wrong with this system? How should this system be improved?
Solution
The problem with this system is that sounds above 20 kHz will be aliased down to a lower frequency and will distort the reproduced music. The solution is to include an anti-aliasing filter, located before the sample-and-hold system, that sharply attenuates sounds above 20 kHz.
VI. SAMPLING SINUSOIDAL TIME FUNCTIONS
To illustrate what happens when sampling above, at, and below the Nyquist rate, we investigate sampling a sinusoid.
If x(t) = cos(2πWt),
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
x
^
(
t
)
=
x
(
t
)
×
s
(
t
)
x
^
(
t
)
=
cos
(
2
πWt
)
×
∑
n
=
-
∞
∞
δ
(
t
−
nT
)
.
x
^
(
t
)
=
cos
(
2
πWt
)
×
∑
n
=
-
∞
∞
δ
(
t
−
nT
)
.
X
^
(
f
)
=
X
(
f
)
*
S
(
f
)
X
^
(
f
)
=
X
(
f
)
*
S
(
f
)
X
^
(
f
)
=
1
2
(
δ
(
f
+
W
)
+
δ
(
f
−
W
)
)
*
1
T
∑
n
=
-
∞
∞
δ
(
f
−
n
T
)
X
^
(
f
)
=
1
2
(
δ
(
f
+
W
)
+
δ
(
f
−
W
)
)
*
1
T
∑
n
=
-
∞
∞
δ
(
f
−
n
T
)
Therefore, the Fourier transform contains lots of impulses, and is best examined graphically.
1/ Sampling above the Nyquist rate — over sampling
In this example fs = 1/T = 8W, i.e., there are eight samples per period of the cosine wave.
If the sampled signal is passed through an ideal lowpass filter with cut-off frequency just above W, which is the frequency of the cosine, then the spectrum of the original cosine wave is recovered completely.
Because the spectrum of the original cosine wave is recovered completely so is the time function.
2/ Sampling at the Nyquist rate
In this example fs = 2W, i.e., there are two samples per period of the cosine wave. The cosine wave is sampled at the Nyquist rate.
If the sampled signal is passed through an ideal lowpass filter with cut-off frequency just above W, which is the frequency of the cosine wave, then the original cosine wave is again recovered completely from its samples.
In this example fs = 2W, but a sine wave rather than a cosine wave is sampled at the Nyquist rate, i.e., x(t) = sin(2πWt).
The sinusoid is sampled at the zero crossings — both the time function and its Fourier transform are zero. The sinusoid cannot be recovered from its samples.
Thus, sampling exactly at the Nyquist rate does not always lead to recovery of the original signal, and recovery depends upon the phase of the sinusoid. To understand this, we sample x(t)=Acos(2πWt+θ) at the Nyquist rate.
For x(t) = Acos(2πWt + θ), y(t) = (Acos θ) cos(2πWt). Thus, there is an ambiguity in the amplitude and the original phase of the cosinusoid is lost.
In general, sampling at, as opposed to above, the Nyquist rate will not lead to recovery of the original signal from its samples.
3/ Sampling below the Nyquist rate — undersampling
In this example fs = (3/2)W and x(t) = sin(2πWt).
If the sampled signal is passed through an ideal lowpass filter with cut-off frequency just above W, then y(t) = sin(2πWt) − sin(2π(W/2)t). The second term is the sine wave aliased to the frequency of W/2.
The time waveforms when undersampling with fs = (3/2)W and with an ideal lowpass filter with cut-off frequency just above W results in the waveforms shown below. x(t) = sin(2πWt) and y(t) = sin(2πWt) − sin(2π(W/2)t).
If the sampled signal is passed through an ideal lowpass filter with cut-off frequency just above W/2, then y(t) = −sin(2π(W/2)t), i.e., the undersampled sine wave has been reduced in frequency from W to W/2.
The original signal, x(t) = sin(2πWt), and the sampled and filtered signal, y(t) = −sin(2π(W/2)t), are compared below.
The dark points show the locations of samples of x(t) = sin(2πWt) which is sampled at fs = (3/2)W. The sampled signal is passed through an ideal lowpass filter whose cut-off frequency is just above W/2 to yield y(t) = −sin(2π(W/2)t).
VII. DEMONSTRATIONS
1/ The effect of sampling on sinusoidal audio signals
2/ The effect of sampling and quantization on audio signals
3/ Quantization
To transfer a CT signal into a computer, the CT signal must be sampled and quantized. Quantization converts a sample whose amplitude is specified with infinite precision into a number with limited precision. The transfer function of the quantizer is shown for quantizers of different precision specified by the number of bits. The A/D and D/A converter in this demonstration has 14 bit precision.
The difference between the original signal and the quantized signal constitutes an error. The error decreases as the number of quantization levels is increased.
4/ Stroboscopic illumination of a fan
The sampled time function appears as if θ(t) is increasing so that motion of the fan appears clockwise.
The sampled time function appears as if θ(t) is decreasing so that motion of the fan appears counterclockwise.
5/ Effect of sampling on images
We examine sampling of images using a MATLAB software package that allows display of images, sampled images, reconstructed images both with and without anti-alias filtering.
The image on the left has been sampled by keeping every 4th pixel to produce the sampled image on the right.
The sampled image has been reconstructed with a zero-order hold (staircase approximation) on the left and a first-order hold (linear interpolation) on the right.
The original image is shown on the left and the same image passed through an anti-alias filter appropriate to sampling every 4th point is shown on the right.
The effect of the anti-aliasing filter is seen by comparing the reconstructed filter without anti-alias filtering (left) with that using an anti-alias filter (right) both using a first-order hold (linear interpolation).
VI. CONCLUSIONS
The central idea in sampling a CT signal is the Sampling Theorem and its consequences.
- Let x(t) be a bandlimited time function, i.e., X(f) = 0 for |f| > |W|. Let x(t) be sampled at a sampling frequency fs > 2W, where 2W is called the Nyquist rate. Then x(t) can, in principle, be completely recovered from the samples.
- x(t) can be recovered bypassing the sampled signal through an ideal LPF with cutoff frequency at f = W.
- The recovery of x(t) is equivalent to interpolating the samples of x(t) with a sinc function which is the inverse Fourier transform of the ideal LPF.