Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Dither vs Sampling Rate (Read 15462 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Dither vs Sampling Rate

If you're downsampling 44.1 or 48 kHz audio to 32 kHz, is it better to use dither with or without noise shaping? I would normally use noise shaping for a final 16-bit 44.1 kHz WAV file, but since 32 kHz doesn't cover the highest frequencies where dither noise would be the least noticeable, is it better to avoid noise shaping and just have "flat" noise, or is noise shaping still desirable?

Re: Dither vs Sampling Rate

Reply #1
Are you downsampling the bit depth?    I believe dither is only useful then reducing the bit-depth.

Do whatever sounds best to you!   But if you're downsampling to 16 bits (or more) you probably aren't going to hear the dither or the effects of dither so it probably doesn't matter if you dither or not, or if you choose to dither if you use noise shaping or not.

Re: Dither vs Sampling Rate

Reply #2
I'm not reducing the bit depth, but I'm pretty sure that dither always should be used when converting to 16 bit, as mentioned in this ancient thread on ssrc (which is the resampler I'm using):

https://hydrogenaud.io/index.php/topic,7133.msg71164.html#msg71164

I know that there isn't likely to be any audible difference as long as the result is at least 16 bit, but I was curious as to whether noise-shaping algorithms designed for 16 bit 44.1/48 kHz output will function the same way when the output doesn't cover the entire audible spectrum, as my understanding of noise shaping is that it tries to push the noise into frequency ranges where the ear is less sensitive, and 32 kHz (let alone something like 22.05 kHz) might not be able to represent the frequencies where the shaped dither noise might normally go.

Re: Dither vs Sampling Rate

Reply #3
Quote
I'm not reducing the bit depth, but I'm pretty sure that dither always should be used when converting to 16 bit, as mentioned in this ancient thread on ssrc (which is the resampler I'm using):
Converting to 16 bit means changing the bit depth. If the original is less than 16 bit, dither isn't going to be helpful. If the original is more than 16 bit, you are reducing the bit depth. Changing the sample rate while maintaining 16 bit does not benefit the data. Dither than makes a beneficial difference in the data when reducing bit depth. You are unlikely to be able to detect it audibly but it is, objectively speaking, a good practice.

Reducing the bit depth result in quantization distortion. Like other forms of audio distortion, it cannot be heard at levels below some certain threshold. It takes quite a bit more than a one time reduction to 16 bit to reach that threshold. On the other hand, reducing bit depth to 8 bit generally creates distortion well above that threshold.

Re: Dither vs Sampling Rate

Reply #4
At higher sample rates noise shaping shifts the noise to fully inaudible range (e.g. above 20 kHz). At 44.1 it is so-so (most noise shaping http://sox.sourceforge.net/SoX/NoiseShaping starts to "go up" at 14-15 kHz but depends on the shape how significantly). At lower rates it is even "worse" (i.e. space for noise shaping is smaller), but it may be still subjectively beneficial. That said my opinion is when using 16 bit, e.g. 96 dB SNR (or cca 93 dB with TPDF dither), using TPDF dither (or lightly shaped dither such as modified-e-weighted or low-shibata) should be enough if  that SNR is enough (which for nearly all purposes is). If we really need/want higher SNR, we can use noise shaping or 24 bit format.

Re: Dither vs Sampling Rate

Reply #5
I only bother with dither from (i.e. 24-bit to 16-bit) if the noise floor is greater than the 16-bit limit (-96 dB or lower).  If your source has noise at -80 dB for example then dither isn't necessary.  At that bit depth and depending on the loudness of your project it probably isn't even going to be noticeable at all.

Dither is just added noise that decorrelates the quantization error.  Shaping it to certain frequencies where the human ear is less sensitive reduces chances of audibility.

If your 44.1 KHz or 48 KHz source is already 16-bits then you shouldn't worry about dithering.  I be more worried about audible ringing caused by using a bad resampler then quantization error and any potential audible clipping if volume levels are very near 0dB (or digital maximum).

Re: Dither vs Sampling Rate

Reply #6
Converting to 16 bit means changing the bit depth.
I guess I should have been more clear. I've read that you should always use dither when the output is going to be 16 bits, even if it's not strictly necessary. I'm changing the sampling rate, but not the bit depth, so the converted file will be 16 bit, but the bit depth is not the thing being converted.


Re: Dither vs Sampling Rate

Reply #8
Converting to 16 bit means changing the bit depth.
I guess I should have been more clear. I've read that you should always use dither when the output is going to be 16 bits, even if it's not strictly necessary. I'm changing the sampling rate, but not the bit depth, so the converted file will be 16 bit, but the bit depth is not the thing being converted.

Back to first principles.

Dither for the purpose of audible sound quality is based on the idea that the quantization noise is going to be audible, and therefore we randomize the quantization noise to minimize its audibility.

In general,  the quantization noise associated with requantization to 16 bits is not audible when applied to audio recordings.

OTOH,  if I were requantizing some audio for the purpose of SOTA math analysis, there might be a justification for worrying about dither.

If you doubt any of this at all, it is incumbent on you to do some ABX-ing.   TOS-8 is out there encouraging you to act all ratiional and adult-like! ;-)

It's an easy test to set up and perform.  Download FOBAR2000 with the ABX plug-in and make some test files out of the music you are going to production work using  Audacity or some other good audio editor that you have on hand.


Re: Dither vs Sampling Rate

Reply #9
I be more worried about audible ringing caused by using a bad resampler then quantization error and any potential audible clipping if volume levels are very near 0dB (or digital maximum).
Ahem...and at what frequency would this ringing occur, pray tell?

But to feed further unsubstantiated paranoia, resampling requires requantization. If you are in fear that quantization noise error (not "quantization distortion"!) will be audible due to correlation, then dither is the proper treatment, even if you aren't changing the bit depth.

Re: Dither vs Sampling Rate

Reply #10
SoX for example works at 32bit integer internaly and creates new data from 16bit input. It dithers the output when the output will be 16bit. This is afaik common practise.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Re: Dither vs Sampling Rate

Reply #11
Ahem...and at what frequency would this ringing occur, pray tell?
Practically roughly 15 kHz when resampling to 32 kHz.

If you are in fear that quantization noise (not "quantization distortion"!)
Quantization distortion is, I think, the correlation of quantization errors with the signal, which I wouldn't call noise. Dither is what turns it into noise .. so you're actually adding noise.

will be audible due to correlation, then dither is the proper treatment, even if you aren't changing the bit depth.
If one dithers to 16 bit, then it would seem consistent to dither again after processing (done at a higher bit depth) and exporting to 16 bit again.

Assertions about audibility is where it turns into a religious war. ABX is free and simple, if this "issue" is worth the time.

"I hear it when I see it."

Re: Dither vs Sampling Rate

Reply #12
Ahem...and at what frequency would this ringing occur, pray tell?
xnor beat me to it.

But to feed further unsubstantiated paranoia, resampling requires requantization. If you are in fear that quantization noise (not "quantization distortion"!) will be audible due to correlation, then dither is the proper treatment, even if you aren't changing the bit depth.

I was referring to something that was already full of a significant amount of noise that still be there after resampling.  You could completely skip this step and have no consequences from it in that case.  The big giveaway to me that dither can safely be skipped would be a constant audible hiss in the background of the recording.

Re: Dither vs Sampling Rate

Reply #13
@Aleron Ives
To test the theory in an audible way just resample a 44k 8-bit file to 32k 8-bit.
Also, notice the truncated version has smallest file size when using same lossless compression settings.

Re: Dither vs Sampling Rate

Reply #14
I wonder why those discussions are so long (but maybe there is something about it, who knows ....) . If we use 16 bit, we can always use TPDF dither without harm and as far as I know even repeatedly if needed (multiple save etc.). If dither is not used whe have to rely on already present noise, if it is so, then probably dither is not strictly needed (but still does no harm). If somebody wants to he/she can use noise shaping to gain higher SNR in 16 bit "container", or use 24 bit. What is audible is very important, but what we do "physically" (theoretically) with the audio is also important.

32 kHz sample rate is very rare today, and TPDF is better for this rate since there is not much space to shape the noise to.

Re: Dither vs Sampling Rate

Reply #15
I wonder why those discussions are so long (but maybe there is something about it, who knows ....)
Because some people like to hijack a thread and inject their placebo opinions about the audibility of 16-bit dither and hi-res. Guess who is the one in this thread?


Re: Dither vs Sampling Rate

Reply #17
@Aleron Ives
To test the theory in an audible way just resample a 44k 8-bit file to 32k 8-bit.
Also, notice the truncated version has smallest file size when using same lossless compression settings.
I assume your example files had an intermediate ( 8->32->8 ) bit depth change, correct me if I'm wrong.
What if they didn't, and the resampling was done entirely at 8bit? Would it still produce some audible quantization noise/distortion without dither? Can this be tested?

Re: Dither vs Sampling Rate

Reply #18
I assume your example files had an intermediate ( 8->32->8 ) bit depth change, correct me if I'm wrong.
What if they didn't, and the resampling was done entirely at 8bit? Would it still produce some audible quantization noise/distortion without dither? Can this be tested?
Likely to be true, as stated by Wombat and xnor. To 100% make sure there is no bitdepth conversion in the whole process, I guess the only way is to write the program yourself.

Re: Dither vs Sampling Rate

Reply #19
What if they didn't, and the resampling was done entirely at 8bit?
IMHO such resampling will be much less accurate than good resampling at 32 bit.

What if they didn't, and the resampling was done entirely at 8bit? Would it still produce some audible quantization noise/distortion without dither? Can this be tested?
Zero-order hold and linear resampling don't need high intermediate bit depth. But their quality isn't very good.

Re: Dither vs Sampling Rate

Reply #20
SoX for example works at 32bit integer internaly and creates new data from 16bit input. It dithers the output when the output will be 16bit. This is afaik common practise.

I think its common practice because its more work for the programmer to identify the cases where the second layer of dithering is not needed and can be skipped. 

This is a subtlty that many many not be familiar with. 

Double dithering may slightly increase background, but usually not audibly.   Some of the early (ca. 1970s and 80s) AES and SMPTE papers about dither were  concerned about the noise that may be  added by  dithering and include it in their analyses. It generally turns out to be a nit.

Re: Dither vs Sampling Rate

Reply #21
Common understanding of up/downsampling must be to change samplerates. Your sample is 44.1kHz only? We had similar discussions and even at 24bit some experts dither such things.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Re: Dither vs Sampling Rate

Reply #22
Well, I also expressed my doubts/opinions about it here, especially in the past, but I think that the above summary is pretty clear given todays knowledge.

Nice current article about it here http://www.androidauthority.com/why-you-dont-want-that-32-bit-dac-667621/
What is there the big news regarding todays knowledge? New knowledge would be some jjf5 exclusive abx of music you offer to us deafies to countercheck.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Re: Dither vs Sampling Rate

Reply #23
I sent that article just because it is current and has some good points about consumer approach to audio and deals well with some common myths.

I do not think anybody here is deaf, nor I think that ABX is the holy grail of good and fruitful discussion about audio.

Back to the topic, I would welcome opinions/experiences on double/multiple TPDF dither (e.g. dither some file it is has already been dithered in the "past") - if it is theoretically/practically OK to do it (I think so but I welcome other experience).

Re: Dither vs Sampling Rate

Reply #24
As usual, people have to resort to 8-bit samples in order to demonstrate the audibility of dither.  Just like people use pure tones instead of real content and/or increase gain beyond the threshold of pain for normal content in order to show shortcomings.  Sometimes you get the disclaimer of inaudibility at actual operating conditions, sometimes not.

However, my bad earlier for neglecting that we were indeed discussing a 32k sample rate where ringing could be audible. All too often I see ringing (like quantization "distortion" or, ahem, jitter) being some evil demon needing to be exorcized, without any demonstration as to how it comes about and why it is a problem.

Then there's JJF5 and his continued desire to yammer on about what he believes are best practices without a whit of objective evidence.

Oh and another deleted post by Arnold because of improper quoting.

Carry on.