100nF

Aliasing calculator: alias frequency, Nyquist zone and antialiasing filter

Where a frequency lands after an ADC samples it: the folded (alias) frequency, the Nyquist zone it came from and whether its spectrum comes out reversed, for the input and its harmonics. Then the two design questions that follow: the stopband attenuation and filter order a baseband antialiasing filter needs, and the sample rate that centres an IF signal in a Nyquist zone for undersampling. The method is Walt Kester's ADI MT-002. By default a 2 MHz input at 3 MSPS folds to 1 MHz, the edge of MT-002's 1 MHz band, and the filter that keeps it out needs 10 poles; the tests hold every mode to MT-002's printed numbers, down to its 10.519 MSPS IF example.

zone 1zone 20fs/2fsff: 1 MHz0zone 1 after samplingfs/2 = 1.5 MHz
Fig 1 — 2 MHz sampled at fs = 3 MHz: Nyquist zone 2, alias 1 MHz, spectrum reversed. Upper axis dc to 3 MHz in zones of fs/2 = 1.5 MHz, even zones shaded (reversed spectrum: f); lower axis the first zone, dc to fs/2, where each tone appears after sampling. The band of interest, dc to 1 MHz, is shaded on the lower axis; red marks are tones from outside it that fold into it.
Alias frequency: where f appears after sampling
1 MHz
Nyquist zone of f · Nyquist frequency fs/2
zone 2 · 1.5 MHz
Folded about k·fs, alias = |f − k·fs| with k = 1
|2 − 3| MHz
Spectrum of a band around f after sampling
reversed (zone 2 is even)
Inside the band of interest, dc to 1 MHz
yes: it folds into the band
Images of f at |±K·fs ± f|, K = 1, 2 (MT-002 Fig 5)
1, 4, 5, 8 MHz

A signal at 2 MHz is indistinguishable from one at 1 MHz after sampling. Only a filter ahead of the ADC can separate them; the Antialiasing filter mode sizes it.

How this is calculated

Standard: ADI MT-002, What the Nyquist Criterion Means to Your Sampled Data System Design (Kester, Rev.A 10/08): Figures 4–10, Eq 4–6, pp. 3–12; ADI MT-001, Eq 9, p. 3

fs≥2fmax,images at ∣±Kfs±fa∣,  K=1,2,3,…f_s \geq 2 f_{max}, \qquad \text{images at } \left|\pm K f_s \pm f_a\right|,\; K = 1, 2, 3, \ldots
MT-002 p. 4: "the Nyquist criterion requires that the sampling frequency be at least twice the highest frequency contained in the signal". Figure 5 (p. 5): the sampler's output "shows aliases or images of the original signal around every multiple of fs, i.e. at frequencies equal to |± Kfs ± fa|, K = 1, 2, 3, 4, ....."
falias=∣f−kfs∣,  k=round⁡ ⁣(ffs),NZ=⌈ffs/2⌉f_{alias} = \left|f - k f_s\right|,\; k = \operatorname{round}\!\left(\frac{f}{f_s}\right), \qquad NZ = \left\lceil \frac{f}{f_s/2} \right\rceil
The one image that falls between dc and fs/2, and the Nyquist zone of f, with zones "each having a width equal to 0.5fs" (p. 6). Both are Figure 5 written as a calculation, derived rather than printed. An even zone reverses the spectrum: MT-002 p. 9, "the spectral reversal which occurs when the signals are located in even Nyquist zones".
fstop=fs−fa,Astop=DR−Xf_{stop} = f_s - f_a, \qquad A_{stop} = DR - X
Baseband antialiasing filter, MT-002 Figure 6A and p. 7: "The antialiasing filter transition band is therefore determined by the corner frequency fa, the stopband frequency fs – fa, and the desired stopband attenuation, DR." p. 8: with no signal at fs − fa above X dB below full scale the requirement "is now only DR – X dB". Oversampling by K moves the stopband to Kfs − fa (Figure 6B).
n=⌈Astop6 dB×log⁡2 ⁣(fstop/fa)⌉n = \left\lceil \frac{A_{stop}}{6\ \text{dB} \times \log_2\!\left(f_{stop}/f_a\right)} \right\rceil
MT-002 p. 7: "a Butterworth filter gives 6-dB attenuation per octave for each filter pole (as do all filters). Achieving 60-dB attenuation in a transition region between 1 MHz and 2 MHz (1 octave) requires a minimum of 10 poles". The formula is that sentence generalised to any number of octaves.
SNR=6.02N+1.76 dBSNR = 6.02N + 1.76\ \text{dB}
MT-001 Eq 9 (p. 3), "over the dc to fs/2 bandwidth": the ideal N-bit SNR, used as DR when the dynamic range is taken from the ADC's resolution. MT-002 leaves DR as a system requirement.
fs>2Δf,fs=4fc2NZ−1,  NZ=1,2,3,…f_s > 2\Delta f, \qquad f_s = \frac{4 f_c}{2NZ - 1},\; NZ = 1, 2, 3, \ldots
MT-002 Eq 5 and Eq 6 (p. 11): "The second equation ensures that fc is placed in the center of a Nyquist zone". Worked on pp. 11–12: 71 MHz and 4 MHz wide, 8 MSPS gives NZ = 18.25, rounded down to 18 and fs = 8.1143 MSPS; 10 MSPS gives NZ = 14.7, 14 and 10.519 MSPS. Centred, fc lands at fs/4 in the first zone.
fstop,lo=(NZ−1)fs−f1,fstop,hi=NZ fs−f2f_{stop,lo} = (NZ - 1) f_s - f_1, \qquad f_{stop,hi} = NZ\,f_s - f_2
The bandpass filter's stopband edges, the band's nearest images. MT-002 Figure 9 (p. 10) gives them for the second zone: "The upper transition band is f2 to 2fs – f2, and the lower is f1 to fs – f1". The general form is the same mirror about the zone's edges, derived.

Assumptions

What aliasing is: the Nyquist criterion and the zones

An ADC does not see a waveform; it sees one number every 1/fs seconds. Walt Kester's tutorial for Analog Devices, MT-002, "What the Nyquist Criterion Means to Your Sampled Data System Design", states the consequence plainly: "the Nyquist criterion requires that the sampling frequency be at least twice the highest frequency contained in the signal, or information about the signal will be lost. If the sampling frequency is less than twice the maximum analog signal frequency, a phenomenon known as aliasing will occur" (p. 4).

What "lost" means is specific. In the time domain (Figure 4), a sine sampled at a rate only slightly above its own frequency produces samples that trace out a slower sine: "the pattern of the actual samples produces an aliased sinewave at a lower frequency equal to fs – fa" (p. 5). In the frequency domain (Figure 5), an ideal sampler produces copies of every input "around every multiple of fs, i.e. at frequencies equal to |± Kfs ± fa|, K = 1, 2, 3, 4, ....." MT-002 then divides the spectrum into Nyquist zones, "each having a width equal to 0.5fs" (p. 6): the first from dc to fs/2, the second from fs/2 to fs, and so on for ever. An FFT of the ADC's output "only provides an output from dc to fs/2, i.e., the signals or aliases which appear in the first Nyquist zone" (p. 6). Whatever zone a signal started in, what you get to see is its copy in zone 1.

That is the whole problem, and it is also why undersampling works. A tone at 2 MHz into the calculator's default 3 MSPS ADC has images at 1 MHz, 4 MHz, 5 MHz, 8 MHz; the one in the first zone is 1 MHz, and a real 1 MHz signal would produce exactly the same samples. Nothing after the ADC can tell them apart.

How to calculate the alias frequency and the Nyquist zone

Of the input and all its images |±K·fs ± f|, exactly one falls between dc and fs/2. It is the input minus the nearest whole multiple of the sample rate, taken as a magnitude: alias = |f − k·fs|, with k the whole number nearest to f/fs. The zone the input came from is f divided by fs/2, rounded up. Both are Figure 5 turned into arithmetic rather than formulas MT-002 prints, and the reference note above says so.

The zone matters for one more reason than bookkeeping. MT-002's undersampling section notes that for a band in the second zone "the order of the frequency components within the spectrum is reversed, but this is easily corrected by re-ordering the output of the FFT", while in the third "the image that falls into the first Nyquist zone has no spectral reversal" (p. 9). The rule is the parity of the zone: odd zones fold upright, even zones fold reversed. For a single tone that changes nothing; for a modulated signal it swaps upper and lower sidebands, and a receiver that does not expect it demodulates the mirror image.

The table runs a 1 MSPS converter through its first five zones. Watch the alias walk up from dc to fs/2 through the odd zones and back down through the even ones, which is the fold the calculator's figure draws.

Input fZonekAlias |f − k·fs|Spectrum
0.1 MHz100.1 MHzas sampled
0.4 MHz100.4 MHzas sampled
0.6 MHz210.4 MHzreversed
0.9 MHz210.1 MHzreversed
1.1 MHz310.1 MHzupright
1.4 MHz310.4 MHzupright
1.6 MHz420.4 MHzreversed
1.9 MHz420.1 MHzreversed
2.1 MHz520.1 MHzupright
2.4 MHz520.4 MHzupright

Pairs of rows land on the same alias: 0.4 MHz and 0.6 MHz both give 0.4 MHz, 1.1 MHz and 0.9 MHz both give 0.1 MHz. That is the ambiguity in a single line: after sampling, a frequency tells you its alias and nothing about which zone it came from.

Harmonics alias too, and not to where you expect

An input tone rarely arrives alone. A driver amplifier, the ADC's own front end, or the signal itself adds harmonics at 2f, 3f and upwards, and each is a frequency like any other: it folds by the same rule, from its own zone. The calculator folds up to the fifth. With the default 2 MHz at 3 MSPS, the harmonics at 4 MHz, 6 MHz, 8 MHz, 10 MHz come from zones 3, 4, 6, 7 and land at 1 MHz, 0 MHz, 1 MHz, 1 MHz.All four land inside the 1 MHz band of interest or on its edge, and the third, at exactly 2fs, lands on dc, where it reads as an offset. This is the derived part of the calculator, MT-002's image rule applied to n·f, and it is the reason a spur in an FFT often turns out to be a harmonic from a zone nobody was looking at.

Harmonics made before the antialiasing filter are attenuated by it like any other out-of-band signal. Harmonics made after it, in the ADC driver or the converter's sampling network, reach the sampler unfiltered, and their aliases are limited only by the linearity of those stages.

The antialiasing filter: corner fa, stopband fs − fa

The fix for aliasing is to remove anything that would fold into the band before the ADC sees it. MT-002 is precise about where the filter's edges belong, and it is not at fs/2. With fa the highest frequency of interest and the filter's corner there, Figure 6A shows "how full-scale frequency components above fs – fa are aliased back into the bandwidth dc to fa. These aliased components are indistinguishable from actual signals and therefore limit the dynamic range to the value on the diagram which is shown as DR" (p. 7). The page continues: "Some texts recommend specifying the antialiasing filter with respect to the Nyquist frequency, fs/2, but this assumes that the signal bandwidth of interest extends from dc to fs/2 which is rarely the case." Aliases that land between fa and fs/2 are outside the band and harmless.

So the specification is three numbers: "the corner frequency fa, the stopband frequency fs – fa, and the desired stopband attenuation, DR" (p. 7). The order follows from MT-002's rule of thumb on the same page: "a Butterworth filter gives 6-dB attenuation per octave for each filter pole (as do all filters)". The calculator counts the octaves from fa to fs − fa and divides them into the attenuation at 6 dB per pole per octave, which is MT-002's own worked sentence generalised.

Two refinements come straight from MT-002. First, oversampling: raising the sample rate by K while keeping fa and DR moves the stopband to Kfs − fa (Figure 6B), and "the wider transition band … makes this filter easier to design" (p. 8). Second, knowledge of the signal: "If the maximum signal at the frequency fs – fa will never exceed X dB below full-scale, then the filter stopband attenuation requirement can be reduced by that same amount", to "only DR – X dB" (p. 8). The calculator takes both. For the starting point, MT-002 recommends "an initial sampling rate of 2.5 to 4 times fa" and working up from there if the filter proves unrealisable (p. 8); the result flags where your ratio sits against that range.

Filter order against sample rate: a table

Poles needed by MT-002's 6 dB/octave rule for a corner at fa and a stopband at fs − fa, against the ratio fs/fa and the dynamic range. The bit-count rows take DR as the ideal full-scale SNR, 6.02N + 1.76 dB (ADI MT-001, Eq 9). Every cell is the calculator's antialiasFilter().

DRfs = 2.5 fafs = 3 fafs = 4 fafs = 8 fafs = 16 fafs = 64 fa
48 dB1486332
60 dB (MT-002)18107432
10-bit, 62.0 dB18117432
12-bit, 74.0 dB22138543
14-bit, 86.0 dB251510643
16-bit, 98.1 dB281711653

The left-hand columns are MT-002's recommended starting range, and at 2.5 × fa the transition band is only 0.58 octaves wide. Each doubling of the sample rate beyond that adds roughly an octave to the transition band and takes a proportional bite out of the order; the right-hand columns show why an oversampling converter needs only a low-order filter. MT-002 notes that "sigma-delta ADCs are inherently highly oversampled converters, and the resulting relaxation in the analog anti-aliasing filter requirements is therefore an added benefit of this architecture" (p. 8).

Worked example: 60 dB between 1 MHz and 2 MHz

MT-002's own example (p. 7): "Achieving 60-dB attenuation in a transition region between 1 MHz and 2 MHz (1 octave) requires a minimum of 10 poles—not a trivial filter, and definitely a design challenge." As a baseband design, a 1 MHz corner at fa and a 2 MHz stopband at fs − fa put the sample rate at 3 MSPS, which is 3 × fa and inside MT-002's starting range. The calculator's filter mode, with its defaults, reproduces it; the lines after the fourth are the same design moved along each axis MT-002 names.

corner     fa                                     = 1 MHz
stopband   fs − fa = 3 MHz − 1 MHz                = 2 MHz
octaves    log2(2 MHz / 1 MHz)                    = 1.000
poles      60 dB / (6 dB × 1.000)                 = 10
relaxed    X = 12 dB: 48 dB / 6 dB                = 8
12-bit     DR = 6.02 × 12 + 1.76 = 74.0 dB → poles = 13
K = 2      fs = 6 MHz: log2(5 MHz/1 MHz) = 2.32   = 5 poles
K = 4      fs = 12 MHz: log2(11 MHz/1 MHz) = 3.46 = 3 poles

The ten poles match MT-002. Knowing that nothing at fs − fa exceeds −12 dBFS saves 2 of them; a 12-bit converter's full74.0 dB instead of 60 dB costs 3 more. Doubling the rate brings the order down to 5, and quadrupling it leaves a 3-pole filter, which is Figure 6B's point in numbers. Had the filter been specified at the Nyquist frequency instead, 60 dB between 1 MHz and fs/2 = 1.5 MHz would have asked for 18 poles: the "rarely the case" specification costs 8 more poles than the problem needs.

The same page shows the alternative to a Butterworth ladder of that size. "Elliptic filters meet these criteria and are a popular choice", and the TTE LE1182 in MT-002's Figure 7 "is specified to achieve at least 80 dB attenuation between fc and 1.2fc" with 11 poles (pp. 7–8). By the 6 dB/octave rule, 80 dB in the 0.263 octave from fc to 1.2fc would take 51 poles. The rule is a way to see whether a requirement is reasonable, not a filter design; the active filter calculator designs the second-order sections a real one is built from.

Worked example: undersampling a 71 MHz IF

Undersampling turns the aliasing rule to use. MT-002 restates the criterion for a band-limited signal: "A signal of bandwidth BW must be sampled at a rate equal to or greater than twice its bandwidth (2BW) in order to preserve all the signal information", with "no mention of the absolute location of the band of sampled signals" (p. 10). The one constraint is "that the band of sampled signals be restricted to a single Nyquist zone, i.e., the signals must not overlap any multiple of fs/2 (this, in fact, is the primary function of the antialiasing filter)".

Two equations do the planning: Eq 5, fs > 2Δf, and Eq 6, fs = 4fc/(2NZ − 1), which "ensures that fc is placed in the center of a Nyquist zone" (p. 11). MT-002's example is "a 4-MHz wide signal centered around a carrier frequency of 71 MHz". It starts at the Eq 5 minimum of 8 MSPS, solves Eq 6 for "NZ = 18.25", rounds down to 18, and gets "fs = 8.1143 MSPS". Then, wanting "more margin for the antialiasing filter", it tries 10 MSPS: "NZ = 14.7", rounded to 14, and "fs = 10.519 MSPS" (pp. 11–12). The calculator's IF mode reproduces both, and adds the derived lines that show what the margin is.

Eq 5       fs > 2 × 4 MHz                         = 8 MSPS minimum
Eq 6       (4 × 71 / 8 + 1) / 2                   = 18.25 → NZ = 18
           fs = 4 × 71 / (2 × 18 − 1)             = 8.1143 MSPS
guard      transition band each side, fs/2 − Δf   = 0.057 MHz
retry      (4 × 71 / 10 + 1) / 2                  = 14.70 → NZ = 14
           fs = 4 × 71 / (2 × 14 − 1)             = 10.519 MSPS
guard      transition band each side              = 1.259 MHz
stops      13fs − f1  ·  14fs − f2                = 67.741 MHz  ·  74.259 MHz
image      fs/4, NZ = 14 is even: reversed        = 2.63 MHz
odd NZ     NZ = 13: 4 × 71 / 25                   = 11.360 MSPS

The Eq 6 steps match MT-002 to the digits it prints. The guard band is the derived part: with the band centred, each transition band of the bandpass filter is fs/2 − Δf wide, the distance from the band's edge to its own mirror image in the next zone. At 8.1143 MSPS that is 0.057 MHz, a brick wall; at 10.519 MSPS it is 1.259 MHz, 22 times wider, which is the "more margin" MT-002 was after. The edges follow Figure 9's construction, where for the second zone "The upper transition band is f2 to 2fs – f2, and the lower is f1 to fs – f1" (p. 10).

Both of MT-002's answers use an even zone, so the image at fs/4 = 2.63 MHz comes out reversed. MT-002 p. 11: "If NZ is chosen to be odd, then fc and its signal will fall in an odd Nyquist zone, and the image frequencies in the first Nyquist zone will not be reversed." Zone 13 would do it at 11.360 MSPS, at the cost of a faster clock; whether that is worth it depends on whether the reversal is cheaper to undo in software, which MT-002 says it usually is.

Where this model stops being valid

Common aliasing mistakes

Further reading