Hi all,
There is a lot of talk on these forum on how sampling rates affect the sound of a recording. Many claims are made about how increasing the sampling rate is always better. Terms like "higher resolution" or "more accurate" are thrown around. Some of it is true. Some of it isn't. This article attempts to bring some clarity on some aspects of the subject.
Some points I will try to address: (Time permitting)
- Are higher sample rates more accurate?
- Inter Sample Peaks
- Oversampling Converters and Anti-alias filters
- Processing at higher rates and why (and why not)
I might try to add more as I have more time. This post is subject to being edited at any time to add things, clarify things, correct errors etc. It started off in another thread (now deleted) so bear with me as I find time to adjust it to make it more generally applicable.
============
Are higher sample rates more accurate? ============
Let's start with some waveform pictures to get an idea where some of the misunderstandings about sampling come from.
The first picture is a 5Khz sine wave sampled at 44.1Khz as shown in Sound Forge:
The sine wave doesn't look much like a sine wave at all. It looks very jagged and spiky.
Now the same 5Khz sine wave but resampled at 88.2Khz also shown in Sound Forge:
Notice that as we have added sample points by resampling, in this application, the sine wave looks more rounded and less jagged.
And now the same 5 Khz saine wave re-sampled to 176.4 Khz.
Now this looks much more like as sine wave.
Based on these pictures alone and other similar waveform representations in other editors and DAWs, it would be easy to conclude that as we increase the sampling rate, we have increased the accuracy of the sine wave.
But there is an obvious snag in that theory: We started with a 5 Khz at 44.1Khz. How does Sound Forge know how to make the sine wave more rounded as we re-sample and add sample points? If the wave was not a proper sine at 44.1 Khz, Sound Forge would not know where to add the sample points to form the waves you see in the latter pictures. So what is going on here?
Here is a picture of that same 5Khz sine wave at 44.1 Khz but this time as shown in Audition:
This looks again like a proper sine wave. How is this possible?
The big difference between these two applications is that Sound Forge (at least this particular version) creates it's visual representations by simply drawing a straight line between the sample points.(The little blue squares). Audition on the other hand shows a picture of how the reconstructed waveform will look. The reconstructed waveform is the waveform that is actually produced at the output of your converters. The analogue signal. So how does Audition do this?
How do we go from seemingly jagged lines to nice curves in Digital Audio? Here is some background that might help to understand.
The clue to this whole story is the way that complex waveforms can be seen as a series of summed up sine waves. (Thanks to Mr Fourier for figuring that out).
To illustrate this, the following animation starts off with a single sine wave and adds an increasing number of odd harmonics to form what approaches a square wave:
The more odd harmonic one adds, the closer one gets to a square wave. With an infinite number of odd harmonics, we could create a perfect square wave. (And as we can never have an infinite number of anything, there are no perfect square waves in nature).
Here is a similar animation but this time we create a triangle wave:
The reason it becomes a triangle wave is because the level of the harmonics rolls off faster as they get higher compared to the harmonics of a square wave.
And here we have an animation of a sawtooth wave being created: (In this case we add even and odd harmonics)
Now, if you go in the opposite direction and start with a waveform that is a theoretical square, sawtooth or triangle wave and start removing the harmonics, as you progressively remove them, the rounder and more curve like the waveform becomes. The exact same thing happens if we start with a more complex but jagged and pointy waveform like the first picture in this post. Remove the harmonics (all those jagged and pointy angles in the waveform) of the signal and you end up with a smooth rounded waveform just like you see in picture two.
What are harmonics and how do we remove them? Harmonics are higher frequency sine waves that have a mathematical relation to the base frequency. And how do we remove higher frequencies? We filter them out with a low-pass filter and a low-pass filter is exactly what you will find in the output of any quality DAC.
If one were to start with a perfect square wave and remove all the harmonics and just keep the fundamental base frequency we would get a perfect sine wave. Not only that, we can mathematically predict every single aspect of that sine wave before we even start removing the harmonics. The same rules apply to sawtooth waves or triangle waves.
Thanks to the work of geniuses like Mr Fourier, Mr Shannon and Mr Nyquist, we also know that the same thing applies to complex periodic waveforms and even random waves. We can predict mathematically exactly what will happen when we filter out higher frequencies. That is why an application like Adobe Audition or iZotope RX can show us exactly what the reconstructed waveform (the one that has been filter by your DAC) will look like before it gets anywhere near your DAC!
This also brings us to the extremely important point in all these discussions about increasing sampling rates: It does not give us any more resolution! The increased sampling rate just allows us to sample higher and higher (inaudible) harmonics. There is not any more precision in the output within the frequency range we want to sample. The stuff we can hear. Again, this is important!
That waveform that looks like a jagged mess in some audio applications, just like in the first picture in this post, will look like the nice smooth wave in the second picture by the time it comes out of your DAC.
To drive the point home it is important to understand that our ears also function as low-pass filters. Even if you increase the sampling rate of your system, your ear is filtering out all those upper harmonics anyway!
I hope this brings some clarity to the topic.
Later I'll write about aliasing in (plugin) processing and how higher sampling rates can sometimes benefit this process (and sometimes not)...
Alistair