Resampling quality compared 

Table of contents
Page 7/7 Back  |  Next

Aliasing examples

Visible aliasing

Aliasing occurs whenever a signal (e.g. a sound or an image) needs to be digitized from an analog source waveform or if a digital signal needs to be converted (resampled) from one digital resolution to another. You probably know the most popular example of aliasing from the wagon wheels in western movies. When the wagon accelerates the wheels seem to switch between backward- and forward-rotation and in between they even seem to stop. The reason is the digital time resolution (sampling frequency) of a movie, which is way to low to capture the fast rotation frequency correctly.

To simplify the example, let's assume the wheel doesn't have spokes but just a big dot at one position. This way we are not confused by the additional visual aliasing caused by the equally looking spokes. The movie has been recorded at 24 frames per second (fps). This is the sampling frequency, we took 24 samples per second. The Nyquist theorem (see bottom of this page) tells us we won't be able to catch frequencies (rotation speed) greater than half the sampling frequency, which is 12 revolutions per second (rps) in this case. For all frequencies greater than 12 we see a wrong rotation speed:

 

real speed: 3 or 27 or ... --> remainder of wheelspeed/24 < 12
moview shows: a slow 3 rps forward rotation, while the real speed could in fact be e.g. 2403 rps
real speed: 12 or 36 or ... --> remainder of wheelspeed/24 = 12 = Nyquist frequency
moview shows: a flickering wheel, you can't tell whether it moves forward or backward, it jumps between 0° and 180° position
real speed: 21 or 45 or ... --> remainder of wheelspeed/24 > 12
moview shows: a slow 3 rps backward rotation, while the real speed could in fact be e.g. 2421 rps forward
real speed: 24 or 48 or ... --> remainder of wheelspeed/24 = 0
moview shows: no rotation at all, every frame shows the wheel in the exact same position, while the real speed could in fact be e.g. 2400 rps


Bottom line: in the recorded movie the original frequency is completely replaced by a wrong one. There is no perfect solution for this problem, but a workaround is to hide the complete (because wrong) rotation as good as possible, e.g. by adding a motion blur effect. It's not closer to the truth, but it's less annoying to the eye.

Audible aliasing

The same problem exists for frequencies in digital audio. When we record a sound with a sampling frequency of 44100 Hz (CD quality) we won't be able to catch frequencies greater than 22050 Hz. Higher frequencies reflect at the virtual mirror line of 22050 Hz and become a low frequency in the digitized signal. The same happens when converting a digital signal to another digital resolution, which is what a sampler does when you hit a key. The two screenshots below show this reflection. To simplify the example, the source signal contains just sine waves at five differently rising frequencies.

    

note played one octave above root key: the right half of the screen should be black!

check the audio examples at the test pages
 

 

the higher we play the note, the more reflections we get, and this sounds *really* bizzare

check the audio examples at the test pages

Bottom line: the recorded sound contains wrong frequency components in addition to the "good" ones, they are not completely replaced as in the wagon wheel example. The challenge is to separate good from bad. We need to remove aliasing frequencies as good as possible while retaining the source frequencies as good as possible. During recording or resampling this is done by a filter, which removes frequencies which would be outside of the possible target frequency range. It's not closer to the truth, but less annoying to the ear then adding them at the wrong place.

Nyquist theorem

Short definition: A source waveform may be reconstructed (without error) by taking samples at equal time intervals, as long as the sampling rate is at least twice as high as the highest frequency component in the source signal.

Google search: Nyquist Theorem




Page 7/7 Back  |  Next


Table of contents
  Introduction
  The Test
  Results 1/3 - heavy aliasing
  Results 2/3 - average aliasing
  Results 3/3 - no audible aliasing
  Test your own sampler!
  Aliasing examples