1. Learn
    2. Saturation and distortion
    3. Aliasing and oversampling

    What is aliasing, and how does oversampling fix it?

    Aliasing happens when a digital effect makes frequencies higher than half the sample rate. They can't be stored, so they fold back down as tones that don't belong to the note and sound harsh and out of tune. Oversampling runs the effect at a higher sample rate and filters those frequencies off before they can fold.

    What aliasing is
    Frequencies above half the sample rate folding back down, out of tune with the music
    What causes it
    Distortion, clipping and saturation plug-ins, and synths with simple oscillators
    The fix
    Oversampling: running the effect at a higher sample rate, usually 2 to 16 times
    The cost
    More CPU, and a little latency in most plug-ins
    OSR·1Aliasing lab
    Curve
    Oversampling
    Spectrum of the toneNote and harmonicsAliases
    A single amber line and nothing else
    Where the harmonics goKeptFiltered offFolds back

    Right now

    The tone peaks just under full scale, so the hard clipper isn't touching it. The spectrum shows the note and nothing else. Add drive and the clipper starts cutting the tops off.
    –Aliasing dB
    0vs Off dB
    44.1kHz inside
    Drive0 dB
    Pitch3.52 kHz

    Follow the steps. Each one sets the controls for you and tells you what to listen for.

    Step 1 of 8
    Play a clean high tonePress play. This is a sine wave at 3.52 kHz, the A three octaves above the one tuners use. It peaks just under full scale, so the hard clipper leaves it alone and the spectrum shows a single amber line.
    Train your earsThe lab hard clips a sound with 18 dB of drive and picks whether oversampling is off or at 8x. The screens are covered while you play, and both versions are level-matched, so only the aliasing gives it away.

    The test tone is a sine wave generated in your browser.

    Aliasing in plain English

    Digital audio stores sound as a list of numbers, one per sample, and a sample rate of 44.1 kHz means 44,100 of them every second. A list like that can only describe frequencies up to half its sample rate. That limit is the Nyquist frequency, named after the engineer Harry Nyquist, and it's 22.05 kHz at 44.1 kHz or 24 kHz at 48 kHz.

    Ask a digital system to hold a frequency above that line and it can't refuse. The samples still get taken; they just describe a lower frequency, and the lower frequency is what you hear. That's aliasing, a tone turning up under a false name. A 25 kHz tone at 44.1 kHz comes out at 19.1 kHz, because 44.1 − 25 = 19.1.

    Films show the same effect when a car's wheels seem to turn slowly backwards. The camera takes 24 pictures a second, and if a wheel turns almost one spoke's width between pictures, each picture shows the spokes a little behind where they were.

    The dashed line is a sine wave, and the dots are the samples a 44.1 kHz system takes of it. Below 22.05 kHz only one sine can pass through all of those dots, so the pink line sits right on top of the dashed one. Push past 22.05 kHz and a lower sine fits the same dots; that's what plays back. A 25 kHz sine comes out at 19.1 kHz.

    Frequencies fold around the Nyquist frequency like a sheet of paper folded along that line. Go 3 kHz past it and you land 3 kHz under it. Go past the sample rate itself and the counting starts again from zero, so at 44.1 kHz a 45.76 kHz tone comes out at 1.66 kHz.

    Why distortion plug-ins cause aliasing

    Recordings don't alias, because the converter in every audio interface filters out almost everything above the Nyquist frequency before the sound becomes samples. The trouble starts inside the computer, when a plug-in makes frequencies that weren't there before.

    Distortion does exactly that, from gentle saturation to hard clipping. Any curve that bends a wave adds harmonics, new frequencies at whole-number multiples of the note, which the harmonics lesson covers in detail. A digital clipper works out each output sample from each input sample and has no idea where the Nyquist frequency is, so the harmonics that belong above 22.05 kHz fold back down instead.

    Take the tone in the lab, 3.52 kHz, and hard clip it at 44.1 kHz. A symmetrical clipper adds odd harmonics, and only the first two of them fit under the line.

    A hard-clipped 3.52 kHz tone at 44.1 kHz
    HarmonicBelongs atComes out atPart of the note?
    3rd10.56 kHz10.56 kHzYes
    5th17.6 kHz17.6 kHzYes
    7th24.64 kHz19.46 kHzNo
    9th31.68 kHz12.42 kHzNo
    11th38.72 kHz5.38 kHzNo
    13th45.76 kHz1.66 kHzNo
    15th52.8 kHz8.7 kHzNo

    None of the folded frequencies is a multiple of 3.52 kHz. Real harmonics make a note brighter or fuller and still sound like the note; aliases sound like quieter, out-of-tune tones underneath it, and on a high note some land below the note itself.

    What aliasing sounds like

    On a single tone it's obvious once you know it's there: a thin, metallic layer of pitches that don't fit the note. When the note moves, some of the aliases move the opposite way, because a harmonic that rises past the fold comes back down by the same amount. A pitch bend or a glide through a distorted synth picks up a second sweep running against it.

    In a full mix the music covers a lot of it, and aliasing turns into a grainy, harsh top end on whatever is distorted. It's worst on high notes and cymbals, and on anything hard clipped.

    Low notes rarely alias enough to hear, because their first harmonic past the Nyquist frequency is a very high one. For a 110 Hz bass note it's the 201st, and with 18 dB of hard clipping the lab puts that harmonic about 100 dB below the note. Set the Pitch knob to 110 Hz and the lab measures all the aliasing together at around 65 dB below the note, where the 3.52 kHz tone had 17.

    Reading the lab

    The lab is a clipper with an oversampling switch that goes from Off to 16x, and a choice of a soft or a hard curve. Test tone plays a pure sine at the frequency on the Pitch knob. The other buttons play loops, most of them from two Sounds Like You packs, or your own sound if you upload or record one.

    The top screen is a spectrum that runs in a straight line from 0 Hz to the Nyquist frequency. With the test tone, the amber lines are the note and its harmonics and the pink lines are aliases; hover over a pink line to see which harmonic it came from and where it should have been. With a loop, the pale shape is the output and the pink fill is the aliasing in it, found by comparing the current render with a 16x render of the same settings.

    The screen below it shows where every harmonic of the tone goes, on a scale that runs to 20 times the Nyquist frequency. Amber harmonics fit and stay. Teal ones are above the Nyquist frequency but below the fold point, so the oversampling filter takes them out. Pink ones are past the fold point and fold back down, and the bright pink ones land below 20 kHz, where you'd hear them.

    Every setting, Off included, goes through the same pair of filters with the same delay of about 1 ms, so switching between them changes the aliasing and nothing else. The output is also level-matched, so adding drive changes the tone without making it louder, and A/B plays the clean sound at the same loudness.

    What is oversampling?

    Oversampling means running an effect at a higher sample rate than the session, so the new harmonics have room to exist, and filtering them off before converting back. At 4x in a 44.1 kHz session the curve runs at 176.4 kHz, in four stages.

    1. UpsampleThe plug-in adds three new samples between each pair of real ones and fills them in with a low-pass filter. The wave is the same, described in four times as much detail.
    2. Run the curveThe clipper or saturator works on the high-rate signal. Every harmonic up to 88.2 kHz now fits.
    3. FilterA second low-pass filter removes everything above the original 22.05 kHz, which includes the harmonics that would have folded.
    4. DownsampleThe plug-in keeps every fourth sample and is back at 44.1 kHz, with nothing left above the Nyquist frequency to fold.

    With oversampling off, most harmonics above about 24 kHz fold to somewhere below 20 kHz, where you can hear them. At 4x a harmonic has to be above about 156 kHz to do the same, and the harmonics that high are much quieter.

    Oversampling reduces aliasing, but it can't always get rid of all of it. A hard clipper's harmonics fade so slowly that some are still loud enough to count past any fold point, which is why the lab still measures aliasing on the hard clipper at 16x. A soft curve's harmonics fade quickly, and a little oversampling catches almost all of them.

    How much oversampling do you need?

    The lab measured its 3.52 kHz test tone at each setting, at 44.1 kHz with 18 dB of drive. Each figure is all the aliasing below 20 kHz added together, in dB below the note.

    Aliasing on a 3.52 kHz tone with 18 dB of drive, measured in the lab
    SettingCurve runs atFold pointHard clipSoft clip
    Off44.1 kHz22.05 kHz−17 dB−19 dB
    2x88.2 kHz44.1 kHz−39 dB−45 dB
    4x176.4 kHz88.2 kHz−47 dB−90 dB
    8x352.8 kHz176.4 kHz−56 dB−104 dB
    16x705.6 kHz352.8 kHz−74 dB−104 dB

    The soft clipper's aliasing has gone by 4x, and its 8x and 16x figures are as low as the lab's filters can measure. The hard clipper keeps improving all the way up without getting there.

    So 2x is enough for gentle saturation on most sounds. Use 4x or 8x for clipping, heavy distortion and anything bright, and keep 16x for hard clipping a master or an exposed high synth part, where the extra CPU is worth it. If a plug-in has a separate setting for rendering, set that one higher, because CPU doesn't matter during an export.

    The costs of oversampling

    CPU

    At 8x the curve runs eight times for every sample, and the filters add their own work on top. One oversampled clipper is nothing for a modern computer, but forty of them at 16x can be.

    Latency

    The filters need to see a little of the sound ahead, so most oversampled plug-ins delay their output, usually by somewhere between a handful of samples and a few milliseconds. Your DAW's plug-in delay compensation lines everything back up on playback, but you'll feel the delay if you play or sing through the plug-in while recording.

    The filter's own sound

    The filter that removes the folded harmonics has to cut steeply just above 20 kHz. A linear-phase filter keeps every frequency in time but rings very slightly before sharp transients, while a minimum-phase filter puts all of its ringing after the transient and shifts the timing of the very top end instead. Both effects sit up near 20 kHz, and they're why some plug-ins let you choose the filter type.

    Peaks over the ceiling

    An oversampled clipper's output can go above the level it clips at. Taking the highest harmonics off a squared-off wave leaves small ripples beside each corner, and the ripples poke out above the flat top: on the lab's hard-clipped test tone they reach about 1.3 dB over the clipping level once oversampling is on. If you clip right at 0 dBFS, leave a dB or two of headroom or put a true peak limiter after it.

    How to set oversampling, step by step

    1. Find the switchLook for Oversampling, OS, HQ or Quality in the plug-in's menu or a corner of its window. Many plug-ins ship with it off to save CPU.
    2. Listen to the worst caseSolo the part and play its highest notes, or its cymbals, through the distortion with oversampling off.
    3. Go up a step at a timeOversampling barely changes the level, so if the top end gets cleaner and less grainy as you go up, that's aliasing going away.
    4. Stop where it stops changingWhen the next setting sounds the same as the one you're on, stay on the lower one and keep the CPU.
    5. Raise it for the exportIf the plug-in has a render or offline setting, set it higher than the one you mix with.

    Other places aliasing comes from

    Distortion is the usual cause, but anything that makes new frequencies inside the computer can alias.

    Synth oscillators

    A sawtooth or square wave drawn the simple way, jumping instantly from top to bottom, has harmonics that go on forever, so high notes alias. Most software synths use band-limited oscillators instead, which keep the harmonics above the Nyquist frequency out, either by smoothing each jump in the wave or by playing from wavetables built only from harmonics that fit. The oscillator waveforms lesson shows the shapes.

    Sample-rate reduction

    A downsampler keeps one sample in every few and holds it, with no filter at all, so it aliases on purpose. That's the metallic, lo-fi grit covered in sample-rate reduction, and in bitcrushing vs sample-rate reduction.

    Fast changes in level

    A limiter or compressor that changes the gain within a single cycle of the wave is reshaping it, the same as a clipper, and it can make frequencies above the Nyquist frequency too. That's one reason limiters often have an oversampling option. Pitching a sample up with a low-quality resampling setting can also alias.

    Does working at 96 kHz fix aliasing?

    It helps. At 96 kHz the Nyquist frequency is 48 kHz, so every plug-in in the session gets the room it would have with 2x oversampling at 48 kHz. The cost is that every plug-in does twice the work, including the EQs and compressors that never needed it, and your audio files are twice the size. A hard clipper at 96 kHz still aliases, just less, so its own oversampling is still worth turning on. Oversampling only the plug-ins that distort gets you most of the benefit for much less CPU. Sample rate and bit depth covers what the session rate does to everything else.

    Common aliasing mistakes

    Leaving oversampling off on bright, clipped sounds

    Hard clipping hi-hats, cymbals or a high lead with oversampling off is the quickest way to get a grainy top end. Turn oversampling on before you reach for an EQ to tame it.

    Blaming aliasing for ordinary brightness

    A heavily distorted sound is bright because it has lots of upper harmonics, and oversampling won't change that. If switching it on makes no difference, the harshness is the harmonics themselves: lower the drive or turn the top end down after the distortion.

    Testing with a low note

    A bass note will tell you almost nothing about whether a plug-in aliases. Play a high sine through it, around 3 to 5 kHz, and look on a spectrum analyser for lines that aren't multiples of the note, the same way the lab's test tone works.

    Maxing out every plug-in

    16x on every distortion in a session can push the CPU and add latency that you notice while recording. Most sounds stop changing well before that.

    Train your ears

    The quiz at the bottom of the lab hard clips a sound with 18 dB of drive and picks either oversampling off or 8x without telling you. The screens are covered and the levels matched, so all you have to go on is the sound. Most rounds use the test tone, where the aliases are easy to pick out once you know what to listen for, and the rest use the synth loop, which is harder. Your best score is saved in your browser.

    Questions people ask

    What is the Nyquist frequency?

    Half the sample rate: 22.05 kHz at 44.1 kHz and 24 kHz at 48 kHz. It's the highest frequency a digital system can store, and anything above it folds back down as aliasing.

    Does oversampling change the sound?

    In a simple clipper or saturator it only removes aliasing. The harmonics below 20 kHz stay the same, so the top end gets cleaner and the distortion keeps its character. Plug-ins that model analogue circuits can change a little more, because the model behaves slightly differently at a higher rate, so compare by ear with the levels matched.

    Is aliasing always bad?

    No. Sample-rate reducers alias on purpose, and on a lo-fi drum or a harsh synth that metallic edge is often the sound you're after. It's only a problem when you didn't choose it.

    Should I record at 96 kHz to avoid aliasing?

    Recording doesn't alias, because your audio interface filters the sound before it's sampled. A 96 kHz session does give distortion plug-ins more room above hearing, but every plug-in then does twice the work. Turning on oversampling in the few plug-ins that distort costs much less.

    Does EQ need oversampling?

    Not for aliasing. An EQ turns frequencies that are already there up or down and never adds new ones, so it has nothing to fold. Some EQs oversample for another reason: a digital bell filter set close to the Nyquist frequency comes out narrower than it should, and a higher rate keeps its shape.

    Why do limiters have oversampling?

    A limiter that changes the gain very quickly makes new frequencies, which can alias the same way distortion does. Peaks between the samples can also be higher than any sample, and a limiter that checks an oversampled copy of the signal catches them. That's what a true peak limiter does.

    Keep going

    Zac Dobos

    Zac runs Sounds Like You, which makes sample packs, preset packs and the Murmur granular synth plug-in. The lessons in Learn are free, and every one has a working version of the effect in it.