Catto / Topic Map · Telecommunications II Year 7
Telecommunications II · 120 h · Topic 1 of 6

Sampling theorem

All digital communication rests on a surprising claim: a continuous signal can be reconstructed exactly from isolated samples, as long as they are taken often enough. That “enough” has a precise value.

Nyquist Aliasing Antialias TDM

Where we start from

Spectral analysis and the idea of frequency content are developed in signals and Fourier analysis, and the conversion itself in A/D and D/A converters. Here we work on the criterion that decides how fast you have to sample and what happens if it is not respected.

01The statement

fs≥2fmaxfalias=|fs−f| The sampling frequency must be at least twice the highest component present in the signal. If this is not met, every component above fs/2 appears mirrored at a lower frequency.
original signal24 samples per cycleFar above the limit: the waveform can be seen directly in the samples.8 samples per cycleComfortable. This is the oversampling ratio used when the signal also has to be observed.3 samples per cycleStill above the Nyquist limit: the signal can be reconstructed, even though at a glance itdoes not look like it.false signal consistent with the same samples1.6 samples per cycleBelow the limit: the same samples also fit a much slower signal, and there is noway to tell them apart.The limit is two samples per cycle. In practice considerably more is used, to leave margin for the input filter.
Figure 1. Sampling at different rates, animated. With enough samples per cycle the original signal is fully determined; below the limit, the samples are consistent with a completely different signal, and there is no way to know which one it was.
ApplicationUseful bandSamplingWhy that value
Telephony300 to 3400 Hz8 kHzA little more than twice 3400 Hz, leaving margin for the filter.
Digital audio20 Hz to 20 kHz44.1 kHzCovers human hearing with margin for the input filter.
Instrumentationdepends on the process5 to 20 timesReconstructing is not enough: the waveform has to be seen clearly.
Digital oscilloscopebandwidth5 to 10 timesSo the edges can be seen without relying on interpolation.
Twice is the theoretical minimum, not the working value

Sampling at exactly twice the frequency only works with mathematically perfect signals and ideal filters. In practice a margin is taken: telephony samples at 8 kHz for a 3.4 kHz band, and audio at 44.1 kHz for 20 kHz. That margin is what gives the anti-aliasing filter a range of frequencies over which to attenuate.

02Aliasing

0246810kHzfs/2 = 4 kHzfs = 8 kHzusable band5 kHzThe signal contains a 5 kHz toneEverything below 4 kHz is usable signal. The 5 kHz tone exceeds the limit.usable band5 kHzSampling at 8 kHzSampling repeats the spectrum around the sampling frequency and its multiples.usable band5 kHzalias 3 kHzThe mirrored image appears|8 - 5| = 3 kHz: the component is mirrored downward and falls inside the usable band.usable bandalias 3 kHzIt can no longer be separatedFiltering afterwards is useless: the alias is mixed with the legitimate signal. That is why the filter goes before theconverter.
Figure 2. Spectral aliasing, animated. Every component above half the sampling frequency is mirrored downward and appears mixed with the useful signal, with no possibility of separating it afterwards.
Worked example · A tone that appears where it isn't

A signal containing a 5 kHz tone is sampled at 8 kHz, with no input filter.

  • The Nyquist limit is 8/2 = 4 kHz. The 5 kHz tone exceeds it.
  • Alias frequency: |8 − 5| = 3 kHz.
  • In the reconstructed signal a 3 kHz tone appears that never existed, inside the usable band and therefore impossible to filter out.

It is the same phenomenon by which, in a film, the wheels of a car seem to turn backward: the camera “samples” at 24 or 30 frames per second and the wheel turns faster than that.

The anti-aliasing filter always goes before the converter

And it is analog, because once the signal is sampled the damage is irreversible: no digital processing can separate the alias from the legitimate signal. Its cutoff frequency is placed below fs/2, and its slope has to be steep enough that at fs/2 the attenuation is greater than the dynamic range of the converter.

That requirement is demanding: an eighth-order filter is not unusual. That is why oversampling is used, which puts the useful band far from fs/2 and allows a simple analog filter, leaving the fine filtering to the digital domain, where it is easy.

03Sample-and-hold and reconstruction

On the conversion side
  • The sample-and-hold circuit freezes the value while the converter works. Without it, a signal that changes during conversion produces a meaningless result.
  • The aperture time —the time it takes to freeze— and the jitter —the variation of the sampling instant— limit accuracy at high frequency.
  • Droop is the slow discharge of the hold capacitor: it must be negligible during the conversion.
On the reconstruction side
  • The D/A converter outputs steps, not a curve: it holds each value until the next sample.
  • Those steps contain high-frequency components that were not in the original. The reconstruction filter removes them and returns the smooth curve.
  • The hold also introduces a slight attenuation of high frequencies, which in demanding systems is compensated for.
Jitter: the error you don't see coming

If the samples are not taken at exactly equally spaced instants, the captured value corresponds to the wrong moment, and that amounts to an amplitude error. The faster the signal varies, the larger that error. In audio and digital radio, sampling clock jitter can limit performance long before the number of bits of the converter does.

04Pulse modulation and multiplexing

AcronymWhat it modulates in the pulseUse
PAMThe amplitude of each pulse follows the value of the sample.It is the intermediate step of every sampling: what exists before quantization.
PWMThe width of the pulse. The information is in the duration.Power control, servos, switching power supplies, brightness control.
PPMThe position of the pulse within its interval.Optical links and radio control. Good immunity to amplitude noise.
PCMEach sample is quantized and encoded in bits.All of telephony and digital audio. Developed in the next topic.
Time-division multiplexing

Between one sample and the next there is free time, and that time is used to interleave the samples of other channels. It is the idea that allowed a single copper pair to carry thirty conversations.

In the European system, the E1 frame has 32 time slots of 8 bits each, repeated 8000 times per second: 32 × 8 × 8000 = 2.048 Mbit/s. Of those 32 slots, 30 carry voice and two are reserved for synchronization and signaling.

Example · How many channels fit

A digital link of 8.448 Mbit/s carrying 64 kbit/s telephone channels, with 5% of the capacity reserved for synchronization and control.

Usable capacity: 8.448 × 0.95 = 8.026 Mbit/s. Channels: 8,026,000/64,000 = 125 channels as a theoretical maximum.

The real system that works at that rate —the E2— carries 120 channels: four E1 frames of 30 channels each. The difference is the synchronization and justification bits that multiplexing needs in order to combine four frames whose clocks are not exactly equal.

05In the lab

Lab 1 · Making an alias

With a generator and a sound card or an A/D converter, sample tones of increasing frequency without an input filter. Record the frequency from which the measured tone starts to go down instead of up, and verify the alias formula at several points.

Lab 2 · The anti-aliasing filter

Repeat the previous lab with an active low-pass filter inserted, with a cutoff below half the sampling frequency. Check that the aliases disappear and measure how much attenuation is needed at fs/2 for them to go unnoticed.

Lab 3 · Reconstruction

Convert a sampled signal back to analog and observe the steps on the oscilloscope. Add the reconstruction filter and compare. Measure the high-frequency content before and after with a spectrum analyzer.

Lab 4 · Time-division multiplexing

With a microcontroller, sample four slow signals and transmit them interleaved over a single serial channel, with a synchronization word at the start of each frame. On the other side, separate them and reconstruct them. It is a complete TDM frame made by hand.

06Common mistakes

MistakeConsequence
Sampling without an anti-aliasing filterComponents that never existed appear, inside the useful band and impossible to remove afterwards.
Sampling at exactly twice the frequencyThere is no margin for the filter: in practice considerably more is needed.
Filtering after the converterToo late: the aliasing has already happened and is irreversible.
Believing that 2 times is enough to see the waveformNyquist guarantees reconstruction, not a legible display. To observe, 5 to 10 times is needed.
Ignoring clock jitterIt limits accuracy at high frequency long before the converter resolution does.
No sample-and-holdThe signal changes during conversion and the result does not correspond to any instant.
Forgetting the reconstruction filterThe D/A steps radiate and interfere, and the signal is not the original.

07Self-assessment

What does the sampling theorem say?

That a band-limited signal is completely determined by its samples if the sampling frequency is at least twice its highest component.

A 6 kHz tone sampled at 8 kHz: where does it appear?

At |8 − 6| = 2 kHz, inside the useful band and with no way of telling it from a legitimate signal of that frequency.

Why does telephony sample at 8 kHz?

Because its band reaches 3400 Hz: twice that would be 6800 Hz, and 8 kHz leaves a reasonable margin for the anti-aliasing filter to work.

Where does the anti-aliasing filter go and why?

Before the converter, and it is analog. Once the signal has been sampled, the aliasing has already happened and no later processing can undo it.

What is the advantage of oversampling?

It puts the useful band far from fs/2, so a simple analog filter is enough and the fine filtering is done in the digital domain, where it is easy.

What is the sample-and-hold circuit for?

To freeze the value of the signal while the converter works. Without it, a signal that changes during conversion gives a result that does not correspond to any instant.

What is jitter and what effect does it produce?

The variation of the sampling instant. It amounts to an amplitude error, larger the faster the signal varies, and it can limit performance before the number of bits does.

Why is a filter needed after the D/A converter?

Because the D/A outputs steps, which contain high-frequency components that did not exist in the original. The reconstruction filter removes them.

Difference between PWM and PPM.

In PWM the information is in the width of the pulse; in PPM, in its position within the interval.

Where do the 2.048 Mbit/s of an E1 frame come from?

From 32 slots of 8 bits repeated 8000 times per second: 32 × 8 × 8000 = 2,048,000 bit/s. Thirty slots carry voice and two, synchronization and signaling.

Development of the topic “Basic mathematical concepts” of Telecommunications II (Year 7), based on the “Curriculum Proposal – Second Cycle of the Technical-Vocational Track, Secondary Education – Electronics,” Ministry of Education of the Province of Córdoba, DGETyFP. Back to the Topic Map · catto.ar