Samplerates. Is bigger better?

The part you're forgetting is D/A converters. You're not hearing those discrete samples. What you end up hearing is reconstructed from those samples, and is a perfect (well, depending on the D/A converter quality) reconstruction of that sine wave. This just follows from the Nyquist theorem.

I'm not sure I follow how that is possible. Unless I'm mistaken we aren't talking about pure sine waves here. How can the D/A converter reconstruct a waveform from a source where most of the information has been lost? I understand that we aren't hearing discrete samples on output, given that the D/A has to construct a flowing, contiguous analogue waveform. However, it would have to estimate what occurs between those two samples and unless we are talking about pure sine waves here, it would lose information, or create an approximation at the very best.
 
The sync function gives us a perfect recreation of the analog waveform. Iirc, there's only one wave that can possibly fit the samples/points, and the accuracy of a D/A depends on how long of a sync function is used (it is infinite).

Someone correct me if I'm wrong. This class was a few months ago. ;)
 
Ampsims work better at higher sample rates.
Reverbs work better at higher sample rates.
Synths work better at higher sample rates.
etc etc...

Most quality plugins oversample internally.

But those that don't...

You have to oversample them externally.
 
High sample rates and oversampling are two different things.

One is the amount of sampling the entire system does per second and the other is expanding the highest working frequency by X amount, locally, for a specific process to contain fold-back or 'alias' frequencies out of an audible range.

Recording at higher sample rates does not give you more information or better audio quality. Nyquist tells us that in order to sample audio correctly, we must double the highest frequency of the audible range, which for humans is roughly 20 Khz. 44.1 is more than sufficient or if it were a range, some where between 44.1 to may be 60 khz. This esepcially holding true for properly designed AD converters. The things that people hear when they do record at higher sample rates is not better audio but altered audio. Working at high sample rates causes converter systems to work hard which may impart distortions on the audio that some attribute to "better". Technically, there is no moreinformation to be had past 20 Khz (44.1 SR). As far as processing goes, especially non-linear processes that impose alias frequencies, local and temporary upsampling is beneficial. Again not because it is adding more "data" but because it takes the inharmonic frequencies created by the processes that would otherwise fold back into the audible range and contains them above 20 Khz.

Using high system sampling rates such as 192 not only wastes disc space but risks, as mentioned before, more noise being imposedon the signal. Don;t forget the higher the rates, the faster and harder the system has to work.

Addressing the visual aspects of seeing "more points", schnarf2 essentially got it right. There are only so many points needed to represent the waveform. Remember the quality and dynamic range of the audio source is dependent on Bit Depth. When that is sufficient, a system SR of 44.1 Khz also satisfies Nyquist.
 
I'm not sure I follow how that is possible. Unless I'm mistaken we aren't talking about pure sine waves here. How can the D/A converter reconstruct a waveform from a source where most of the information has been lost? I understand that we aren't hearing discrete samples on output, given that the D/A has to construct a flowing, contiguous analogue waveform. However, it would have to estimate what occurs between those two samples and unless we are talking about pure sine waves here, it would lose information, or create an approximation at the very best.

Well, haha, basically the point is, no information has actually been lost! If you're interested in some nitty gritty I've written it up, you don't have to understand all the math but I've tried to write it clearly enough that you can at least get the gist.

And we're not talking about pure sine waves, but I'll try to simplify some math for you and explain why it's still relevant. First of all, Joseph Fourier showed that you can decompose functions (or an analog signal) into a sum of sine waves with phase offsets. So given any analog signal, or discretized signal, we can view it as a composition of sine waves.

This is actually part of how we talk about linear filters, and the reason that we're able to easily analyze filters like lowpass, bandpass, any of the nice outboard EQs, etc. A linear filter is a filter, call it H, so that H(a + b) = H(a) + H(b). In other words, say you mix some drums together with some vocals and put it through a reverb or an EQ or something. The output will be the same as if you had individually applied the reverb or EQ to the vocals and to the drums, then summed them together after. This is what it means to be a linear filter.

Now, how does this come back to sine waves? It turns out sine waves (and more generally any exponential function) are called "eigenfunctions" of linear filters. Don't be put off by the fancy name. It just means that a sine wave, put through a linear filter, can only have two things done to it: the amplitude can be changed by a constant amount, and the phase can be changed by a constant amount. So for example, a 1 ms delay is a linear filter. A pitch shifter is not because it changes the frequency.

So let's put it all together: a linear filter, given a sine wave, is only going to change its amplitude and phase by a constant amount. A signal can be decomposed into a sum of sine waves. And because linear filters are linear, we can decompose a signal into sine waves, and look at how the filter will operate just on those sine waves, to fully characterize how it works. This is why you see magnitude and phase responses. A magnitude and phase response totally characterize a linear filter. Most importantly you can think of any linear filter in terms of what it would do to an individual sine wave.

The A/D and D/A conversion is pretty much linear, mathematically speaking, particularly in the sense that converting the sum of two digital signals to analog, and converting the two signals individually to analog then summing, will give you the same result. Practically it is not because the converters aren't perfect. But what this means is we can talk about how they work on sine waves, and that will tell us how they work on anything!

Now, you feel like to interpolate a discrete signal to get an analog one, you have to approximate. Again, the Nyquist sampling theorem says that you don't because no information is actually lost (when the signal is band-limited, meaning lowpassed, which it is). As an analogy, think of drawing a bunch of line segments. You could encode the entire line and have a whooooole lot of points. In fact there are infinitely many points in that line, you can't store it digitally. But you could just store the endpoints. And if you wanted to, you could recreate that line exactly from the endpoints. You're not losing any information even though you're seemingly throwing a bunch of points away. Even though it seems more complex, you can do the same thing with sine waves. And as we established, any signal is a sum of sine waves, and a linear filter operates on a signal just as if it were operating on those waves individually. So if we have a filter that can interpolate between those sine waves, it can interpolate the whole signal.

More mathematically, the way we do that is with a [windowed] sinc filter, which is just an ideal brickwall lowpass filter. If our sampling frequency is, say, 48000 Hz, we want a sinc filter with a cutoff at 24000 Hz. An ideal mathematical sinc filter is infinitely long, and has an infinitely steep cutoff, but in the real world that doesn't exist, but we can use a sinc filter that's long enough that it really doesn't matter. And the sinc filter is able to interpolate between all the points of this signal to recreate the analog signal. If it helps you to think about why, the sinc filter itself is actually the sum of all sine waves from 0 Hz to the Nyquist frequency, half the sample rate, in this case, 24000 Hz.

I can't give you a much more in depth answer on how or why this interpolation actually works without getting into some in-depth math but I will if you'd like. If not, try to think of it in terms of that line-drawing analogy I gave you, keeping in mind what I said about how linear filters operate on sine waves. In particular, can you imagine how you could, given a bunch of discrete equally-spaced points from a sine wave, mathematically reconstruct the analog sine wave?

Let me know if you need any clarification on anything, like I said.

One last thing: in the real world it doesn't work exactly like these mathematical idealizations. Most importantly the idealized sinc filter doesn't exist, that's why we get a little bit of digital aliasing. When digital was new, 44.1k wasn't really enough because the A/D converters were pretty awful. These days they're very good and 44.1k is probably enough -- the aliasing is so minimal.
 
You know what doesn't help the confusion are the camera/pixel analogies.

Don't look at SR like that. Bit Depth is more applicable to that analogy. SR only represents frequencies.


Also just to make clear: "Bit Depth" represents out signal's dynamic range. "Bit rate" applies technically to program file compression, like when you create an MP3's
 
@schnarf: Thanks for the run-down. I had a read through and what you say makes sense. My mind keeps bringing me back to the simpler analogies like your line one. I understand that you can map the endpoints and recreate that line, and it's the same principle with interpolation. What I'm concerned about is what is lost between the endpoints if say it wasn't a perfect line, but had a bump in the middle. Now I know you were trying to answer that thought by saying that all signals are composed of sine waves, so if we have at least two discrete points through the cycle of the waveform mapped, we can recreate it. However the actual program material would be more complicated than single sine waves, so are you saying there are some mathematical processes that reduce the program material to 'the sum of its parts', so to speak, and reproduce the output purely from sine waves?

I don't know whether it's possible to answer my questions without going into the heavier math you were talking about, but I still can't quite get my noggin around the idea that no information is actually lost. I mean surely even in a practical scenario, having a piece of technology try to recreate a waveform from such limited information results in problems? Assuming we're not talking ideal math scenarios but real world where deficiencies and imperfections do exist. Would higher sample rates at the very least shift this aliasing up into the higher registers were humans aren't capable of hearing?
 
This brings back fond memories of last semester :)

Ermz,

Indeed, there are no "bumps" in the line analogy. There can't be because the line was sent through a low-pass filter before it was even sampled. Does this make sense? I'm combining the analogy with actual life haha
 
@schnarf: Thanks for the run-down. I had a read through and what you say makes sense. My mind keeps bringing me back to the simpler analogies like your line one. I understand that you can map the endpoints and recreate that line, and it's the same principle with interpolation. What I'm concerned about is what is lost between the endpoints if say it wasn't a perfect line, but had a bump in the middle. Now I know you were trying to answer that thought by saying that all signals are composed of sine waves, so if we have at least two discrete points through the cycle of the waveform mapped, we can recreate it. However the actual program material would be more complicated than single sine waves, so are you saying there are some mathematical processes that reduce the program material to 'the sum of its parts', so to speak, and reproduce the output purely from sine waves?

I don't know whether it's possible to answer my questions without going into the heavier math you were talking about, but I still can't quite get my noggin around the idea that no information is actually lost. I mean surely even in a practical scenario, having a piece of technology try to recreate a waveform from such limited information results in problems? Assuming we're not talking ideal math scenarios but real world where deficiencies and imperfections do exist. Would higher sample rates at the very least shift this aliasing up into the higher registers were humans aren't capable of hearing?
Basically, yes, there's a mathematical process that reduces the waveform to the sum of sines. But it's not as complicated as it seems. Like, there is a way to do that, it's called a Discrete Fourier Transform, and it's used in DSP all the time, but that's actually not necessary. It's really just by virtue of this interpolation process being linear (a concept that I explained above).

For example, a lowpass filter is a linear filter, and you could think about it in terms of acting individually on every sine wave present, because it changes the gain depending on frequency! In one sense, it looks at every frequency present, and determines the output gain of that sine wave according to its frequency. But that's not really what it's doing; the filter itself is much much simpler than that. Basically, with some very simple equations, it's doing something that seems very complex.

Maybe that last paragraph wasn't clear. In other words, in a sense, the interpolation process individually acts on each sine wave present. In another sense, it doesn't really have to do that much work. If we can define a way to interpolate that would work on a single arbitrary frequency sine wave, and we can make that interpolation satisfy the requirements of being linear (H(a + b) = H(a) + H(b)), then that interpolation process will work on anything! And indeed we can. Does that make any more sense? In the simplest words possible, as long as you can interpolate sine waves with some linear process, you can interpolate any bandlimited signal.

As far as aliasing, resampling and interpolation (pretty much the same thing) work in two steps. First add (in the case of interpolation or upsampling) or remove (downsampling or A/D conversion) a bunch of samples. If we add samples, set them to zero. This leaves you with the signal you want, plus a bunch of aliasing that is out of range. Practically speaking, say we're converting 48k digital audio to analog. We end up with analog audio plus some aliasing, all of which is at higher than 24k because of some nice math. Then we use that windowed sinc filter, to lowpass the signal at 24k, which removes the aliasing. In practice, there aren't ideal sinc filters but we can get really close. Also remember that 44.1k is basically enough, and 48k provides a pretty comfortable margin. Also, D/A and A/D converters often oversample internally (they work at a higher sample rate) and that's one of the ways they cope with aliasing. So again, on a good A/D or D/A converter, 44.1k or 48k should be enough.

Yes, working at 96k would provide a little more room for error. But I'd believe it would be a pretty negligible difference, and would mean twice as many samples, so twice the CPU load. Not really worth it in my opinion.
 
This is extremely true. I stand corrected.


Are you absolutely sure that 88.2khz records to double the frequency, or adds more data within the frequencies it records?


BOTH. not only does it sample twice as many times, the cutoff freguency becomes 44.1khz because of the quicker sampling.