Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 46 ยท Sampling and Digital Transmission

Chapter 4 overview: Sampling and digital transmission

Preview chapter 4: sampling, quantization, pulse code modulation and line codes, the steps that turn a voice or sensor signal into a stream of bits.

Chapter 3 sent analog messages on carriers. Chapter 4 changes the message itself: it turns a continuous waveform into numbers, and the numbers into bits. This conversion is the reason a phone call can be carried over the same network as a web page, and the reason music can be copied a million times without degradation. Three steps do the job: sampling in time, quantization in amplitude and encoding into bits. A fourth step, the line code, decides which voltages carry the bits on the wire.

Three cards: a waveform sampled at eight instants, the values rounded to eight levels, and the eight resulting three-bit codewords
Sample in time, quantize in amplitude, then write each level as bits.

What you will learn

  • The three steps of analog-to-digital conversion and what each loses or keeps.
  • How the lessons of the chapter fit together.
  • The bit-rate arithmetic of real systems.

Key terms

  • Sampling: measuring the signal at regular instants Ts = 1/fs.
  • Quantization: rounding each sample to one of a finite set of levels.
  • PCM (pulse code modulation): sampling, quantization and binary coding together.
  • Bit rate Rb: bits transmitted per second.
  • Line code: the rule that maps bits to voltage pulses.

The chapter in slides

Analog to digital in three steps

Sample Measure every Ts
Quantize Round to a level
Encode Level to bits
1 / 4

The lessons in this chapter

  1. Sampling theorem: how fast to sample, and aliasing.
  2. Quantization and PCM: levels, quantization noise, SQNR, bit rates.
  3. Line codes and pulse shaping: NRZ, RZ, Manchester, AMI, Nyquist pulses and ISI.
  4. Chapter 4 review.

Why bother with digital?

Three reasons, each of which returns in the rest of the course. Regeneration: a repeater decides which bit was sent and transmits a clean copy, so noise does not accumulate. Processing: once a signal is numbers, you can compress, encrypt, multiplex and error-correct it. Universality: voice, video and data are all just bits, so one network carries everything.

The costs are bandwidth (a digitized voice needs about 64 kb/s, which needs more spectrum than the analog 4 kHz) and an irreversible quantization error. The rest of the chapter measures both costs.

Common misconceptions

"Digitizing loses nothing." Sampling at a sufficient rate loses nothing in theory, but quantization always discards a little. You choose how much by choosing the number of bits.

"More samples than necessary make quality worse." Oversampling costs bit rate or memory, but it never harms quality; it often helps by relaxing the anti-aliasing filter.

Try it

The first example performs the full chain on a short waveform: sample, quantize to 3 bits, write out codewords and reconstruct. You can change bits and watch the error shrink.

Python Sample, quantize, encode

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The second example computes bit rates for four real systems. The arithmetic is the same each time: samples per second times bits per sample times channels.

JS Bit-rate arithmetic

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In which order does analog-to-digital conversion proceed?

    The signal is first measured at discrete times, then each value is rounded to a level, then the level is written as bits.
  2. 2. Which step of PCM always loses a little information?

    Rounding to a finite number of levels discards the exact value.
  3. 3. A telephone call samples at 8 kHz with 8 bits. The bit rate is

    8000 ร— 8 = 64,000 b/s.
  4. 4. Why can a digital repeater avoid accumulating noise?

    As long as the decision is correct, the noise is discarded rather than carried on.

Summary

  • ADC = sample, quantize, encode; PCM does all three.
  • Sampling is lossless if fs โ‰ฅ 2B; quantization always loses a little.
  • Bit rate = samples/s ร— bits/sample ร— channels.
  • Line codes then turn bits into voltages for transmission.

Next: Sampling theorem