Sampling and Pulse Trains
◮ Sampling and interpolation
◮ Practical interpolation
◮ Pulse trains
◮ Analog multiplexing
Sampling Theorem
Sampling theorem: a signal g(t) with bandwidth B can be reconstructed
exactly from samples taken at any rate R > 2B.
Sampling can be achieved mathematically by multiplying by an impulse
train. The unit impulse train is defined by
∞
X
III(t) = δ(t − k)
n=−∞
The unit impulse train is also called the III or comb function.
Sampling a signal g(t) uniformly at intervals Ts yields
∞
X ∞
X
g(t) = g(t) IIITs (t) = g(t)δ(t − nTs ) = g(nTs )δ(t − nTs )
n=−∞ n=−∞
Only information about g(t) at the sample points is retained.
Fourier Transform of III(t)
Fact: the Fourier transform of III(t) is III(f ).
∞
X ∞
X ∞
X
F III(t) = Fδ(t − n) = e−j2πnf = ej2πnf = III(f )
n=−∞ n=−∞ n=−∞
The complex exponentials cancel at noninteger frequencies and add up to
an impulse at integer frequencies.
N = 10
25
20
15
10
−5
−5 −4 −3 −2 −1 0 1 2 3 4 5
N = 100
250
200
150
100
50
0
−5 −4 −3 −2 −1 0 1 2 3 4 5
Fourier Transform of Sampled Signal
The impulse train III(t/Ts ) is periodic with period Ts .
III(t/Ts ) can be represented as sum of complex exponentials of multiples of
the fundamental frequency:
∞
1 X j2πnfs t 1
III(t/Ts ) = e (fs = )
Ts n=−∞ Ts
Thus
∞
1 X
g = g(t) III(t/Ts ) = g(nTs )ej2πnfs t
Ts n=−∞
and by the frequency shifting property
∞
1 X
G(f ) = G(f − nfs )
Ts n=−∞
This sum of shifts of the spectrum can be written as III(f /fs ) ∗ G(f ).
Sampled Signal and Fourier Transform
Reconstruction from Uniform Samples (Ideal)
If sample rate 1/Ts is greater than 2B, shifted copies of spectrum do not
overlap, so low pass filtering recovers original signal.
Cutoff frequency of low pass filter should satisfy
B ≤ fc ≤ fs − B
Suppose fc = B. A low pass filter with gain Ts has transfer function and
impulse response
f
H(f ) = Ts Π , h(t) = 2BTs sinc(2πBt)
2B
Then if Ts = 1/2B
∞
X
h(t) ∗ g(t) = h(t) ∗ g(nTs )δ(t − nTs )
n=−∞
X∞
= g(nTs ) sinc(2πB(t − nTs ))
n=−∞
Ideal Interpolation
Ideal interpolation represents a signal as sum of shifted sincs.
Practical Interpolation
In practice we require a causal filter. We can delay the impulse response
and eliminate values at negative times.
(
h(t − t0 ) t > 0
h̃(t) =
0 t<0
0.5
−2 −1 0 1 2 3 4 5 6 7 8
1.5
0.5
0
−5 −4 −3 −2 −1 0 1 2 3 4 5
Practical Interpolation (cont.)
In practice, the sampled signal is a sum of pulses, not impulses.
∞
X
g̃(t) = g(nTs )p(t − nTs )
n=−∞
∞
X
= p(t) ∗ g(nTs )δ(t − nTs ) = p(t) ∗ g(t)
n=−∞
Practical Interpolation (cont.)
By the convolution theorem,
∞
1 X
G̃(f ) = P (f ) · G(f − nfs )
Ts n=−∞
We can recover G(f ) from G̃(f ) by low pass filtering to eliminate high
frequency shifts and equalizing by inverting P (f ).
(
Ts /P (f ) |f | < B
E(f ) =
0 |f | > B
The transfer function E(f ) should not be close to 0 in the pass band.
Practical Interpolation (cont.)
Example: rectangular pulses with Tp < Ts < 1/2B.
t − 0.5Tp
p(t) = Π =⇒ P (f ) = Tp sinc(πTp f )e−jπTp f
Tp
The transfer function for the equalizer should satisfy
Ts /P (f ) |f | < B
E(f ) = whatever B < |f | < 1/Ts − B
0 |f | > 1/Ts − B
To avoid large gain (and noise amplification), we need |P (f )| bounded
away from 0. If |Tp f | < 1 then
sinc(πTp f ) > 0
If Tp < 1/2B then P (f ) > sin(π/2)/(π/2) = 2/π.
The Treachery of Aliasing
If we sample too slowly, the shifted spectrums overlap.
High frequency components are “folded” back into the spectrum.
This should be avoided.
Example of Aliasing
cos 4πt sampled at 2 Hz looks like a constant.
1
0.8
0.6
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Anti-Aliasing Filter
Nonideal Practical Sampling
A real-world sampler cannot obtain the value of the signal at an instant.
The sampling circuit measures the signal by integration.
Z Tp
g1 (nTs ) = q(t)g(t − nTs ) dt
−Tp /2
Nonideal Practical Sampling (cont.)
The values obtained by averaging create a shaped impulse train:
∞
X
g̃(t) = g1 (nTs )δ(t − nTs )
n=−∞
Gating with a rectangle corresponds to transfer function
Ha (F ) = sinc(πTp f )
Thus
∞
X ∞
X
G1 (f ) = H(f ) Qn G(f − nfs ) = sinc(πTp f ) Qn G(f − nfs )
n=−∞ n=−∞
Nonideal Practical Sampling (cont.)
We can use the sampling theorem to obtain
∞
X
G̃(f ) = Fn (f )G1 (f + nfn )
n=−∞
where
∞
1 X
Fn (f ) = Qn sinc((πf + (ℓ + n)πfs )Tp )
Ts
ℓ=−∞
Low pass filtering g̃(t) yields distorted signal with transform F0 (f )G(f ).
Original signal can be recoverd by equalizer filter.
1/P (f )F0 (f ) |f | < B
E(f ) = flexible B < |f | < 1/Ts − B
0 |f | > 1/Ts − B
Pulse Modulation of Signals
◮ In many cases, bandwidth of communication link is much greater than
signal bandwidth.
◮ The signal can be transmitted using short pulses with low duty cycle:
◮ Pulse amplitude modulation: width fixed, amplitude varies
◮ Pulse width modulation: position fixed, width varies
◮ Pulse position modulation: width fixed, position varies
◮ All three methods can be used with time-division multiplexing to carry
multiple signals over a single channel
PAM, PWM, PPM: Amplitude, Width, Position
Pulse Amplitude Modulation
◮ The input to a pulse amplitude modulator is the real-world sample
of g(t):
Z Ts
g1 (nTs ) = q(t)g(t − nTs ) dt
0
where q(t) is an integrator function. (Width of q(t) should be ≪ Ts .)
◮ Each transmitted pulse is narrow with height (or area) proportional
to g1 (nTs ). The pulse is integrated to obtain an analog value.
Z Tp
g̃(nTs ) = q1 (t)g1 (t − nTs ) dt
0
where Tp ≪ Ts
◮ The original signal g(t) is reconstructed using an equalizer and a low
pass filter, as discussed above.
Pulse Width Modulation (PWM)
Pulse width modulation is also called pulse duration modulation (PDM).
PWM is more often used for control than for communication
◮ Motors
◮ LEDs: output limunosity is proportional to average current.
◮ Amplifiers
A signal can be recovered exactly from its PWM samples at rate 2B,
provided the bandwidth is ≤ 0.637B.
J. Huang, K. Padmanabhan, O. M. Collins, IEEE Trans. Circuits and Systems, 2011.
PWM (cont.)
PWM output can be generated by a sawtooth signal gating the input.
Below the pulse width varies from nearly 0 to 1/2 the pulse period.
0.5
−0.5
−1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.8
0.6
0.4
0.2
−0.2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Pulse Position Modulation (PPM)
The value of the signal determines the delay of the pulse from the clock.
Very common in home automation systems.
Microcontrollers can generate PPM (and PWM) in software. Doesn’t
require an D/A.
Many Arduinos use PWM to generate analog output waveforms.