 This article is about aliasing as it applies to signal processing, including computer graphics. For uses in computer programming, please refer to aliasing (computing)
In statistics, signal processing, and related disciplines, aliasing is an effect that causes different continuous signals to become indistinguishable (or aliases of one another) when sampled. When this happens, the original signal cannot be uniquely reconstructed from the sampled signal.
Aliasing is a major concern in the digitaltoanalogue conversion of video and audio signals: improper sampling of the analog signal will cause highfrequency components to be aliased with genuine lowfrequency ones, and be incorrectly reconstructed as such. To prevent this problem, the signals must be appropriately filtered, before sampling.
It is also a major concern in digital imaging and computer graphics, where it may give rise to moiré patterns (when the original image is finely textured) or jagged outlines (when the original has sharp contrasting edges, e.g. screen fonts). Antialiasing techniques are used to reduce such artifacts.
Overview
Aliasing in periodic phenomena
The sun moves east to west in the sky, with 24 hours between sunrises. If one were to take a picture of the sky every 23 hours, the sun would appear to move west to east, with 24 × 23 = 552 hours between sunrises. Note that both motions would result in the same pictures. The same phenomenon causes spoked wheels to apparently turn at the wrong speed or in the wrong direction when filmed, or illuminated with a flashing light source — such as fluorescent lamp, a CRT, or a strobe light.
Sampling a sinusoidal signal
In the same way, when one measures a sinusoidal signal at regular intervals, one may obtain the same sequence of samples that one would get from a sinusoid with lower frequency. Specifically, if a sinusoid of frequency f (in cycles per second) is sampled s times per second, with s ≤ f/2, the resulting samples will also be compatible with a sinusoid of frequency f  2 s. In the area's jargon, each sinusoid gets aliased to (becomes an alias for) the other.
Therefore, if we sample at frequency s a continuous signal that may contain both sinusoids, we will not be able to reconstruct the original signal from the samples, because it is mathematically impossible to tell how much of each component we should take.
The Nyquist criterion
One way to avoid such aliasing is to make sure that the signal does not contain any sinusoidal component with a frequency greater than s/2. More generally, it suffices to ensure that the signal is appropriately bandlimited, namely that the difference between the frequencies of any two of its sinusoidal components must be strictly less than s/2.
This condition is called the Nyquist criterion, and is equivalent to saying that the sampling frequency s must be strictly greater than twice the signal's bandwidth, the difference between the maximum and minimum frequencies of its sinusoidal components.
Origin of the term
The term "aliasing" derives from the usage in radio engineering, where a radio signal could be picked up at two different positions on the radio dial in a superheterodyne radio: one where the local oscillator was above the radio frequency, and one where it was below. This is analogous to the frequencyspace "wrapround" that is one way of understanding aliasing.
An 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 1760 Hz (A6). The sawtooths alternate between bandlimited (nonaliased) 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 1760 Hz, the aliased sawtooth is degraded and harsh with a buzzing audible at frequencies lower than the fundamental. Note that the audio file has been coded using Ogg's Vorbis codec, and as such the audio is somewhat degraded.

Sawtoothaliasingdemo.ogg {440 Hz bandlimited, 440 Hz aliased, 880 Hz bandlimited, 880 Hz aliased, 1760 Hz bandlimited, 1760 Hz aliased}
Mathematical explanation of aliasing
The preceding explanation and the Nyquist criterion are rather simplistic, because they assume instantaneous sampling and other unrealistic hypotheses. The following is a more detailed explanation of the phenomenon in terms of function approximation theory.
Continuous signals
For the purposes of this analysis, we define (continuous) signal as a real or complex valued function whose domain is the interval [0,1]. To quantify the "magnitude" of a signal (and, in particular, to measure the difference between two signals), we will use the root mean square norm (see L_{p} spaces for some details), namely
Accordingly, we will consider only signals that have finite norm, i.e. the squareintegrable functions
Note that these signals need not be continuous as functions; the adjective "continuous" refers only to the domain.
To be precise, we do not distinguish between functions that differ only on sets of zero measure. This technicality turns   into a norm, and explains some of the difficulties (see the S_{0} sampling method, below.) For details, see Lp spaces.
Point sampling
The conversion of a continuous signal f to an ndimensional vector of equally spaced samples (a sampled signal) can be modeled as a point sampling operator S_{0}, defined by , where t_{i} = i / n. That is, the function is sampled at the points
Note that S_{0} is a linear map: for any two signals f and g, and any scalar a, then
Unfortunately, while S_{0}(f) is welldefined if f is continuous (say), it is not well defined on the space L^{2} defined above. A symptom of this is, even if we restrict our attention to functions f that are continuous, function S_{0} of f is not continuous in the L^{2} norm.
In many physically significant settings, the L^{2} norm, or a similar norm, is an appropriate measure of similarity between signals. What will then happen is that two signals f and g that are deemed very similar to begin with will sample to two signals S_{0}f and S_{0}g which are very dissimilar.
A better sampling method (filtering)
In order to preserve closeness of signals after sampling (in other words, to get a sampling method which varies smoothly as a function of the signal f) we need to modify our sampling strategy S_{0}. An improved method is as follows:
This is a better filtering method, as S_{1} is now a continuous linear map from L^{2} to .
Reconstruction
Given a sampled signal one would like to reconstruct the original signal . This is obviously impossible in general, as L^{2} is an infinite dimensional vector space, while is a finite dimensional vector space (of dimension n.)
In practice, one picks a subspace of dimension n and a reconstruction linear map R from to H. The purpose of R is to turn a sampled signal into a continuous one in a way that makes sense to us.
An example reconstruction map would be
where 1_{E}(x) is 1 if and 0 otherwise.
Ideally, we would have S(R(s)) = s for all . If this occurs, then R and S both have the same picture of how signals in L^{2} and in behave, we might say that S and R are coherent. Here, R_{1} and S_{1} are in fact coherent, but R_{1} and S_{0} aren't.
Another way of saying that R and S are coherent is that R is a rightinverse for S (or S is a leftinverse for R.)
Aliasing
For any sampled signal the set of continuous signals which sample to the same v are called aliases of one another. The fact that there are many aliases for any one given sampled signal is called aliasing. As previously mentioned, the large quantity of aliasing is caused by L^{2} being infinite dimensional while is finite dimensional.
Optimal filtering
In certain physical situations, the choice of R, H or S are somehow constrained. For instance, it is usual to choose H to be the linear span of lowdegree trigonometric polynomials:
Further restrictions are that, for instance, S should coincide with S_{0} on H. If sufficiently many of these demands are put forward, we eventually conclude that the sampling algorithm must take a very special shape:
 S_{opt}f = S_{0}(sinc * f)
where sinc * f is some sort of sinc filter or sinc function.
The reconstruction formula R is chosen so that R and S are coherent.
Caveats
Figure 1

Figure 2

It is extremely important to keep in mind what is much repeated in the above discussion: the Nyquist theorem, the optimality of the sinc filter, the choice of the error norm (we chose L^{2}) and so on are all assumptions we are making about the underlying physical problem.
In many problems, these assumptions are absolutely wrong, and in these cases, the Nyquist theorem needs to be modified so that it makes a true statement pertinent to the situation at hand.
For instance, when solving certain nonlinear partial differential equations, one finds that low and high frequencies are difficult to compute; then the filters used need to remove high and low frequency components. The sinc filter only removes high frequency components, so it is not optimal for this particular problem.
In some other problems, the space of signals is not a vector space. In this case, the Nyquist theorem needs to be rephrased very carefully, as it no longer speaks of vector spaces.
For instance, when observing a signal which is known to be of the form f(t)=(exp(it)a)/exp(it)a (see Figure 1 where the trajectory of f(t) is plotted, with a=exp(i)) where a is some unit complex number, then in fact the set of possible signals can be viewed as a onedimensional manifold. Since a is unit, f will have a singularity somewhere and therefore will contain very high frequency information. Yet, the only necessary information is a; from this we are able to reconstruct the entirety of the signal with arbitrary precision. To recover a, it is sufficient to have any single Fourier coefficient of f, except the zeroth one. In other words, while f has extremely wide bandwidth (and the Nyquist theorem would seem to suggest that we need many samples) a single sample of f suffices with the S_{0} method to recover f fully, to arbitrary precision. The reconstruction filter to recover f from S_{0}f in this case is not any of the discussed reconstruction formulae.
Figure 1 shows the rational function described above, as well as a filtered version where we kept 21 Fourier coefficients. The filtered version corresponds to applying a sinc filter to the rational function f. As we can see, the sinc filtered version is an extremely poor approximation of the unfiltered function. Figure 2 illustrates the problem: the Fourier coefficients of f decay roughly as fast as 1/frequency. Therefore, the assumptions used to justify the optimality of the sinc filter are false in this case.
An example in astronomy
An interesting problem of astronomy is to compute the apparent radius of a star. Stars look like points in most cases, but a large, nearby star could have an apparent radius in an extremely powerful telescope. The problem is that earthbound optical telescopes have to deal with the distortions of the atmosphere, and so the images of stars we obtain are frequently of very poor quality (we might say that there is a lot of aliasing.) We could try to improve them by filtering with a sinc filter, as above; however, the trouble is that we're trying to find information smaller than the smallest detail that the atmosphere allows through (the diameter of the star is much less than the "sample rate" of a telescope peering through the atmosphere; we are fighting against the Nyquist theorem.) However, in this particular problem, some simplifying assumptions make the problem tractable.
With a good telescope and in an ideal world, the star is completely spherical and completely white against a completely black background. The star may not be centered. It is physically reasonable to presume that the pure image f and the image degraded by the atmosphere g are related via the relation
 g=Φ*f,
where Φ is an unknown convolution operator. We know that f is precisely the indicating function of some disc,
f(x,y)=1 if (xa)^{2}+(yb)^{2}≤r^{2}, 0 otherwise,
and the only unknown quantities are a,b,r. The apparent radius of the star is r. From Fourier analysis, we know that therefore
 ,
where denotes the Fourier transform. It turns out that the radius r of the indicating function of a disc (in our example, f) is completely determined by the smallest zero w_{0}=(w,z) of via the relation
 ,
where Z_{0} = 3.83170597... is the first positive zero of the Bessel function J_{1}(x).
In Figure 3, we have simulated such an experiment. The topleft image is f, an offcenter purely circular star. The bottomleft image is g, the image of f after being disturbed randomly by the atmosphere; it is the image an earthbound astronomer might observe in his telescope. The topright and bottomright images are the Fourier transforms of f and g, respectively. We have circled in blue the radius of the smallest zeros of and ; the circle for was used to compute w_{0}, from which we calculated an approximation of r. The star in this example has a radius of 15 pixels, and the measured radius from is 14.6935, which is an error of less than half a pixel. The reconstructed star image is almost identical to the ideal star image, as seen in Figure 4. The only different pixels are colored black. The red cross marks the origin of the coordinate system as in the topleft image of Figure 3; only the area near the star is shown and is zoomed by a factor of four for clarity.
The origin of the star was calculated from g by simple averaging.
In this case, the reconstruction map is nonlinear but very accurate for expected inputs. This is an example where blackbox filtering with a sinc filter is not able to recover the desired data. The algorithm presented here is able to compute the radius very precisely even when the measured data is orders of magnitude worse than pictured above.
See also