There is no doubt that producing music should be all about creativity and expression. Unfortunately, some technical difficulties and nuances, more often than not, get in the way of making art. Back in the day, audio engineers dealt with difficulties related to reel-to-reel tape and bulky analog tube equipment. Nowadays, we can enjoy the convenience of the digital world, but even it has its own limitations. Amongst which the aliasing in sound production could provide a challenge even for an experienced producer.
Aliasing in sound explained
Amongst the things we should worry about as audio producers, aliasing is not that big of a deal. But still, it could ruin an otherwise perfect project if improper settings are applied. To understand better what to do and how to avoid aliasing, we have no other choice but to dig a bit deeper into the theoretical realm of audio production. So if you don’t feel like attending a lecture on applied physics, feel free to scroll down to the conclusion. But if you are okay with a bit of extracurricular knowledge, enjoy the ride.
Basics of digital audio
Before we figure out what aliasing is and how to avoid it, we need to understand how it occurs. Unfortunately, that could not be done without a deeper understanding of what sample rate is.
The chances are that you already know how sounds occur naturally. But how can it be reproduced by the speakers connected to your computer? Analog and digital converters are responsible for that. Or, in this particular case, digital to analog converters.
Your computer is capable of processing and storing a lot of information but has to understand it first. That is why the simple soundwave needs to be converted into data. And in order to be converted and, as a result, stored in your computer, it has to be sampled first.
In digital audio, the sound is represented visually by a sinusoid, and sampling, basically, is a process of building dots out of which the sinusoid consists. Broadly speaking, that is. In order to tell our computers how many bits of information every sample should contain, we use the bit depth, which is the subject of another article. Since the sound has a fundamental quality of changing in time, samples should be measured periodically.
Basically, the sampling rate or sample rate frequency is the amount of samples taken per second. It is measured in Hz and is responsible for the frequency bandwidth of our audio projects. If you look into the settings of your DAW, you will see that the lowest sample rate frequency available is 44.1 kHz. And some DAWs allow you to go even higher than 192 kHz. So, which one should you choose?
Nyquist-Shannon sampling theorem states that sampling rate frequency should be double of the highest frequency desirable. In other words, to convert a continuous analog signal into a discreet one, you need a sample rate twice as big as the highest frequency you want to be sampled.
For example, if you have a sample rate of 44.1 kHz, your project will have frequencies as high as 22 kHz. As we all know, the threshold of the average human’s hearing is 20 kHz. Moreover, most people lose the ability to hear the frequencies that high with age. So it is safe to assume that a sample rate of 44.1 kHz gives us frequencies way higher than the hearing threshold. There is no reason to use higher sample rates, right?
The problem with digital sampling is that if something exceeds a so-called Nyquist frequency, it couldn’t be sampled properly. This means that some ultrasonic frequencies will be interpreted incorrectly and mismatched with frequencies in the audible range. And thus, you will have audible content that is harmonically unrelated to the frequency bandwidth you are working on. This content could be perceived as unpleasant distortion or artifacts and is called aliasing.
Aliasing is an effect that occurs when a reconstructed discrete signal differs from a continuous analog signal. The specific aliasing that occurs in digital audio is called temporal aliasing, and it is important not to confuse it with spatial aliasing, which appears in digital imaging. Aliasing happens when the continuous analog signal has frequencies that are above Nyquist frequency. Although inaudible by the human ear, those frequencies are misinterpreted by the processor as lower frequencies, and when the signal is converted back to continuous, are represented by unpleasantly sounding distortion.
So as we can clearly see, sample rates lower than 40 kHz are not an option which is great considering that our DAWs would not let us use the sample rate lesser than 44.1 kHz. Unfortunately, that still does not eliminate the problem of aliasing completely. We all know and love a tube overdrive. That is because when a signal exceeds the potential of the analog circuit, it results in a series of additional even harmonics. That kind of distortion sounds very pleasant and is rather desirable, especially by rock guitarists.
When the amplitude of a continuous signal exceeds the limit of the digital circuit, it leads to the addition of harmonics that are not related to the signal in musical terms. This is why the digital overdrive sounds horrible and exactly the reason why you should never overload your DAW. To put it simply, if a red light appears above one or several tracks in your project, you are clearly doing something wrong.
Aliasing is a well-known and researched effect that can happen because of the flaw in digital processing. And since that flaw could not be overcome, there are mechanisms in places designed to eliminate negative side effects of this flaw. First of all, since the digital calculations are based on the Nyquist theorem, we simply cannot sample at rates that are not suitable for our needs. Secondly, to make sure that even on proper sample rates, the aliasing does not occur, all DAWs and A/D converters implement anti-aliasing filters.
Anti-aliasing is a form of low-pass filters that are implemented throughout all of the converting stages in order to make sure that no frequency exceeds the Nyquist frequency. As it was said earlier, some signals may have some ultrasonic contents that we have no way of detecting. Those ultrasonic contents could be and will be misinterpreted by a converter which will result in aliasing. Anti-aliasing filters are designed to cut off those unwanted frequencies before the continuous signal is deconstructed in the digital one.
The good news is that we do not have to do absolutely anything about it. Anti-aliasing filters are incorporated within our DAWs and A/D converters and work automatically without the need for our interference. In this case, the only thing you should worry about is digital clipping since it occurs after the low-pass filter is applied and will result in severe aliasing.
Another point of concern is that some audio plugins can have their own internal sample rate, which may differ from the sample rate that you are using in your project. In this case, if those plugins apply some sort of non-linear processing to your tracks, some aliasing may happen regardless of the settings of your DAW. One way to overcome it is to apply a low-pass filter manually in a chain before said plugins. But some audio plugins have a built-in option of oversampling, which means they can increase a sample rate internally, apply anti-aliasing and downsample back without any audible artifacts.
Most high-quality plugins have that option as the default one, but some may need you to turn it on manually. You should look for an “HQ” button, or it will simply state “oversampling” and will give you an option of two times or even four times increased sample rate. Some A/D converters may also apply internal oversampling, but that is nothing to be concerned about since it also happens automatically. Essentially, oversampling helps to relax anti-aliasing filters since the higher sample rate will give you a broader frequency range. That means that using higher sample rates will result in a less steep filter curve and no audible, and therefore, useful content will be affected.
Aliasing in sound processing is a form of digital noise that occurs because digital processors cannot sample frequencies that are higher than the Nyquist frequency. The Nyquist theorem states that the sample rate should be double the highest frequency needed to be sampled. That means that the sample rate of 44.1 kHz should be more than enough for every modern project. But the sample rate of 48 kHz is considered to be a sweet spot since the higher sample rate lets anti-aliasing filters use a more gentle curve. This in turn won’t affect the frequency contents in the audible range.