The spectrum of the first moment of this tone is presented below
(in linear scales on the left, logarithmic scale on the right).
The harmonic frequencies at multiple of the fundamental tone (440Hz)
are clearly visible. The various music instruments are characterised
by the relative amplitude of the harmonics.

The sound will be resampled at 2kHz, the new sampling frequency being represented by the black line. The green line represents the Nyquist frequency and the red curve represents the anti-aliasing filter that should be used.

Here is the 440Hz-La resampled at 2kHz
*without* precautions against aliasing. The tone sounds
"metallic" (and at least strange). This is due to the aliasing of
the frequencies that were higher than the Nyquist frequency
(half the sampling frequency).
The aliasing is visible on the graphs as a "warping" of the frequenties
against a "mirror" at the Nyquist frequency (1kHz).

In order to avoid aliasing, the spectrum of the signal to be resampled should be zero at frequencies higher than the Nyquist frequency. A low-pass filter is used to achieve this (see red curve in the two first graphs). The resulting downsampled signal sounds much more convincing, as it doesn't suffer of frequency aliasing as is obvious from the graphs.

The at 4kHz downsampled version is awfully distorted by the aliasing.

If an anti-aliasing filter (in red in the graph above) is applied
before the downsampling operation, the
result altough what dimmed
due to the loss of the high frequencies, is much more convincing.

In order to play sound sampled at low frequencies, the sound card has to perform some form of upsampling, involving most of the time a first-order interpolation. In order to avoid aliasing artefacts, a suitable low-pass filter as the one shown above should be used to only keep the blue part of the spectrum of the resampled signal (the red parts are meerly repetitions of the blue part).

It appears that the filter used in those DAC cards is not excellent and part of the remaining spectras is kept, leading to artificial sound degradations. Hence, to circumvent this problem, the upsampling at 44.1kHz was performed using a high-quality numerical filter (a 30-taps linear-phase FIR filter designed using least-squares minimization).

`antialiasingfilter.m`used to compute the anti-aliasing filter`wavresample.m`resampling*without*anti-alising filter`wavresamplegood.m`resampling*with*anti-alising filter`upsample.m`upsampling the given sound-file to 44.1kHz with anti-aliasing filter`wavspectrum.m`used to produce the graphs`demoaliasing.m`the mother of all, the m-file used to generate everything.

- La-440Hz
- The march of the RMA (first few seconds)

This page was last modified by xne.