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.
Alias: where one frequency, and its harmonics, lands after sampling, and which Nyquist zone it came from. Antialiasing filter: the stopband attenuation and filter order a baseband ADC needs, by MT-002's method. IF sample rate: MT-002's Eq 6, the rate that centres a band-limited signal in a Nyquist zone for undersampling.
The unit for every frequency field. Aliasing only depends on ratios to the sample rate, so 2 and 3 give the same fold in Hz, kHz or MHz; switching the unit keeps the numbers as typed.
The ADC's sample rate. The first Nyquist zone runs from dc to half of it; MT-002 p. 3: 100 kSPS processes inputs "up to 50 kHz". The default 3 MSPS is the rate that puts MT-002's 1 MHz to 2 MHz filter example at fa and fs − fa.
The frequency arriving at the ADC input: a signal, an interferer, a clock, or noise. Above fs/2 it is not lost but folded. The default, 2 MHz at 3 MSPS, is the fs − fa of MT-002's example, which lands exactly on the 1 MHz band edge.
The highest frequency you want to keep, MT-002's fa. In Alias mode it marks the band on the figure and flags anything that folds into it; enter fs/2 or more to treat the whole first zone as wanted. In filter mode it is the filter corner.
How many harmonics of the input to fold as well, from the fundamental alone to the 5th. A driver amplifier or the ADC's own front end makes them; each lands wherever n × f folds to, which can be far from the fundamental's alias.
- 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
- 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, ....."
- 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".
- 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).
- 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.
- 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.
- 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.
- 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
- An ideal sampler: MT-002 draws the images for "an ideal impulse sampler" (p. 5). A real ADC adds its own input bandwidth, distortion and jitter, which grow with frequency and matter most in the higher zones.
- The input is a set of sine tones or a band of them. Harmonics are placed at exact multiples of the input; their amplitudes are not computed.
- A tone exactly on a multiple of fs/2 is counted in the lower zone, so fs/2 itself is in zone 1, the "dc to fs/2" Nyquist bandwidth of MT-002 p. 6.
- The filter order uses MT-002's 6 dB per octave per pole from the corner fa. It is a rule for sizing, not a response: it ignores passband ripple, phase and the shape of a real filter near its corner.
- Dynamic range from bits is the ideal full-scale sine SNR, 6.02N + 1.76 dB; a real converter's datasheet SNR is lower, and a lower DR relaxes the filter.
- Eq 6 centres the carrier in the zone; the band edges are taken as fc ∓ Δf/2.
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 f | Zone | k | Alias |f − k·fs| | Spectrum |
|---|---|---|---|---|
| 0.1 MHz | 1 | 0 | 0.1 MHz | as sampled |
| 0.4 MHz | 1 | 0 | 0.4 MHz | as sampled |
| 0.6 MHz | 2 | 1 | 0.4 MHz | reversed |
| 0.9 MHz | 2 | 1 | 0.1 MHz | reversed |
| 1.1 MHz | 3 | 1 | 0.1 MHz | upright |
| 1.4 MHz | 3 | 1 | 0.4 MHz | upright |
| 1.6 MHz | 4 | 2 | 0.4 MHz | reversed |
| 1.9 MHz | 4 | 2 | 0.1 MHz | reversed |
| 2.1 MHz | 5 | 2 | 0.1 MHz | upright |
| 2.4 MHz | 5 | 2 | 0.4 MHz | upright |
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().
| DR | fs = 2.5 fa | fs = 3 fa | fs = 4 fa | fs = 8 fa | fs = 16 fa | fs = 64 fa |
|---|---|---|---|---|---|---|
| 48 dB | 14 | 8 | 6 | 3 | 3 | 2 |
| 60 dB (MT-002) | 18 | 10 | 7 | 4 | 3 | 2 |
| 10-bit, 62.0 dB | 18 | 11 | 7 | 4 | 3 | 2 |
| 12-bit, 74.0 dB | 22 | 13 | 8 | 5 | 4 | 3 |
| 14-bit, 86.0 dB | 25 | 15 | 10 | 6 | 4 | 3 |
| 16-bit, 98.1 dB | 28 | 17 | 11 | 6 | 5 | 3 |
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 polesThe 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 MSPSThe 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
- The sampler is ideal. MT-002 derives the images for "an ideal impulse sampler" (p. 5). In undersampling, "The ADC input bandwidth and distortion performance must be adequate at the IF frequency, rather than only baseband. This presents a problem for most ADCs designed to only process signals in the first Nyquist zone" (p. 10). The calculator puts a 71 MHz carrier in zone 14 whether or not the converter's analog bandwidth reaches 71 MHz; the datasheet decides that.
- The ADC samples, rather than encodes. A converter without a sample-and-hold has a far lower limit than Nyquist. MT-002's example is a 12-bit SAR with an 8 µs conversion time: allowing 1 LSB of change during the conversion gives, by its Eq 4, f = 9.7 Hz, and "any input frequency greater than 9.7 Hz is subject to conversion errors, even though a sampling frequency of 100 kSPS is possible" (p. 3). With a sample-and-hold the same converter handles "input frequencies up to 50 kHz", which is fs/2 = 50 kHz of a 100 kSPS rate. Nearly every modern ADC samples; an old or very cheap one may not.
- Noise folds as well as tones. The X relaxation assumes nothing near fs − fa is ever large. MT-002 attaches a warning to it: "be careful to treat any noise signals which may occur above the maximum signal frequency fa as unwanted signals which will also alias back into the signal bandwidth" (p. 9). Broadband noise from every zone folds on top of the band; the filter is what limits how many zones contribute.
- The pole count is a rule of thumb. 6 dB per octave per pole is how MT-002 sizes the problem, not how a particular filter behaves just past its corner, and it says nothing about passband ripple or phase. MT-002 itself points to elliptic filters where "the requirement is for a sharp transition band and in-band flatness coupled with linear phase response" (p. 7).
- A band must not straddle a zone edge. "The signals must not overlap any multiple of fs/2" (p. 10). A tone exactly on one folds onto dc or fs/2, and a band across one folds onto itself; the calculator flags an input on a zone boundary.
Common aliasing mistakes
- Specifying the antialiasing filter at fs/2. MT-002 calls this assumption "rarely the case" (p. 7): the stopband belongs at fs − fa, and in the worked example above specifying it at fs/2 costs 8 extra poles.
- Sampling at exactly twice the highest frequency. The criterion is a limit, not a design point; at fs = 2fa the transition band from fa to fs − fa has zero width, and no filter can meet it. MT-002's starting point is 2.5 to 4 times fa.
- Forgetting what is above the band. A 1.8 MHz interferer in the default 3 MSPS system lands at 1.2 MHz, between fa and fs/2, and is harmless; one at 2.4 MHz lands at 0.6 MHz, inside it. Clock feedthrough, switching regulators and radio signals all count.
- Checking only the fundamental. Its harmonics come from other zones and fold elsewhere, as the default's harmonics show; a spur in an FFT that matches no input is often one of them.
- Undersampling with a baseband ADC. The zone arithmetic works for any converter; the converter's input bandwidth and distortion at the IF may not.
- Choosing an even zone and forgetting the reversal. The data is intact but upside down; MT-002 notes that it "is easily corrected by re-ordering the output of the FFT" (p. 9), but only if something does.
Further reading
- ADI MT-002, What the Nyquist Criterion Means to Your Sampled Data System Design (Walt Kester) — the encoder limit (pp. 2–3), the criterion (p. 4), images and Nyquist zones (pp. 5–6), the baseband antialiasing filter (pp. 6–9), undersampling and its bandpass filter (pp. 9–10), and Eq 5 and Eq 6 with the 71 MHz example (pp. 11–12).
- ADI MT-001, Taking the Mystery out of the Infamous Formula, "SNR = 6.02N + 1.76dB" — the ideal SNR used here as the dynamic range of an N-bit converter (Eq 9, p. 3).
- ADC noise floor calculator — SNR, process gain and the FFT floor, which is where an alias shows up as a spur.
- ADC resolution calculator — the LSB, the static errors and the aperture limit of a converter.
- Active filter calculator — the Sallen-Key and multiple-feedback sections an antialiasing filter is built from.
- RC filter calculator — the single pole that is enough when the sample rate is high enough above fa.
- ADC charge bucket calculator — the RC between a driver and a SAR input, which is also the last filter before the sampler.