# When and why (not to) use high sampling rates



## Fredeke (Apr 17, 2019)

This is not really a question, it's more like sharing my thoughts. Also, it's for the nitpicker. It's ok to not care.

Assuming we're not sensitive to ultrasounds (that would be a whole other discussion!), I'd like to share the objective advantages and detriments I can still see of using high sample rates, in regard to specific situations. By high sample rate, I mean anything higher than 44.1kHz. So, 48kHz and above. Mainly above.

This thread is for summarization's sake. I made some of these arguments in that thread:
https://vi-control.net/community/threads/why-is-44-1khz-still-the-standard-for-music.79325
There I was educated in the reasons why 44.1KHz is theoretically enough for perfect rendition of any audible sound. I'm now convinced it is.

However...

- While 44.1kHz (or 40kHz, for that mattter) is enough to render any audible sound, a low-pass filter must be applied before (re)sampling to prevent artifacts, which in practice creates ripples in the audible range (not that I ever heard that but - some say). According to http://www.lavryengineering.com/pdfs/lavry-white-paper-the_optimal_sample_rate_for_quality_audio.pdf, a sampling frequency of 60kHz (hence a LPF at or just below 30kHz) would be enough to prevent those. Some converters can sample at 64kHz... Otherwise we're left with 88.2 or 96KHz.

- Noise shaping consists in moving dithering noise into bands we are less sensitive to. High SR allow to move it into the ultrasonic band, to which we are not sensitive at all. (A big price to pay for a small improvement, but still.)

- Since there is no reason why a given note's period should last a whole number of samples, looping high-pitched waveforms can cause clicks or pitch drift, due to the snapping of loop points to the nearest sample. Increasing the SR (when recording or by resampling) increases the precision of loop points' position.

- Sampling at high frequencies minimizes the loss of brightness when playing back at slower rates (like in the case of mapping one sample accross the whole keyboard, 20th-century style)

- Some plugins (and other software) sound better at higher rates, some say. (For example, VCV creator and main coder states that his instrument models analog circuits better at higher rates.)

Now about the cons :

- increased memory, cpu and bus bandwidth consumption
- due to the properties of capacitors (of which an AD converter contains quite a lot), conversion loses amplitude precision when happening faster, so there's kind of a tradeoff. (however I don't know if this still applies when converters sample the analog signal at the MHz rate and then downsample digitally, as some do)

All of the above addresses recording and processing. As for playback, I can't see any advantage, and I see at least one potential inconvenient:
- On some analog playback equipment, the presence of ultrasounds in the program can create intermodulation distortion within the audible range.
- That, and the files (or streaming throughput) are bigger, obviously.

Did I overlook anything ? I would also gladly welcome any objection (for my education ).


----------



## CGR (Apr 17, 2019)

I've gone down this 'rabbit hole' a few times and came to the conclusion that beyond a certain point it's all really lost on 99% of the listening audience. Give me high quality writing/composition, sensitive & expressive musicians in a sympathetic space interacting with each other and creating exciting/evocative music first, recorded by knowledgeable & skilled engineers before getting concerned about bit depths & high sampling rates (within reason of course).

I'm certainly not suggesting people abandon the quest for capturing music as purely as possible, but I'm often shocked at the equipment on which many people listen to music (built-in smartphone speakers and cheap Bluetooth speakers), so a lot of this extra detail is lost anyway on playback. I don't think we should aim for the lowest common denominator, but it all needs to be put into perspective in my opinion.

As a musician I appreciate good quality & high fidelity audio, but I don't want to become someone who overlooks the simple enjoyment of music and instead constantly looks for flaws or something "better".


----------



## Scoremixer (Apr 17, 2019)

Fredeke said:


> - Since there is no reason why a given note's period should last a whole number of samples, looping high-pitched waveforms can cause clicks or pitch drift, due to the snapping of loop points to the nearest sample. Increasing the SR (when recording or by resampling) increases the precision of loop points' position.



This specific part is incorrect. Provided you're talking about signals below the Nyquist frequency, they will be accurately captured by a properly-designed system. It seems intuitive to think that lower frequency signals have more sampling points and are therefore represented more accurately than those approaching the upper limit of the system bandwidth, but that's not actually the case. 

If you really want to understand more, you could check out Principles of Digital Audio by Ken Pohlmann (I've long since forgotten most of what I knew about the mechanics of the subject). Personally though, I wouldn't worry about any of it. Record with high quality modern converters. Use well-programmed plugins. Reserve high sample rates for sound design work and exposed, minimalist live recordings. Use 1x sample rates for everything else.


----------



## Tfis (Apr 17, 2019)

Watch the xiph.org videos.


----------



## Fredeke (Apr 17, 2019)

Scoremixer said:


> This specific part is incorrect. Provided you're talking about signals below the Nyquist frequency, they will be accurately captured by a properly-designed system. It seems intuitive to think that lower frequency signals have more sampling points and are therefore represented more accurately than those approaching the upper limit of the system bandwidth, but that's not actually the case.
> 
> If you really want to understand more, you could check out Principles of Digital Audio by Ken Pohlmann (I've long since forgotten most of what I knew about the mechanics of the subject). Personally though, I wouldn't worry about any of it. Record with high quality modern converters. Use well-programmed plugins. Reserve high sample rates for sound design work and exposed, minimalist live recordings. Use 1x sample rates for everything else.


My daily experience in looping samples contradicts this. (Maybe I should have mentioned I'm dealing in sound design.)

The point here is not about what happens in frequencies higher than nyquist, or interpolation, or anything having to do with sampling theory.
It is about avoiding steps in the waveform: It doesn't matter whether it occurs upon a whole 1/44.1 of a second or somewhere between them. A step is a click, and a click is a click. Sure, crossfades can avoid clicks to some extent, but it's also about pitch drift: if the period is off even less than 1/44.1 of a second, in a high-pitched note, the pitch change is audible. That is why some samplers provide loop pitch correction (which is another, debatably better, way of dealing with it).

I have read the litterature. It is indeed super instructive.



CGR said:


> I've gone down this 'rabbit hole' a few times and came to the conclusion that beyond a certain point it's all really lost on 99% of the listening audience. Give me high quality writing/composition, sensitive & expressive musicians in a sympathetic space interacting with each other and creating exciting/evocative music first, recorded by knowledgeable & skilled engineers before getting concerned about bit depths & high sampling rates (within reason of course).
> 
> I'm certainly not suggesting people abandon the quest for capturing music as purely as possible, but I'm often shocked at the equipment on which many people listen to music (built-in smartphone speakers and cheap Bluetooth speakers), so a lot of this extra detail is lost anyway on playback. I don't think we should aim for the lowest common denominator, but it all needs to be put into perspective in my opinion.
> 
> As a musician I appreciate good quality & high fidelity audio, but I don't want to become someone who overlooks the simple enjoyment of music and instead constantly looks for flaws or something "better".


I agree. I too listen to music on good enough systems, and that's good enough for me. But while some of my points are indeed obsessive nitpicking (like the one about noise shaping), others are not (like the one about more accurate loop points).

Also, I'm 45 and can't hear anything above 14.5kHz, so... Yeah that's perspective whether I like it or not .



Tfis said:


> Watch the xiph.org videos.


I have, some. They're great.


----------



## dgburns (Apr 17, 2019)

Well, tv standard is 48k 24bit so there's one good reason not to work at 44.1 ;0)

While working at 96k is too much of a burden for me cpu-wise at the moment, I'll gladly move up to that the minute I have the CPU headroom.


----------



## Fredeke (Apr 17, 2019)

dgburns said:


> Well, tv standard is 48k 24bit so there's one good reason not to work at 44.1 ;0)



As a matter of fact, _that_ doesn't matter, sound quality wise. Upsampling is completely transparent. (That is, given enough interpolation points that the signal within the conversion algorythm is virtually continuous - which is the case nowadays.)

At least that's what I understand from the litterature and videos on the subject. (Before reading and watching them, I would have assumed what you said too... Sorry I didn't keep the links at hand!) [EDIT: Here it is:  ]

The only downside of sample rate conversion I can see is that it taxes the CPU slightly more in realtime, and makes exports a little bit slower (especially with few or no plugins, which would tax the CPU much more anyway). That would indeed be one reason to work at 48kHz if you're doing a lot of TV and movies, but not a major one.


----------



## dgburns (Apr 17, 2019)

Fredeke said:


> As a matter of fact, _that_ doesn't matter, sound quality wise. Upsampling is completely transparent. (That is, given enough interpolation points that the signal within the conversion algorythm is virtually continuous - which is the case nowadays.)
> 
> At least that's what I understand from the litterature and videos on the subject. (Before reading and watching them, I would have assumed what you said too... Sorry I didn't keep the links at hand!)
> 
> The only downside of sample rate conversion I can see is that it taxes the CPU slightly more in realtime, and makes exports a little bit slower (especially with few or no plugins, which would tax the CPU much more anyway). That would indeed be one reason to work at 48kHz if you're doing a lot of TV and movies, but not a major one.



Well, IMHO after all this time in audio post and music comp, my pretty little pea brain prefers to resolve to all technical specs that the entire team is working at because it translates up and downstream from me. Plus if you get AAF's from video dept at 24/48, it's just asking for trouble to work at 44.1 imho!

If tv went to 96k as a delivery spec, I'd move to that and soldier on.


----------



## Scoremixer (Apr 17, 2019)

Fredeke said:


> My daily experience in looping samples contradicts this. (Maybe I should have mentioned I'm dealing in sound design.)



I see, I misunderstood. You must be dealing with some pretty granular samples!


----------



## Fredeke (Apr 17, 2019)

dgburns said:


> Well, IMHO after all this time in audio post and music comp, my pretty little pea brain prefers to resolve to all technical specs that the entire team is working at because it translates up and downstream from me. Plus if you get AAF's from video dept at 24/48, it's just asking for trouble to work at 44.1 imho!
> 
> If tv went to 96k as a delivery spec, I'd move to that and soldier on.


Right, I forgot about that !
Besides my student's films (which were on film anyway), I have no experience in AV.



Scoremixer said:


> I see, I misunderstood. You must be dealing with some pretty granular samples!


They're the grainiest analog synth sounds I can make . This issue arises mostly (but not only) when looping single wavecycles.

I'll release something soon.


----------



## JohnG (Apr 17, 2019)

Dan Lavry argues that anything above 88.2 or 96 not only is not helpful, it actually causes problems.

Here's his white paper on the subject:

http://www.lavryengineering.com/pdfs/lavry-white-paper-the_optimal_sample_rate_for_quality_audio.pdf

He says, among other things:

"It is always unwise and potentially harmful to include signals that are not needed; it is good practice to keep the signals that are needed, while keeping everything else out."

"There is no good reason for keeping what we don’t hear, because everything we heard in theoriginal performance is already there.

Sampling faster enables recording and keeping the energy that we do not hear. At best it will cause no harm. In reality there is a potential that keeping ultrasonic frequencies will cause unwanted audible alterations. One of the more well-known mechanisms for such alterations is imperfect linearity (non- linearity) in equipment. The type of distortions generated by non-linearity is called intermodulation, and such distortions are rather offensive in nature because the distortion energy is not harmonic. Harmonicdistortion tends to alter the timbre, it “colors the sound” by changing the relative harmonic content.Intermodulation is much worse, it is not related to the sound or its harmonics; thus it takes much less intermodulation distortion to become offensive to the ear."

--- Dan Lavry


----------



## Fredeke (Apr 17, 2019)

JohnG said:


> Dan Lavry argues that anything above 88.2 or 96 not only is not helpful, it actually causes problems.
> 
> Here's his white paper on the subject:
> 
> ...



Yes, I posted that link. It is an excellent article. However, my point was there may be situations in which a higher sampling frequency is desirable, for reasons other than conveying ultrasounds.

(I agree that conveying ultrasounds for their own sake makes little sense - unless you want to play the recording slower. The best and funniest argument I've ever heard against it is "any money spent on recording ultrasounds would be better spent in the audible range" . Plus, there may be crap in the ultrasonic range: hissing LEDs and displays, or other interferences...)


----------



## dgburns (Apr 17, 2019)

Difficult to know what's considered 'not needed'- won't proclaim to be an expert nor contradict Dan Lavry, of all people. Maybe we'll revisit this in 10 years and laugh when all the new research comes to light.

But my two very little cents - For some reason, I like the sound of my converters better at 96 then 44.1 or even 48.

But I can't hear over 15k so what the hell do I know, super lols !


----------



## Fredeke (Apr 17, 2019)

dgburns said:


> But my two very little cents - For some reason, I like the sound of my converters better at 96 then 44.1 or even 48.


I'm no conversion expert, but maybe there are actual reasons for that, that have nothing to do with ultrasounds...? Each converter has its own quirks.



dgburns said:


> But I can't hear over 15k so what the hell do I know, super lols !


Welcome to the club :-/


----------



## Tfis (Apr 17, 2019)

Fredeke said:


> The point here is not about what happens in frequencies higher than nyquist, or interpolation, or anything having to do with sampling theory.
> It is about avoiding steps in the waveform: It doesn't matter whether it occurs upon a whole 1/44.1 of a second or somewhere between them. A step is a click, and a click is a click. Sure, crossfades can avoid clicks to some extent, but it's also about pitch drift: if the period is off even less than 1/44.1 of a second, in a high-pitched note, the pitch change is audible. That is why some samplers provide loop pitch correction (which is another, debatably better, way of dealing with it).



1/44100 second 

An example would be nice what you are trying to do.

Don't you loop at a zero-crossing?
Did you try to resample?


----------



## bill5 (Apr 17, 2019)

Fredeke said:


> Yes, I posted that link. It is an excellent article. However, my point was there may be situations in which a higher sampling frequency is desirable, for reasons other than conveying ultrasounds.


Except there isn't. Anything above 48 is a waste of time and resources. Unless you can find something that samples around 50-60ish and good luck with that. Even 48 is probably a mild overkill about oh 99% of the time.

It is absolutely amazing how persistent the "more is better" thing is.


----------



## bill5 (Apr 17, 2019)

Fredeke said:


> I'm no conversion expert, but maybe there are actual reasons for that, that have nothing to do with ultrasounds...?


Yes, it's called confirmation bias.


----------



## vgamer1982 (Apr 17, 2019)

bill5 said:


> Except there isn't. Anything above 48 is a waste of time and resources. Unless you can find something that samples around 50-60ish and good luck with that. Even 48 is probably a mild overkill about oh 99% of the time.
> 
> It is absolutely amazing how persistent the "more is better" thing is.



You can record high sample rates for processing purposes, namely pitch shifting down an octave (and half speed) by playing 96k back at 48k. Super for sound design.

otherwise, anybody who thinks 96k sounds better than 48k is just kidding themselves. the difference in moving your head a few inches within your average acoustic space, like a control room, is orders of magnitude bigger than the effects on the audible spectrum, all else being reasonably equal.


----------



## Fredeke (Apr 18, 2019)

Tfis said:


> 1/44100 second


Right ! 



Tfis said:


> An example would be nice what you are trying to do.
> 
> Don't you loop at a zero-crossing?
> Did you try to resample?


Here's the example. I took the nerdiest approach 

The "recording" is a simple sine (of 4123Hz, if I remember well - it's a random pick) (at -6dB peak, btw, so beware the volume!)

As you can see, there are 7 periods in the loop. Any number of periods other than a multiple of 7, at the given sample rate (96k here), would have meant the last zero crossing would have happened between two samples. Which means the loop's end point could not have fallen on a zero-sample, while the start point does. That creates a step, no matter how you look at it. (In other words, mere zero _crossing_ is not accurate enough at such a high pitch.)

Try moving the loop points around in order to loop less than 7 periods, and you'll hear a subtle pitch change and/or a lower sub tone artefact due to the clicking. Try correcting that with a crossfading loop, I bet it will alter the problem without solving it. Try resampling to other frequencies to see how it affects things.

As you can see, this has nothing to do with ultrasounds, or any of the considerations usually mentioned in regard to sampling theory. It has, in fact, nothing to do with the potential audio fidelity of the sampling frequency. It only has to do with looping whole cycles, despite their period having no particular reason to be a multiple of the period associated to the sampling frequency (like 1/441*00*s, or rather 1/96000s here), while the loop's length necessarily has to be.
(I tried to do the math for the values used in this example, but it hurts my brain)

Or am I doing something wrong ?


----------



## LinusW (Apr 18, 2019)

I'm sampling sounds at 96 kHz. I'm producing music at 44.1 or 48 kHz depending on media.


----------



## LinusW (Apr 18, 2019)

I got a track for mastering last week. I zoomed in 20kHz and beyond and noticed two things. 
1. Running 96k on their interface made serious jitter spikes. 
2. Everything else above 22kHz were the vocals missing a deesser in mix.


----------



## Fredeke (Apr 18, 2019)

LinusW said:


> I'm sampling sounds at 96 kHz. I'm producing music at 44.1 or 48 kHz depending on media.


I tend to do the same... I say _tend_ because my system doesn't like sr changes without reboot (it lags for a minute and then half the software needs to be closed and reopened anyway), so I often remain at 96k for the whole day - but that's the only reason, and it's a pretty stupid one 

If not for that, I would record at 48k and sample at 192k.
(Just kidding. The main reason I don't sample at 192k is that some samplers can't deal with it - including my favorite ones, Renoise and Redux. I'm obsessive but not to the point of letting my obsession decide what are my favorite instruments.)



LinusW said:


> I got a track for mastering last week. I zoomed in 20kHz and beyond and noticed two things.
> 1. Running 96k on their interface made serious jitter spikes.
> 2. Everything else above 22kHz were the vocals missing a deesser in mix.


Yep. I sometimes need to clean up the ultrasounds too... which amounts to working with my eyes rather than my ears... which is weird and somehow feels wrong. But hey.


----------

