Notes on Sampling, Aliasing, and DAC/Interpolation
Introduction and Context
- The speaker begins by reflecting on what gives a person their unique voice: tone, accent, and timbre. If someone could capture all the sinusoidal components of a voice, they could synthesize a voice that sounds like the original. This motivates the broader DSP discussion: decompose signals into sinusoidal components, analyze, and reconstruct.
- This sets up the core DSP idea: sampling a signal creates a spectrum with multiple copies; we need to understand how those copies interact and when they alias.
Core Observations on Sampling and Spectrum
- When you sample a signal, you generate several copies of the filtered signal in the frequency domain. These copies are spaced by the sampling frequency fs.
- In frequency, you have replicas centered at multiples of fs, each with a width of 2B where B is the bandwidth of the baseband signal.
- The copies are separated by the sampling frequency: the distance between adjacent spectra is fs.
- The width of each replica is twice the bandwidth: the baseband spans [−B,B] and copies extend symmetrically around their centers.
- Overlap of these replicas causes aliasing. To avoid aliasing (in the ideal-case analysis), you want no overlap between replicas.
- Nyquist criterion from a spectrum perspective: to prevent aliasing under ideal conditions, the sampling frequency must satisfy
fs≥2B
where B is the signal bandwidth. If this is not met, copies overlap and aliasing occurs. - Ideal vs non-ideal filters:
- If the filter is ideal (brick-wall) and the signal fits within the Nyquist band, nothing from outside the band will fold back inside the baseband.
- In practice, filters are non-ideal. They do not end sharply at the cutoff; their transition bands and imperfections mean the Nyquist guarantee can fail if fs is not chosen with those realities in mind.
- When non-ideal, aliasing can spill over even if you try to apply the classical Nyquist rule; practical design must account for filter roll-off and non-idealities.
- The “spill over” idea: with non-ideal filters, energy can leak into adjacent bands and cause aliasing if the sampling rate is not sufficiently high.
- Practical takeaway: you have two broad strategies to combat aliasing:
- Invest in a good anti-aliasing analog filter (before sampling) to ensure minimal energy above the baseband.
- Or, increase the sampling rate so the spectral copies are further apart, reducing the risk of overlap even with a non-ideal filter.
- Real-world constraints lead to a trade-off: you may store or transmit large bandwidths, which pushes you toward higher f<em>s. Higher f</em>s comes with cost (hardware, power) but reduces aliasing risk.
- A concrete example from the transcript discusses a scenario where a minimum sampling frequency is roughly 1.45×105 Hz (145 kHz). Using rates like 200 kHz, 300 kHz, 500 kHz, 600 kHz, or even 1 GHz yields diminishing perceptual differences in some contexts.
- This illustrates the practical principle: beyond a certain point, increasing fs yields marginal improvements for some applications.
- In many DSP tasks, systems run on hardware with better processing power, so the assumption of ideal Nyquist may not hold; real devices require considering non-ideal filters and non-idealities.
- Summary: Nyquist works cleanly only under ideal assumptions. In practice, you must account for non-ideal filters, and design around either a better pre-filter or a higher sampling rate, depending on costs and performance targets.
Practical Design Choices and Trade-offs
- Two main pathways to prevent aliasing in practice:
1) Use a high-quality analog anti-aliasing filter (before sampling) to suppress frequencies above B.
2) Increase the sampling frequency fs so that the replicated spectra are far apart, reducing the chance of overlap even if the filter is not ideal. - If you are dealing with very wide bandwidths or when hardware allows, oversampling (choosing a very high fs) can mitigate non-idealities of the filter.
- The choice of fs is influenced by:
- The bandwidth B of the signal: ideally fs>2B.
- The acceptable level of aliasing (tolerance). If you tolerate some aliasing, you can get away with a smaller fs.
- The quality of the anti-aliasing filter and the cost/complexity of implementing it.
- Storage and processing constraints: higher fs increases data rate and processing load.
- A practical, audio-oriented note from the transcript: the acceptable aliasing level in some audio applications is described in terms of a percentage tolerance in the transition region (e.g., a 2% aliasing tolerance). The idea is: the energy that leaks into undesired bands should be limited to a small fraction of the usable signal energy.
- Important nuance: if you rely on the Nyquist criterion too literally for non-ideal systems, you may be misled. Always consider the actual filter response and how it interacts with fs.
Quantization and Bit Depth in ADCs
- In addition to sampling frequency, quantization depth is crucial: the number of bits determines how finely you can represent amplitudes.
- Effects to consider:
- A higher bit depth increases the number of levels and reduces quantization error, improving dynamic range and SNR for a given signal.
- Coarser quantization (fewer bits) introduces quantization noise, which can be significant especially when the signal-to-noise ratio is high elsewhere.
- The transcript notes that the number of bits influences the system’s performance, in addition to the sampling frequency and filter quality. In practice, you typically trade off between sampling rate, bit depth, and post-processing/compression goals.
Digital-to-Analog Reconstruction and Interpolation
- After sampling, you need to reconstruct the continuous signal from discrete samples. This is the DAC reconstruction step.
- The challenge: the original analog signal between samples is unknown. You must interpolate to estimate values in between sample points.
- Intuition from the transcript:
- If the two consecutive sample points are very close, guessing the intermediate values (interpolation) is easier.
- If the points are far apart, there is a higher risk that the interpolation will misrepresent the actual signal between samples.
- The sampling theorem implies that, with sufficient fs and proper filtering, you can reconstruct the original signal exactly (within the limits of quantization). In practice, reconstruction often uses interpolation kernels (e.g., sinc-based reconstruction in theory, practical approximations in hardware/software).
- The question posed in the transcript about a 200 kHz processor asks: what are the implications of using a 200 kHz sampling/processing rate compared to the original context?
- If the original signal bandwidth requires f<em>s near a minimum (e.g., close to 2B), then using 200 kHz imposes a hard limit on the maximum recoverable baseband (Nyquist limit is f</em>s/2).
- If 200 kHz is only modestly above the minimum, you may not gain much by going higher; the practical benefits depend on the actual B, the filter quality, and the quantization scheme.
- If you stay at fs=200 kHz but the signal’s bandwidth demands more, aliasing will occur unless the pre-filter and processing compensate in some other way.
Worked Scenarios and Takeaways
- Nyquist criterion in practice:
- Ideal case: to avoid aliasing, require
$$ f_s > 2B \