Here’s a simple demonstration using the Nyquist Prompt effect (Nyquist Prompt - Audacity Manual)
- Open Audacity and ensure that the Project Rate is set to 44100 (bottom left corner of the main screen). This is the default rate for Audacity.
- Add a new track (Tracks menu > Add New > Mono track) and select part of it (a selection is required to run effects).
- Open the Nyquist Prompt effect (Edit menu).
We are now going to use a simple Nyquist commands to generate a sine tone at a specific frequency. (The index of the Nyquist manual is here if you wish to look up these commands: Index). Nyquist will not apply anti-aliasing unless we specifically tell it to, so that makes it easy to demonstrate the effect.
We know that our sample rate is 44100, and the Nyquist Shannon theorem tells us that the highest supported frequency is half the sample rate, so let’s first try generating a tone that is within that range. Enter the following code into the Nyquist Prompt:
(hzosc 6000)
Use “Plot Spectrum” to view the frequency spectrum (Plot Spectrum - Audacity Manual)
Now try it with a frequency of 34100 Hz. We know this should not be possible, so we expect to see either nothing (if an anti-alias filter is applied), or the tone will be aliased as a 10000 Hz tone (if there is no anti-alising filter).
If you use the “Debug” button instead of the “OK” button, you will see a warning about aliasing.
(hzosc 34100)
- Now set the Project Rate to 96000 Hz (or higher) and add a new track. The new track takes the Project Rate as its default sample rate.
- Repeat the above tests. You will now see the 34100 Hz tone generated “correctly”.