Question about sample rates from a user

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Hi! I am a plugin user and can't code for the life of me. I have a question, if I may ask, about sample rates. This question excludes the notion of nyquist and resulting bandwidth when using different sample rates - this is not a question related to human hearing bandwidth. My question is more about data, so please excuse me if I am way off the mark - as mentioned I am not a software engineer...

Does the plugin sample rate and bit depth have an effect on the accuracy of the computations in DSP code? If so, would this be audible?

My limited understanding leads me to think that more data means more accuracy and could be audible. In my own experience it does make a difference working at higher rates than 44.1k - I find project-renders at 96k sound smoother and sweeter than 44.1k (as long as all the plugins being used can "properly" work at different rates).

But who really knows... so I wanted to get an objective perspective on this from you software engineers.

thanks!

Post

The sample rate determines which range of frequencies you can represent.

The lowest frequency depends upon how long your sample is in seconds. The lowest frequency = 1 / length_in_seconds. So if you have a sound 1 ms long, the lowest frequency you can represent is 1 second / 0.001 seconds = 1000 Hz.

The highest frequency depends upon half the sample rate. The highest frequency = sample_rate / 2. This is called the "nyquist frequency".

For example at 44100 Hz sample rate the maximum frequency you can represent is anything less than or equal to 22050 Hz, assuming you have an infinite length sample. The phase accuracy depends again upon the length of the sample.

There is nothing outside this definition. There is no "how much information excluding bits and nyquist", that is how much information.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

aciddose wrote:The sample rate determines which range of frequencies you can represent.[snip...]
Ok that's useful. That's more about the Nyquist aspects. I was, perhaps niavely, asking about computational accuracy: example, comparing 48k vs 96k, 96k would have 2x more samples so that is in effect more data. would running a project 96k not only increase the audio bandwidth but also have any effect on the accuracy of the computations in the plugin (and therefore the accuracy of the resulting audio)? outside of the Nyquist aspects?

Post

The amount of information is all about frequencies. There is no other information at play to consider. The number of samples matters then with regard to phase information and so higher sample rates can increase the total amount of data. This doesn't matter in the context of music though because generally we're talking about data several minutes long.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

aciddose wrote:The amount of information is all about frequencies. There is no other information at play to consider. The number of samples matters then with regard to phase information and so higher sample rates can increase the total amount of data. This doesn't matter in the context of music though because generally we're talking about data several minutes long.
Ok thanks! I am going to dwell on this.. :)

When I render a project in 44.1k and then compare it to a render at 96k, I find the 96k version sounds, as I mentioned smoother, sweeter, clearer. Making an assumption that "44.1k is good enough" (as many people contend), I was wondering what else might cause this increase in percieved fidelity with the 96k render. I thought it might have something to do with more accuracy in the math. But I guess that's not it...

Post

Does sample rate increase "computational accuracy"? The answer will depend on the definition. On a practical level if your computation is non-linear, like distortion for example, then you generate harmonics that will exceed the available bandwidth. This will result in aliasing distortion. A higher sample rate will increase bandwidth and reduce aliasing. There are other examples where a higher sample rate would produce cleaner results.

Post

matt42 wrote:Does sample rate increase "computational accuracy"? The answer will depend on the definition. On a practical level if your computation is non-linear, like distortion for example, then you generate harmonics that will exceed the available bandwidth. This will result in aliasing distortion. A higher sample rate will increase bandwidth and reduce aliasing. There are other examples where a higher sample rate would produce cleaner results.
I do use a lot of analogue emulations that include harmonic modelling (eg. Nebula 4) and also harmonic saturators here and there. so perhaps that why...

Post

plexuss wrote:When I render a project in 44.1k and then compare it to a render at 96k, I find the 96k version sounds, as I mentioned smoother, sweeter, clearer. Making an assumption that "44.1k is good enough" (as many people contend), I was wondering what else might cause this increase in percieved fidelity with the 96k render.
If it sounds any different it is only because of the increase in bandwidth. So the anti-aliasing filters (if any) used by the software in question aren't good enough.

I often render at 192k rather than 48k where I'm using a lot of distortion, audio rate modulation or similar effects that produce a lot of aliased frequency content.

Where I'm not using them though: there is absolutely zero audible difference whether I render a track at 48k, 192k or 1000k (1 mHz).

There is a computational difference though, usually to render at 4x the rate requires at least 4x as much processing time and often even more due to overhead.

For example rendering the latest Xhip demo clip I posted to sound cloud:
Edited to replace with a comparison using higher modulation depths and feedback:
https://soundcloud.com/aciddose-1/sets/ ... comparison

There is a lot of aliasing here because of cross-modulation (FM), but this is actually a good thing. If I increase the rate to 192k the cymbal and bass sound very different and not "old-school FM" anymore but way too pure and boring. Most of the noise in the cymbal is actually aliasing noise and the high-frequency aliasing in the bass is what makes it sound so interesting with a ressy filter sweep.

So you need to be aware of exactly what and why you're using oversampling because sometimes a lower sample rate produces the effect you want while a higher one will be too pure.
Last edited by aciddose on Mon Oct 02, 2017 8:04 pm, edited 1 time in total.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

Higher sample rates have more accuracy in time. This is good for all type of delay effects. For example a reverb tail can sound way smoother due to the lower error-adding time issue (if the reverb is based on a delay network). In practice this is done within classic superb sounding hardware reverbs.

I also had one case where a filter worked more stable due to the smooth changes of the coefficients over time.

Post

plexuss wrote:Would running a project 96k not only increase the audio bandwidth but also have any effect on the accuracy of the computations in the plugin (and therefore the accuracy of the resulting audio)? outside of the Nyquist aspects?
There is also bitdepth to consider. Quantization error can become more pronounced as the sampling rate is increased, with some algorithms. EQ filters have this kind of error. The filters are most accurate with the least feedback. The result of quantization error is harmonic distortion. A good example of this is a highpass filter tuned at a very low frequency, as sample rate increases the quantization error can be seen on a spectrum graph, as increased distortion.

Post

camsr wrote: There is also bitdepth to consider. Quantization error can become more pronounced as the sampling rate is increased, with some algorithms. EQ filters have this kind of error. The filters are most accurate with the least feedback. The result of quantization error is harmonic distortion. A good example of this is a highpass filter tuned at a very low frequency, as sample rate increases the quantization error can be seen on a spectrum graph, as increased distortion.
It sounds like (pun intended) that there are aspects to higher sample rates and larger bit depths that can have positive audible effects other than analogue bandwidth. Is that a fair statement?

Post

He was describing negative effects. Technically though quantization is a consideration unrelated to the sample rate and only gets mixed up in it with poorly designed algorithms.

With an algorithm that operates on derivatives instead of absolute values there will be minimal differences in absolute magnitude which will minimize quantization error. The naive method is often a poor choice, all things considered.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

Quant error can be magnified by poorly designed recursive filters. e.g. High-order filters that are not expressed as cascades of many low-order filters will propagate error more quickly. As for higher sampling rate, the aim is to expand the spectral head-room so that waveshaping operations fold back into the inaudible regions where anti-aliasing filters can safely cull them away.

Post

plexuss wrote:When I render a project in 44.1k and then compare it to a render at 96k...
FWIW I never switch to a different sample rate for rendering because plug-ins can be so unpredictable in their response. Not so much that they sound better, more that they sound completely different.

IIRC Ohmicide's sound changes significantly, then you've got FFT based plugs (or indeed anything) involving measuring something directly in samples. The most egregious example I've found is in Cyclop where the 'true' value of the formant control scales linearly with sample rate when using the transformer oscillator - it just isn't compensated for at all, meaning 48 kHz to 96 kHz results in a octave shift. Especially annoying as Cyclop sounds much nicer at 96 kHz otherwise, particularly with the additive oscillator.

If I noticed an obvious difference between 96kHz and 48kHz, my first thought would be to find the 'broken' plug-in rather than putting it down to increased accuracy. Don't get me wrong, I've no doubt you are hearing increased accuracy a lot of the time! Still, so many things can change that I tend not to bother trying.

Post

AFAIK, the higher the samplerate is the better the construction of audio data in human hearing range can be achieved. Example: 10kHz signal @ 44.1kHz is constructed using 22.05/10 samples when @ 192kHz there are 96/10 samples for the job. As instrument range can go up to 16kHz (and even higher in digital world) it's quite clear there can be hearable difference between redbook resolution and high resolution audio. Bad thing is that you need to have dithering and steep filtering when down converting from high resolution to redbook format which then may result to worse than what you could have had by keeping it redbook format all the way (this depends on instrumentation you have there of course).

BTW, I've noticed that (at least in (older) Cubase SE and Reaper) there are many VST effect plug-ins which does not work correctly in high resolution projects because of these usually gets initalized for 44.1kHz when project is opened. Another minus has been that in some cases presets are somehow samplerate specific - a preset done @ 44.1kHz doesn't give same result @ 96kHz (otherwise ok but the cutoff frequency gets changed).

Post Reply

Return to “DSP and Plugin Development”