Digital Audio 101: Aliasing Explained
In this video, I’ll be demonstrating aliasing as it pertains to digital audio.
Now, most of the time as audio engineers, we don’t have to worry about aliasing. That’s because it’s usually automatically prevented for us behind the scenes. I still think it’s an important concept to understand. So what I’ll do is demonstrate aliasing, so you can hear it and see it, and in the end, hopefully understand it a little bit better.
To begin with, as an example, let’s say I’ve got a piano part that sounds like this.
Let me bring up the spectrum analyzer so we can better see the frequency content of my piano signal. This is the one that comes with the Ozone equalizer.
You can see this piano part has a frequency range that goes down even close to 20Hz, and all the way close to twenty-thousand Hz, where the high frequencies really start to roll-off.
Now, I’ll point out here that my sampling rate for my session is at 48,000 samples per second. That means I can record a frequency range that goes all the way up to my Nyquist frequency of 24,000 Hz, which is sufficient as long as I’m trying to record this piano part that just goes up to around 20,000 Hz. However, if I was to start using a lower sampling rate, then some problems can start to show up.
So what I’ll do here, is I’ll bring up, as an example, the Air Lo-Fi plug-in. This is a stock plug-in that comes with Pro Tools. What it allows you to do is change the sampling rate of an input signal. So, the piano part is going to start out at 48,000 Hz, but when it goes through this plug-in, it’s going to be changed down to 12,000 samples per second, with a Nyquist frequency of 6,000 Hz. You can hear and see what happens when I bring the plug-in in.
[piano plays, bringing in and out Air Lo-Fi]
So, hopefully you’re able to hear that some artifacts start to show up in my output signal. These artifacts are the result of some of the original frequencies being mapped or sampled to different frequencies. One thing I can do, is turn on the anti-aliasing filter to try and remove some of these problems in the high frequencies.
So here is my anti-aliasing filter. It will prevent some of these artifiacts from showing up here.
[piano plays, turning on and off the anti-aliasing filter]
So the idea is it’s going to block the frequencies that are above my Nyquist frequency.
Now, when you’re first listening to these things, you might have the impression that this aliasing that happens is random, irregular, or unpredictable. However, the thing to understand about aliasing, is that when it does occur, it happens in an entirely predictable fashion.
As an example, let me change my input signal from this piano part, over to a sine wave test tone.
So let me bring this up. I’m going to mute my piano part and bring up my signal generator plug-in from Pro Tools.b For a second, I’ll just unmute it so you can hear that this is happening. I’ll also bring out the Ozone plug-in. Rather than annoy you this tone the entire time, I’m going to mute it. You can still see it happening here. If I were to change my test tone down to 400Hz, it’s going to show up on my spectrum analyer here.
Now, let me introduce the same Air Lo-Fi plug-in that I was using before. I have a sampling rate here that’s going to be switched down to 12,000 samples per second, so my Nyquist frequency is going to be 6,000 Hz.
Over here on my Ozone plug-in, I’ve actually introduced kind of a brick wall filter that can act as an anti-aliasing filter and get rid of my high frequencies.
What I want you to see though, is if I change my sampling rate, and my sampling rate is 12,000 Hz, what happens as I start to change these frequencies as I go up from 400 Hz and I get to close to my Nyquist frequency, and even go above it. What ends up happening? I’ll start to sweep this up.
Again, 6,000 Hz is where the highest frequency – my Nyquist frequency – is.
So, I’m at 4,000 Hz now. Getting closer to Nyquist. Alright, I’ve reached Nyquist, and I’m going to start increasing above Nyquist.
What ends up happening is it actually starts getting reflected across my Nyquist frequency. Let’s say I’m up here at 8,000 Hz. The frequency that shows up – 8,000 is 2,000 Hz above my Nyquist frequency. What happens is the frequency that shows up here on the output that’s been aliased is 4,000 Hz. If I go up to 9,000 Hz here, 9,000 Hz is 3,000 above my Nyquist frequency. Now, the signal that I end up with is 3,000 Hz. It’s getting reflected across.
Go up to 10,000 Hz. Right, now I’m down to 2k and so on. And this continues. Now, what’ll happen is I’ll get up here close to my actual sampling rate of 12,000 Hz. 12,000 is going to end up at the frequency – if I type it in… of zero Hz. It actually doesn’t even show up. It looks like a signal isn’t even there.
If I go just above 12,000 Hz… 12,005, how about that one. You can see that we’re down near 5 Hz of what’s being recorded. 12,020. Now I’m at 20 Hz, and so on. I can go up to 14,000. 14,000 is 2,000 above my sampling rate, so the resulted aliased signal is all the way up at 2,000. Right? So you can see that it’s going to again get to the point at 18,000 that is identical to my Nyquist frequency, and then get reflected back over, and go back down once again.
So if I start all the way down at the bottom, I’m going to go up here to Nyquist, it gets reflected back over the other direction at 6,000, and continues all the way down until I get to 12,000, and then it goes back up again until I get to 18,000, and then it starts to go back down again.
Now, there’s a limit to my signal generator of 20,000 Hz, so I can’t go any higher than that. But hopefully what you’re able to see is that this pattern is going to continue as long as I increase the frequency. Therefore, the thing to understand about aliasing is that it is entirely predictable. For any given frequency above Nyquist, the aliased frequency can always be determined.
I hope this demonstration gave you guys a better idea about the concept of aliasing as it pertains to audio engineering. You can go in and set up your own Pro Tools session and experiment with this yourself too.
If you have any questions or confusions, feel free to post them below and I’ll try my best to answer them.
Take care, guys.