Before this:What is DSP?
Sampling & quantization
Key takeaways Sampling measures a wave at a fixed sample rate; the Nyquist limit says that rate must exceed twice the highest frequency, or higher components alias into false low ones. Quantization rounds each sample to a fixed bit depth, adding a little quantization noise. Together they turn a continuous wave into the number stream DSP works on.
Lesson 1 said DSP works on a stream of numbers. This lesson is how a real, continuous wave becomes that stream — and the two ways digitizing can go wrong.
Sampling: measuring on a clock
An analog-to-digital converter measures the signal at a steady tick — the sample rate, in samples per second (often written S/s, or MS/s for millions). An SDR dongle might run at 2.4 MS/s: 2.4 million measurements every second.
Nyquist: the speed limit
How fast is fast enough? The Nyquist–Shannon theorem gives the rule:
Sample at more than twice the highest frequency in the signal.
Sample a 1 MHz-wide chunk of spectrum and you need above 2 MS/s. Sample too slowly and a disaster called aliasing happens: frequencies above half the sample rate “fold” back down and appear as false lower frequencies, indistinguishable from real ones. It’s the same effect that makes wagon wheels seem to spin backwards in film — too few frames per second. This is why an SDR always filters before reducing its rate, a theme you’ll meet again in decimation. The sample rate & Nyquist lesson in the RF path covers the same limit from the radio side.
Quantization: rounding the amplitude
Sampling handles when you measure; quantization handles how precisely. Each sample is rounded to one of a fixed number of levels set by the bit depth:
| Bit depth | Levels | Typical use |
|---|---|---|
| 8-bit | 256 | RTL-SDR dongles |
| 12-bit | 4,096 | Airspy, better SDRs |
| 16-bit | 65,536 | Audio, high-end receivers |
More bits mean finer amplitude resolution and a lower noise floor. The rounding error you can’t avoid shows up as quantization noise — a faint hiss set by the bit depth. It’s one contributor to the noise floor you met in noise & SNR.
The two knobs, together
Digitizing a signal is these two choices: sample rate (sets the frequency span you can see) and bit depth (sets how finely you resolve amplitude). Get either wrong and information is lost before DSP even begins — which is why understanding them is the foundation for everything that follows.
Quick check: to capture a signal containing frequencies up to 1 MHz, your sample rate must be…
Recap
- Sampling measures the wave at a fixed sample rate.
- Nyquist: sample above twice the highest frequency, or suffer aliasing.
- Quantization rounds each sample to a bit depth, adding quantization noise.
- Sample rate sets the frequency span; bit depth sets amplitude precision.
Next up: why SDR samples come in pairs — the complex I/Q representation.
Frequently asked questions
What is the Nyquist theorem?
The Nyquist–Shannon sampling theorem says you must sample at more than twice the highest frequency present in a signal to capture it faithfully. Sample slower and higher frequencies fold down and masquerade as lower ones — a corruption called aliasing. So to capture a 1 MHz-wide signal you need a sample rate above 2 MHz.
What is the difference between sample rate and bit depth?
Sample rate is how often you measure the signal (samples per second), which sets the range of frequencies you can capture. Bit depth is how precisely you record each measurement (bits per sample), which sets how finely you can distinguish amplitudes and therefore the quantization noise floor. One is about time, the other about amplitude.