SAMPLING THEOREM
SAMPLING THEOREM
DR TANIA STATHAKI
READER (ASSOCIATE PROFESSOR) IN SIGNAL PROCESSING
IMPERIAL COLLEGE LONDON
Continuous time versus discrete time
• Continuous time systems.
Good for analogue signals and general understanding of signals and systems.
Appropriate mostly to analogue electronic systems.
𝑥 𝑡 𝑥[𝑛] 𝑦𝑛 𝑦(𝑡)
Digital
A-to-D D-to-A
Signal Processing
Sampling
Sampling theorem
• Therefore,
1
𝑥 𝑡 = 𝑥(𝑡)𝛿𝑇𝑠 𝑡 = [𝑥(𝑡) + 2𝑥(𝑡)cos𝝎𝒔 𝑡 + 2𝑥(𝑡)cos𝟐𝝎𝒔 𝑡 + 2cos𝟑𝝎𝒔 𝑡 + ⋯ ]
𝑇𝑠
1
• Since the following holds: 𝑥 𝑡 cos𝜔𝑠 𝑡 ⇔ [𝑋 𝜔 + 𝜔𝑠 + 𝑋 𝜔 − 𝜔𝑠 ]
2
we have
1 ∞
𝑋 𝜔 = 𝑛=−∞ 𝑋 𝜔 − 𝑛𝜔𝑠
𝑇𝑠
Depiction of previous analysis
𝑋𝑠 (𝜔)
Reconstruction generic example cont.
• The signal 𝑥 𝑛𝑇𝑠 is convolved with a sinc function, which is the time
domain version of a rectangular pulse in frequency domain centred at
the origin.
𝑥 𝑛𝑇𝑠 ∗ sinc 𝑎𝑡 = 𝑛 𝑥[𝑛] sinc[𝑎(𝑡 − 𝑛𝑇𝑠 )]
𝑥 𝑛𝑇𝑠 sinc 𝑎𝑡
Example
• The filter we use for reconstruction must have gain 𝑇𝑠 and bandwidth of
any value between 𝐵 and (𝑓𝑠 − 𝐵)𝐻𝑧.
Example cont.
Undersampling: What happens if we sample too slowly?
• Sampling at lower than the Nyquist rate (in this case 5𝐻𝑧) makes
reconstruction impossible.
1
• The spectrum 𝑋 𝜔 consists of overlapping repetitions of 𝑋 𝜔
𝑇𝑠
repeating every 5𝐻𝑧.
• 𝑋(𝜔) is not recoverable from 𝑋 𝜔 .
• Sampling below the Nyquist rate corrupts the signal. This type of
distortion is called aliasing.
Aliasing
• Consider what happens when a 1𝐻𝑧 and a 6𝐻𝑧 sinewaves are sampled
at a rate of 5Hz.
• The 1𝐻𝑧 and 6𝐻𝑧 sinewaves are indistinguishable after sampling. The
two discrete signals produced are identical.
Aliasing cont.
• The two original signals are shown together with the sampled values. As
verified, the sampled values are not efficient to recover the original
shape of the high frequency signal (shown in blue).
Aliasing example (recall Signals and Systems Lab)
• Consider a signal bandlimited to 𝐵𝐻𝑧 with Fourier transform 𝑋(𝜔). The sampled
version of the signal 𝑥(𝑡) at a rate 𝑓𝑠 𝐻𝑧 can be expressed as the multiplication of the
original signal with an impulse train as follows:
𝑥 𝑡 = 𝑥 𝑡 𝛿𝑇𝑠 𝑡 = 𝑛 𝑥(𝑛𝑇𝑠 )𝛿(𝑡 − 𝑛𝑇𝑠 ), 𝑇𝑠 = 1/𝑓𝑠
• Assume that 𝑥 𝑡 = sin(2𝜋𝑓𝑡). Consider two frequencies 𝑓1 and 𝑓2 which satisfy the
condition −𝑓1 + 𝑓2 = 𝑓𝑠 . This happens in the previous example.
• We see that if 𝑓2 = 𝑓𝑠 +𝑓1 the two sinusoidals look the same after sampling.
Aliasing and the wagon wheel effect
𝑓
• If the original signal 𝑥(𝑡) is not bandlimited to 𝑠 , perfect reconstruction is
2
not possible when sampling at 𝑓𝑠 . However, the reconstructed signal 𝑥 (𝑡) is
the best bandlimited approximation to 𝑥(𝑡) in the least-square sense.
Practical sampling (Lathi page 778)
• The impulse train is not a very practical sampling signal.
• In practice we may use a train of pulses 𝑝𝑇 (𝑡) as the one shown below.
The pulse height is 𝐴 = 1, its width is 𝜏 = 0.025𝑠𝑒𝑐 and the period is
𝑇 = 0.1sec.
• We use the same signal as previously, i.e.,
𝑥 𝑡 = sinc 2 (5𝜋𝑡) with 𝑋 𝜔 = 0.2Δ(𝜔/20𝜋)
• For the train of pulses we use Fourier Series (Lathi, Chapter 6):
2 𝑛𝜋
𝑝𝑇𝑠 𝑡 = 𝐶0 + ∞ 𝑛=1 𝑛𝐶 cos𝑛𝜔 𝑠 𝑡 , 𝐶0 = 1/4, 𝐶𝑛 = sin( )
𝑛𝜋 4
1
• 𝑥 𝑡 = 𝑥 𝑡 𝑝𝑇𝑠 𝑡 = 𝑥𝑡 + 𝐶1 𝑥 𝑡 cos20𝜋𝑡 + 𝐶2 𝑥 𝑡 cos40𝜋𝑡 +
4
𝐶3 𝑥 𝑡 cos60𝜋𝑡 + ⋯
1 𝐶
• 𝑋 𝜔 = 𝑋 𝜔 + 𝟐𝝅{ 1 𝑋 𝜔 − 20𝜋 + 𝑋 𝜔 + 20𝜋 +
4 2
𝐶2 𝐶
𝑋 𝜔 − 40𝜋 + 𝑋 𝜔 + 40𝜋 + 3 𝑋 𝜔 − 60𝜋 + 𝑋 𝜔 + 60𝜋 + ⋯}
2 2
• Lowpass filter can be used to recover 𝑋 𝜔 .
Practical sampling cont.
𝑥 𝑡 = sinc 2 (5𝜋𝑡) 𝑋 𝜔 = 0.2Δ(𝜔/20𝜋)
×
Ideal signal reconstruction
1
• In the case of Nyquist sampling rate 𝑇𝑠 = . The above equation becomes:
2𝐵
𝑥 𝑡 = 𝑛 𝑥 𝑛𝑇𝑠 ℎ 𝑡 − 𝑛𝑇𝑠 = 𝑛𝑥 𝑛𝑇𝑠 sinc 2𝜋𝐵𝑡 − 𝑛𝜋
This is called the interpolation formula.
Ideal signal reconstruction cont.
• The disappointing truth is that any filter that has a frequency response
which is zero above a certain frequency is not realizable (Paley-Wiener
criterion; for more information look at Lathi, Chapter 7, equation 7.61).
• In order to store these samples we need to convert the real values 𝑥[𝑛]
into a format which fits the memory model of a computer.
• The process that maps the real line to a countable set is called
quantisation.
• In the example below the quantized image has been allocated a number
of intensity levels which is not large enough. Therefore, the quantized
image does not look “real” to the human eye; instead it looks like a
segmented image.
Original Quantized
• The minimum required sampling rate 𝑓𝑠 (i.e. 2𝐵) 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.