Goal
Understand how a continuous signal becomes a sequence of digital samples.
Prerequisites: Basic Python: variables, functions and arrays. We introduce trigonometry as we go.
Lessons and next steps
- Sine wave and samples: amplitude, frequency, phase and the sampling instants.
- Aliasing: why different frequencies can give the same samples.
- The Nyquist frequency: loss of information at and how to select the sample rate.
- Quantization: digital codes, values that the codes can show, and range limits.
Lab: experiments for this part
- Compare cosines at 1/47 and 20/28 kHz at 48 kS/s, with equal amplitudes and zero phases.
- Change the amplitude, phase and record length; compare the original curve with the samples.
- Compare quantization at different resolutions and measure the error.
We do the experiments in Python with NumPy, SciPy and Matplotlib. We keep the parameters, units and plots. The base models use float64 and complex128; we add bit-depth limits in separate experiments.
Completion criteria
- I can calculate a specific sample from its index, frequency and phase.
- I can tell the difference between sampling in time, quantization of amplitude and clipping of peaks.
Result for the main project
A test signal generator and a teaching model of an ADC.