How to use it
- Enter the sampling rate fs and the signal frequency f (the highest frequency you need to capture).
- Choose the unit; both values and all results use it.
- Read the Nyquist frequency, the minimum sampling rate for f, whether f aliases and the frequency it appears at.
Formulas
- Nyquist frequency f_N = fs ÷ 2
- Nyquist rate 2f; sampling must be faster: fs > 2f
- Alias f_a = |f − k·fs|, with k = round(f ÷ fs); it always lies between 0 and fs/2
- Oversampling ratio = fs ÷ 2f; sample period = 1 ÷ fs
Worked example
A 30 kHz ultrasonic tone recorded at the CD rate of 44.1 kHz:
- Nyquist frequency: 44.1 ÷ 2 = 22.05 kHz, lower than 30 kHz, so the tone aliases.
- Nyquist rate of the tone: 2 × 30 = 60 kHz.
- k = round(30 ÷ 44.1) = 1, so the alias is |30 − 44.1| = 14.1 kHz: an audible tone that was never there.
- Oversampling ratio 44.1 ÷ 60 = 0.735; sample period 22.675737 µs.
Tips
- Filter before sampling. Once a tone has aliased, nothing after the converter can remove it, because it looks exactly like a real 14.1 kHz tone.
- Wheels that seem to spin backwards in videos are the same effect: a camera at 24 or 30 frames per second samples the spokes too slowly.
- Leave margin. Sampling at 2.5 times the highest frequency or more makes the anti-aliasing filter much easier to build than at 2.1 times.