Aliasing

Last updated

Fig.1a: A properly sampled image of a brick wall requires a screen of sufficient resolution to prevent a moire pattern Moire pattern of bricks.jpg
Fig.1a: A properly sampled image of a brick wall requires a screen of sufficient resolution to prevent a moiré pattern
Fig.1b: Spatial aliasing in the form of a moire pattern Moire pattern of bricks small.jpg
Fig.1b: Spatial aliasing in the form of a moiré pattern

In signal processing and related disciplines, aliasing is an effect that causes different signals to become indistinguishable (or aliases of one another) when sampled. It also often refers to the distortion or artifact that results when a signal reconstructed from samples is different from the original continuous signal.

Contents

Aliasing can occur in signals sampled in time, for instance digital audio, and is referred to as temporal aliasing. It can also occur in spatially sampled signals (e.g. moiré patterns in digital images); this type of aliasing is called spatial aliasing.

Aliasing is generally avoided by applying low-pass filters or anti-aliasing filters (AAF) to the input signal before sampling and when converting a signal from a higher to a lower sampling rate. Suitable reconstruction filtering should then be used when restoring the sampled signal to the continuous domain or converting a signal from a lower to a higher sampling rate. For spatial anti-aliasing, the types of anti-aliasing include fast sample anti-aliasing (FSAA), multisample anti-aliasing, and supersampling.

Description

Dots in the sky due to spatial aliasing caused by halftone resized to a lower resolution Risingstar test crop.png
Dots in the sky due to spatial aliasing caused by halftone resized to a lower resolution

When a digital image is viewed, a reconstruction is performed by a display or printer device, and by the eyes and the brain. If the image data is processed in some way during sampling or reconstruction, the reconstructed image will differ from the original image, and an alias is seen.

An example of spatial aliasing is the moiré pattern observed in a poorly pixelized image of a brick wall. Spatial anti-aliasing techniques avoid such poor pixelizations. Aliasing can be caused either by the sampling stage or the reconstruction stage; these may be distinguished by calling sampling aliasing prealiasing and reconstruction aliasing postaliasing. [1]

Temporal aliasing is a major concern in the sampling of video and audio signals. Music, for instance, may contain high-frequency components that are inaudible to humans. If a piece of music is sampled at 32,000 samples per second (Hz), any frequency components at or above 16,000 Hz (the Nyquist frequency for this sampling rate) will cause aliasing when the music is reproduced by a digital-to-analog converter (DAC). The high frequencies in the analog signal will appear as lower frequencies (wrong alias) in the recorded digital sample and, hence, cannot be reproduced by the DAC. To prevent this, an anti-aliasing filter is used to remove components above the Nyquist frequency prior to sampling.

In video or cinematography, temporal aliasing results from the limited frame rate, and causes the wagon-wheel effect, whereby a spoked wheel appears to rotate too slowly or even backwards. Aliasing has changed its apparent frequency of rotation. A reversal of direction can be described as a negative frequency. Temporal aliasing frequencies in video and cinematography are determined by the frame rate of the camera, but the relative intensity of the aliased frequencies is determined by the shutter timing (exposure time) or the use of a temporal aliasing reduction filter during filming. [2] [ unreliable source? ]

Like the video camera, most sampling schemes are periodic; that is, they have a characteristic sampling frequency in time or in space. Digital cameras provide a certain number of samples (pixels) per degree or per radian, or samples per mm in the focal plane of the camera. Audio signals are sampled (digitized) with an analog-to-digital converter, which produces a constant number of samples per second. Some of the most dramatic and subtle examples of aliasing occur when the signal being sampled also has periodic content.

Bandlimited functions

Actual signals have a finite duration and their frequency content, as defined by the Fourier transform, has no upper bound. Some amount of aliasing always occurs when such functions are sampled. Functions whose frequency content is bounded (bandlimited) have an infinite duration in the time domain. If sampled at a high enough rate, determined by the bandwidth, the original function can, in theory, be perfectly reconstructed from the infinite set of samples.

Bandpass signals

Sometimes aliasing is used intentionally on signals with no low-frequency content, called bandpass signals. Undersampling, which creates low-frequency aliases, can produce the same result, with less effort, as frequency-shifting the signal to lower frequencies before sampling at the lower rate. Some digital channelizers exploit aliasing in this way for computational efficiency. [3]   (See Sampling (signal processing), Nyquist rate (relative to sampling), and Filter bank.)

Sampling sinusoidal functions

Fig.2 Upper left: Animation depicts snapshots of a sinusoid whose frequency is increasing, while it is being sampled at a constant frequency/rate,
f
s
.
{\displaystyle f_{s}.}
Upper right: The corresponding snapshots of an actual
continuous
Fourier transform. The single non-zero component, depicting the actual frequency, means there is no ambiguity. Lower right: The
discrete
Fourier transform of just the available samples. The presence of two components means that the samples can fit at least two different sinusoids, one of which matches the true frequency. Lower left: In the absence of collateral information, the default reconstruction algorithm produces the lower-frequency sinusoid. FFT aliasing 600.gif
Fig.2 Upper left: Animation depicts snapshots of a sinusoid whose frequency is increasing, while it is being sampled at a constant frequency/rate, Upper right: The corresponding snapshots of an actual continuous Fourier transform. The single non-zero component, depicting the actual frequency, means there is no ambiguity. Lower right: The discrete Fourier transform of just the available samples. The presence of two components means that the samples can fit at least two different sinusoids, one of which matches the true frequency. Lower left: In the absence of collateral information, the default reconstruction algorithm produces the lower-frequency sinusoid.

Sinusoids are an important type of periodic function, because realistic signals are often modeled as the summation of many sinusoids of different frequencies and different amplitudes (for example, with a Fourier series or transform). Understanding what aliasing does to the individual sinusoids is useful in understanding what happens to their sum.

When sampling a function at frequency fs (intervals 1/fs), the following functions of time (t) yield identical sets of samples: {sin(2π( f+Nfs) t + φ), N = 0, ±1, ±2, ±3,...}. A frequency spectrum of the samples produces equally strong responses at all those frequencies. Without collateral information, the frequency of the original function is ambiguous. So the functions and their frequencies are said to be aliases of each other. Noting the trigonometric identity:

we can write all the alias frequencies as positive values: . For example, a snapshot of the lower right frame of Fig.2 shows a component at the actual frequency and another component at alias . As increases during the animation, decreases. The point at which they are equal is an axis of symmetry called the folding frequency, also known as Nyquist frequency .

Aliasing matters when one attempts to reconstruct the original waveform from its samples. The most common reconstruction technique produces the smallest of the frequencies. So it is usually important that be the unique minimum.  A necessary and sufficient condition for that is called the Nyquist condition. The lower left frame of Fig.2 depicts the typical reconstruction result of the available samples. Until exceeds the Nyquist frequency, the reconstruction matches the actual waveform (upper left frame). After that, it is the low frequency alias of the upper frame.

Folding

The figures below offer additional depictions of aliasing, due to sampling. A graph of amplitude vs frequency (not time) for a single sinusoid at frequency  0.6 fs  and some of its aliases at  0.4 fs, 1.4 fs,  and  1.6 fs  would look like the 4 black dots in Fig.3. The red lines depict the paths (loci) of the 4 dots if we were to adjust the frequency and amplitude of the sinusoid along the solid red segment (between  fs/2  and  fs).  No matter what function we choose to change the amplitude vs frequency, the graph will exhibit symmetry between 0 and  fs.  Folding is often observed in practice when viewing the frequency spectrum of real-valued samples, such as Fig.4..

Fig.3: The black dots are aliases of each other. The solid red line is an
example
of amplitude varying with frequency. The dashed red lines are the corresponding paths of the aliases. Aliasing-folding SVG.svg
Fig.3: The black dots are aliases of each other. The solid red line is an example of amplitude varying with frequency. The dashed red lines are the corresponding paths of the aliases.
Fig.4: The Fourier transform of music sampled at 44,100 samples/sec exhibits symmetry (called "folding") around the Nyquist frequency (22,050 Hz). Example of spectral "folding" caused by sampling a real-valued waveform.png
Fig.4: The Fourier transform of music sampled at 44,100 samples/sec exhibits symmetry (called "folding") around the Nyquist frequency (22,050 Hz).
Fig.5: Graph of frequency aliasing, showing folding frequency and periodicity. Frequencies above fs/2 have an alias below fs/2, whose value is given by this graph. Aliasing-folding.svg
Fig.5: Graph of frequency aliasing, showing folding frequency and periodicity. Frequencies above fs/2 have an alias below fs/2, whose value is given by this graph.
Two complex sinusoids, colored gold and cyan, that fit the same sets of real and imaginary sample points when sampled at the rate (fs) indicated by the grid lines. The case shown here is: fcyan = f-1(fgold) = fgold - fs Aliasing between a positive and a negative frequency.svg
Two complex sinusoids, colored gold and cyan, that fit the same sets of real and imaginary sample points when sampled at the rate (fs) indicated by the grid lines. The case shown here is: fcyan = f−1(fgold) = fgoldfs

Complex sinusoids

Complex sinusoids are waveforms whose samples are complex numbers, and the concept of negative frequency is necessary to distinguish them. In that case, the frequencies of the aliases are given by just: fN( f ) = f + N fs.  Therefore, as  f  increases from  0  to  fs, f−1( f )  also increases (from  fs  to 0).  Consequently, complex sinusoids do not exhibit folding. [upper-alpha 1]

Sample frequency

Illustration of 4 waveforms reconstructed from samples taken at six different rates. Two of the waveforms are sufficiently sampled to avoid aliasing at all six rates. The other two illustrate increasing distortion (aliasing) at the lower rates. Aliasing.gif
Illustration of 4 waveforms reconstructed from samples taken at six different rates. Two of the waveforms are sufficiently sampled to avoid aliasing at all six rates. The other two illustrate increasing distortion (aliasing) at the lower rates.

When the condition  fs/2 > f   is met for the highest frequency component of the original signal, then it is met for all the frequency components, a condition called the Nyquist criterion. That is typically approximated by filtering the original signal to attenuate high frequency components before it is sampled. These attenuated high frequency components still generate low-frequency aliases, but typically at low enough amplitudes that they do not cause problems. A filter chosen in anticipation of a certain sample frequency is called an anti-aliasing filter.

The filtered signal can subsequently be reconstructed, by interpolation algorithms, without significant additional distortion. Most sampled signals are not simply stored and reconstructed. But the fidelity of a theoretical reconstruction (via the Whittaker–Shannon interpolation formula) is a customary measure of the effectiveness of sampling.

Historical usage

Historically the term aliasing evolved from radio engineering because of the action of superheterodyne receivers. When the receiver shifts multiple signals down to lower frequencies, from RF to IF by heterodyning, an unwanted signal, from an RF frequency equally far from the local oscillator (LO) frequency as the desired signal, but on the wrong side of the LO, can end up at the same IF frequency as the wanted one. If it is strong enough it can interfere with reception of the desired signal. This unwanted signal is known as an image or alias of the desired signal.

Angular aliasing

Aliasing occurs whenever the use of discrete elements to capture or produce a continuous signal causes frequency ambiguity.

Spatial aliasing, particular of angular frequency, can occur when reproducing a light field or sound field with discrete elements, as in 3D displays or wave field synthesis of sound. [4]

This aliasing is visible in images such as posters with lenticular printing: if they have low angular resolution, then as one moves past them, say from left-to-right, the 2D image does not initially change (so it appears to move left), then as one moves to the next angular image, the image suddenly changes (so it jumps right) – and the frequency and amplitude of this side-to-side movement corresponds to the angular resolution of the image (and, for frequency, the speed of the viewer's lateral movement), which is the angular aliasing of the 4D light field.

The lack of parallax on viewer movement in 2D images and in 3-D film produced by stereoscopic glasses (in 3D films the effect is called "yawing", as the image appears to rotate on its axis) can similarly be seen as loss of angular resolution, all angular frequencies being aliased to 0 (constant).

More examples

Online audio example

The qualitative effects of aliasing can be heard in the following audio demonstration. Six sawtooth waves are played in succession, with the first two sawtooths having a fundamental frequency of 440 Hz (A4), the second two having fundamental frequency of 880 Hz (A5), and the final two at 1,760 Hz (A6). The sawtooths alternate between bandlimited (non-aliased) sawtooths and aliased sawtooths and the sampling rate is 22,05 kHz. The bandlimited sawtooths are synthesized from the sawtooth waveform's Fourier series such that no harmonics above the Nyquist frequency are present.

The aliasing distortion in the lower frequencies is increasingly obvious with higher fundamental frequencies, and while the bandlimited sawtooth is still clear at 1,760 Hz, the aliased sawtooth is degraded and harsh with a buzzing audible at frequencies lower than the fundamental.

Direction finding

A form of spatial aliasing can also occur in antenna arrays or microphone arrays used to estimate the direction of arrival of a wave signal, as in geophysical exploration by seismic waves. Waves must be sampled more densely than two points per wavelength, or the wave arrival direction becomes ambiguous. [5]

See also

Notes

  1. Complex samples of real-valued sinusoids have zero-valued imaginary parts and do exhibit folding.

Related Research Articles

In engineering, a transfer function of an electronic or control system component is a mathematical function which theoretically models the device's output for each possible input. In its simplest form, this function is a two-dimensional graph of an independent scalar input versus the dependent scalar output, called a transfer curve or characteristic curve. Transfer functions for components are used to design and analyze systems assembled from components, particularly using the block diagram technique, in electronics and control theory.

Wavelength Spatial period of the wave—the distance over which the waves shape repeats, and thus the inverse of the spatial frequency

In physics, the wavelength is the spatial period of a periodic wave—the distance over which the wave's shape repeats. It is the distance between consecutive corresponding points of the same phase on the wave, such as two adjacent crests, troughs, or zero crossings, and is a characteristic of both traveling waves and standing waves, as well as other spatial wave patterns. The inverse of the wavelength is called the spatial frequency. Wavelength is commonly designated by the Greek letter lambda (λ). The term wavelength is also sometimes applied to modulated waves, and to the sinusoidal envelopes of modulated waves or waves formed by interference of several sinusoids.

Nyquist–Shannon sampling theorem Sufficiency theorem for reconstructing signals from samples

The Nyquist–Shannon sampling theorem is a theorem in the field of signal processing which serves as a fundamental bridge between continuous-time signals and discrete-time signals. It establishes a sufficient condition for a sample rate that permits a discrete sequence of samples to capture all the information from a continuous-time signal of finite bandwidth.

Analog-to-digital converter System that converts an analog signal into a digital signal

In electronics, an analog-to-digital converter is a system that converts an analog signal, such as a sound picked up by a microphone or light entering a digital camera, into a digital signal. An ADC may also provide an isolated measurement such as an electronic device that converts an input analog voltage or current to a digital number representing the magnitude of the voltage or current. Typically the digital output is a two's complement binary number that is proportional to the input, but there are other possibilities.

In telecommunication, intersymbol interference (ISI) is a form of distortion of a signal in which one symbol interferes with subsequent symbols. This is an unwanted phenomenon as the previous symbols have similar effect as noise, thus making the communication less reliable. The spreading of the pulse beyond its allotted time interval causes it to interfere with neighboring pulses. ISI is usually caused by multipath propagation or the inherent linear or non-linear frequency response of a communication channel causing successive symbols to blur together.

Nyquist rate Important parameter in signal processing and sampling

In signal processing, the Nyquist rate, named after Harry Nyquist, specifies a sampling rate. In units of samples per second its value is twice the highest frequency (bandwidth) in Hz of a function or signal to be sampled. With an equal or higher sampling rate, the resulting discrete-time sequence is said to be free of the distortion known as aliasing. Conversely, for a given sample rate, the corresponding Nyquist frequency in Hz is the largest bandwidth that can be sampled without aliasing, and its value is one-half the sample-rate. Note that the Nyquist rate is a property of a continuous-time signal, whereas Nyquist frequency is a property of a discrete-time system.

Sawtooth wave

The sawtooth wave is a kind of non-sinusoidal waveform. It is so named based on its resemblance to the teeth of a plain-toothed saw with a zero rake angle. A single sawtooth, or an intermittently triggered sawtooth, is called a ramp waveform.

Pulse-width modulation

Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is a method of reducing the average power delivered by an electrical signal, by effectively chopping it up into discrete parts. The average value of voltage fed to the load is controlled by turning the switch between supply and load on and off at a fast rate. The longer the switch is on compared to the off periods, the higher the total power supplied to the load. Along with maximum power point tracking (MPPT), it is one of the primary methods of reducing the output of solar panels to that which can be utilized by a battery. PWM is particularly suited for running inertial loads such as motors, which are not as easily affected by this discrete switching, because their inertia causes them to react slowly. The PWM switching frequency has to be high enough not to affect the load, which is to say that the resultant waveform perceived by the load must be as smooth as possible.

The Whittaker–Shannon interpolation formula or sinc interpolation is a method to construct a continuous-time bandlimited function from a sequence of real numbers. The formula dates back to the works of E. Borel in 1898, and E. T. Whittaker in 1915, and was cited from works of J. M. Whittaker in 1935, and in the formulation of the Nyquist–Shannon sampling theorem by Claude Shannon in 1949. It is also commonly called Shannon's interpolation formula and Whittaker's interpolation formula. E. T. Whittaker, who published it in 1915, called it the Cardinal series.

Nyquist frequency Important in signal processing and sampling

In signal processing, the Nyquist frequency, named after Harry Nyquist, is a characteristic of a sampler, which converts a continuous function or signal into a discrete sequence. In units of cycles per second (Hz), its value is one-half of the sampling rate. When the highest frequency (bandwidth) of a signal is less than the Nyquist frequency of the sampler, the resulting discrete-time sequence is said to be free of the distortion known as aliasing, and the corresponding sample-rate is said to be above the Nyquist rate for that particular signal.

Sampling (signal processing)

In signal processing, sampling is the reduction of a continuous-time signal to a discrete-time signal. A common example is the conversion of a sound wave to a sequence of samples.

Undersampling

In signal processing, undersampling or bandpass sampling is a technique where one samples a bandpass-filtered signal at a sample rate below its Nyquist rate, but is still able to reconstruct the signal.

Bandlimiting Limiting a signal to contain only low-frequency components

Bandlimiting is the limiting of a signal's frequency domain representation or spectral density to zero above a certain finite frequency.

In mathematics and signal processing, an analytic signal is a complex-valued function that has no negative frequency components.  The real and imaginary parts of an analytic signal are real-valued functions related to each other by the Hilbert transform.

An anti-aliasing filter (AAF) is a filter used before a signal sampler to restrict the bandwidth of a signal to satisfy the Nyquist–Shannon sampling theorem over the band of interest. Since the theorem states that unambiguous reconstruction of the signal from its samples is possible when the power of frequencies above the Nyquist frequency is zero, a brick wall filter is an idealized but impractical AAF. A practical AAF trades off between bandwidth and aliasing. A practical anti-aliasing filter will typically permit some aliasing to occur or attenuate or otherwise distort some in-band frequencies close to the Nyquist limit. For this reason, many practical systems sample higher than would be theoretically required by a perfect AAF in order to ensure that all frequencies of interest can be reconstructed, a practice called oversampling.

In signal processing, oversampling is the process of sampling a signal at a sampling frequency significantly higher than the Nyquist rate. Theoretically, a bandwidth-limited signal can be perfectly reconstructed if sampled at the Nyquist rate or above it. The Nyquist rate is defined as twice the bandwidth of the signal. Oversampling is capable of improving resolution and signal-to-noise ratio, and can be helpful in avoiding aliasing and phase distortion by relaxing anti-aliasing filter performance requirements.

Filter bank

In signal processing, a filter bank is an array of bandpass filters that separates the input signal into multiple components, each one carrying a single frequency sub-band of the original signal. One application of a filter bank is a graphic equalizer, which can attenuate the components differently and recombine them into a modified version of the original signal. The process of decomposition performed by the filter bank is called analysis ; the output of analysis is referred to as a subband signal with as many subbands as there are filters in the filter bank. The reconstruction process is called synthesis, meaning reconstitution of a complete signal resulting from the filtering process.

In a mixed-signal system, a reconstruction filter, sometimes called an anti-imaging filter, is used to construct a smooth analog signal from a digital input, as in the case of a digital to analog converter (DAC) or other sampled data output device.

Optical resolution describes the ability of an imaging system to resolve detail in the object that is being imaged.

Optical transfer function Function that specifies how different spatial frequencies are handled by an optical system

The optical transfer function (OTF) of an optical system such as a camera, microscope, human eye, or projector specifies how different spatial frequencies are handled by the system. It is used by optical engineers to describe how the optics project light from the object or scene onto a photographic film, detector array, retina, screen, or simply the next item in the optical transmission chain. A variant, the modulation transfer function (MTF), neglects phase effects, but is equivalent to the OTF in many situations.

References

  1. Mitchell, Don P.; Netravali, Arun N. (August 1988). Reconstruction filters in computer-graphics (PDF). ACM SIGGRAPH International Conference on Computer Graphics and Interactive Techniques. 22. pp. 221–228. doi:10.1145/54852.378514. ISBN   0-89791-275-6.
  2. Tessive, LLC (2010)."Time Filter Technical Explanation" [ unreliable source? ]
  3. harris, frederic j. (Aug 2006). Multirate Signal Processing for Communication Systems. Upper Saddle River, NJ: Prentice Hall PTR. ISBN   978-0-13-146511-4.
  4. The (New) Stanford Light Field Archive
  5. Flanagan, James L., "Beamwidth and useable bandwidth of delay-steered microphone arrays", AT&T Tech. J. , 1985, 64, pp. 983–995

Further reading