Sampling & Aliasing: Square Example
For the following example, a sawtooth with 20 partials is used without band limitation. Since the builtin Web Audio oscillator is band-limited, a simple additive synth is used in this case. At a pitch of about \(2000 Hz\), the aliases become audible. For certain fundamental frequencies, all aliases will be located at actual multiples of the fundamental, resulting in a correct synthesis despite aliasing. In most cases, the mirrored partials are inharmonic and distort the signal and for higher fundamental frequencies the pitch is fully dissolved.
Pitch (Hz):
Output Gain:
Time Domain:
Frequency Domain:
Band Limited Generators
In order to avoid the aliasing, band-limited signal generators are provided in most audio programming languages and environments.