• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Dithering is a Mathematical Process - NOT a psychoacoustic process.

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
64-bits float mantissa is 52-bits, 32-bit float mantissa is 24-bits.
If single has 24 bits mantissa, then double has 53 bits.
https://en.wikipedia.org/wiki/Singl...cision_binary_floating-point_format:_binary32
The true significand includes 23 fraction bits to the right of the binary point and an implicit leading bit (to the left of the binary point) with value 1, unless the exponent is stored with all zeros. Thus only 23 fraction bits of the significand appear in the memory format, but the total precision is 24 bits (equivalent to log10(224) ≈ 7.225 decimal digits). The bits are laid out as follows:
480px-Float_example.svg.png

https://en.wikipedia.org/wiki/Doubl...cision_binary_floating-point_format:_binary64
The format is written with the significand having an implicit integer bit of value 1 (except for special data, see the exponent encoding below). With the 52 bits of the fraction (F) significand appearing in the memory format, the total precision is therefore 53 bits (approximately 16 decimal digits, 53 log10(2) ≈ 15.955). The bits are laid out as follows:
480px-IEEE_754_Double_Floating_Point_Format.svg.png

Also, floating point values are always signed, so yet another bit of precision for both formats when doing apples to apples comparsion to integers (25 for float and 54 for double).
https://en.wikipedia.org/wiki/Singl...int_format#Precision_limits_on_integer_values
 

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
Dithering is only required when reducing bit depth—correct?
Dither is technically useful (I am not going to use "required") even when bit depth remains the same, for example if you are doing 32-bit float to 32-bit integer conversion, as 32-bit float can encode values way below -193dBFS.
 

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
For the technical heavies in this thread. Regarding any digital plug-in use in DAWs: […]
For non-MATLAB folk like me, what would be the best way to test plug-in linearity in a DAW?

Given a 64-bit float DAW environment, Bitter (FREE) is a useful plug-in which shows what a plug-in returns.

e.g. 1kHz sine generated in 64-bit float:

1581459445534.png


Following an EQ plug-in (filters all off):

1581459519473.png


Following a DIFFERENT EQ plug-in (filters all off):
1581459555093.png


Both are truncating to 32-bit float.

Most modern plug-ins are 64-bit float internally, but many will return 32-bit float back to the host application. Some are still 32-bit float internally.

Here is the older of the two EQ plug-ins referred to above, with a bell filter added:

1581460597127.png


And the more modern of the two EQ plug-ins referred to above with approx. the same bell filter added:

1581460672417.png



  • Dithering is only required when reducing bit depth—correct?
  • As such, if a plug-in truncates to 16 bits or lower, is dithering required at the end of the chain for a particular channel/bus or only at when you finalize the project given the 32bit/64bit FP environment of most DAWs?

Some plug-ins that are 64-bit internally but return 32-bit float will dither before truncation. Those that return fixed point 16-bit/24-bit etc. will usually have the option to add dither first (sometimes noise shaping also, e.g. in the case of various Waves limiters.) This can be a problem, actually, because then you have to manage the subsequent gain structure around the added dither, i.e. don't start adding too much gain or the noise floor will be far higher than it need be!

Strictly, dither is needed for all operations but then we get into the question of dither for floating-point and certainly at 64-bit float, truncation effects aren't generally anything to ever be concerned about.

(Hopefully the developer hasn't got into a mess e.g. with denormals.)

Incidentally, when Cakewalk (SONAR) moved over to 64-bit floating-point, I think it was the first DAW to do so (or certainly one of the first) and someone from Cakewalk wrote an AES paper showing that 64-bit float was needed in a mixer to achieve strict 24-bit performance. (i.e. 32-bit float is insufficient.) The (in)audibility of the difference (for mixing, i.e. scaling/adding) is a bit irrelevant to my mind given 64-bit float mixing is no problemo for a modern PC. :)

Yes, when exporting to a lower bit-depth add dither at the end of the "stereo bus" and not on every channel/sub-mix bus--unless exporting "stems" (i.e. sub-mixes) or individual tracks to lower bit-depth.
 
Last edited:

restorer-john

Grand Contributor
Joined
Mar 1, 2018
Messages
12,705
Likes
38,855
Location
Gold Coast, Queensland, Australia
Reading the actual data in the file the max and min values are +- 32766 with no clipped samples.

Thanks Scott. That was essentially what I suspected.

The Philips and the CBS-1 discs will trigger the 'over' lights on a range of my digital recorders (DATs etc)- the Denon of course will not. Recorders that look for consecutive full level samples and make the assumption the waveform is clipped.

So, back to dither. If the +32767/-32767 digitally generated Philips tracks have dither applied, doesn't that dither potentially (depending on the dither characteristics) push some samples "over" and technically into clipping?
 
Last edited:

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
Thanks Scott. That was essentially what I suspected.

The Philips and the CBS-1 discs will trigger the 'over' lights on a range of my digital recorders (DATs etc)- the Denon of course will not. Recorders that look for consecutive full level samples and make the assumption the waveform is clipped.

So, back to dither. If the +32767/-32767 digitally generated Philips tracks have dither applied, doesn't that dither potentially (depending on the dither characteristics) push some samples "over" and technically into clipping?

[Modified post since I made a mistake in thinking that the Philips tracks were undithered. True peak measurements/reconstructed waveform plot retained.]

Philips:

1581464179195.png


Waveform of undithered source with spectrogram underlay:

1581463997639.png


It can be seen that the "True Peak" maximum value in the "waveform statistics" shown above occurs at one of the "discontinuities" between different test tones.
 
Last edited:

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,705
Location
Hampshire
So, back to dither. If the +32767/-32767 digitally generated Philips tracks have dither applied, doesn't that dither potentially (depending on the dither characteristics) push some samples "over" and technically into clipping?
If the sine wave is generated with peaks at ±32765 before adding TPDF dither, the final result will be ±32767 without clipping.
 

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
The Philips and the CBS-1 discs will trigger the 'over' lights on a range of my digital recorders (DATs etc)- the Denon of course will not. Recorders that look for consecutive full level samples and make the assumption the waveform is clipped

Seem to recall Paul Frindle (SSL, Sony Oxford, etc.) said somewhere that when he was working on the Sony OXF-R3 console, Sony's digital recorders only illuminated "OVER" if several consecutive sample values were at peak value. Thus, to his chagrin, the console had to be designed to match this. I think he wanted it to show "OVER" in case of intersample values exceeding 0dBr.
 

restorer-john

Grand Contributor
Joined
Mar 1, 2018
Messages
12,705
Likes
38,855
Location
Gold Coast, Queensland, Australia
If the sine wave is generated with peaks at ±32765 before adding TPDF dither, the final result will be ±32767 without clipping.

This is what I am getting at. The maximum 7FFF is before sampling and quantization. Dither is added afterwards, just prior to quantization/sampling.

CBS CD-1 notes:
1581464046768.png
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,705
Location
Hampshire
This is what I am getting at. The maximum 7FFF is before sampling and quantization. Dither is added afterwards, just prior to quantization/sampling.

CBS CD-1 notes:
View attachment 49812
There is no mention of dither there. Rounding will not cause clipping. What I'd like to know is how to generate a signal digitally without sampling. I'll do a thorough analysis of the CBS track tomorrow.
 

restorer-john

Grand Contributor
Joined
Mar 1, 2018
Messages
12,705
Likes
38,855
Location
Gold Coast, Queensland, Australia
I think he wanted it to show "OVER" in case of intersample values exceeding 0dBr.

The assumption being several samples at full level meaning the sample had been clipped. (what was in between 'should' have been a higher value). I have no idea how many consecutive samples it takes to trigger the 'over' lights on any of my recorders or sound interfaces, but some are very pessimistic and not to be believed and others seem to let a fair number go by before flashing red.

The reason for all this investigation was primarily to get to the bottom of the following:
a) why the various prime frequencies on standard test discs and determine why they were chosen and also why aren't we still using primes?
b) why 0dbFS was not 0dbFS on some standard test discs.
c) the effect of dither on full level digitally derived sines on these test discs and the reporting of clipping on such tracks.
d) why the large difference in the 5th harmonic of 1KHz (~10dB less) on the Denon undithered track.
e) what arbitrary frequency (~1KHz) hits the most 16 bit theoretical values (exercises all the levels @16/44.1) as that is the one I figure I want to use.
 

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
I have no idea how many consecutive samples it takes to trigger the 'over' lights on any of my recorders or sound interfaces, but some are very pessimistic and not to be believed and others seem to let a fair number go by before flashing red.

Not withstanding the situation where you have absolutely no control over the input (e.g. live recording with no limiting), or trying to compete in the "loudness wars," there isn't any reason to ever quite be hitting 0dBFS, let alone potential intersample overs, unless you believe that without "normalising" to 0dBFS there is a loss of "resolution." ;-)
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,705
Location
Hampshire
The assumption being several samples at full level meaning the sample had been clipped. (what was in between 'should' have been a higher value). I have no idea how many consecutive samples it takes to trigger the 'over' lights on any of my recorders or sound interfaces, but some are very pessimistic and not to be believed and others seem to let a fair number go by before flashing red.
Two consecutive samples with maximum (or minimum) value is evidence of clipping or an intersample over.

If it were up to me, I'd trigger a warning if even one sample hits the limit. Modern ADCs have enough spare dynamic range that there's no reason to go there.
 
  • Like
Reactions: j_j

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
Two consecutive samples with maximum (or minimum) value is evidence of clipping or an intersample over.

Conversely the absence of the above is not evidence of the absence of intersample values >0dBr.

1581467161327.png
 
Last edited:

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
This is my "broader view" on audio degradation/distortion:
View attachment 49700

"For any recording you will hear exactly the same sound that was considered as final by creators of the recording in studio."

And if that sucks, then where is this "stunning audio quality"...?

"Based on absolute thresholds of human perception of sound"

Which is achieved through spectral analysis... right...?
 

scott wurcer

Major Contributor
Audio Luminary
Technical Expert
Joined
Apr 24, 2019
Messages
1,501
Likes
2,822
12 dB backoff for the rescaling seems to be overdone as I remember these intersample overs never exceed 3.5 dB as my memory serves me well..

There is actually a probability distribution which is difficult to compute. We had to study this for ADSL where crest factor reduction was important and a single over in a symbol could trash the data. In one of Archimago's blog posts he found a pathological case in a commercial CD. If you look at the cause it is not hard to push it even further but the probability of having exactly that sequence occur vanishes rapidly. By simply pushing individual samples around in Audition I could get well over 3.5dB.
 

scott wurcer

Major Contributor
Audio Luminary
Technical Expert
Joined
Apr 24, 2019
Messages
1,501
Likes
2,822
Can someone remind me again what we're looking for?

I understand the feeling. These track were by and large created over 30yr. ago by folks trying to figure out what gave the most information. Some of the frequencies on these test tracks seem to be chosen simply because they used power of two FFT's. IIRC the odd ones like 997Hz exercise more (all?) codes of the ADC, a good question might be is that even relevant with sigma-delta technology vs classical multi-bit.
 
OP
j_j

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,282
Likes
4,789
Location
My kitchen or my listening room.
There is actually a probability distribution which is difficult to compute. We had to study this for ADSL where crest factor reduction was important and a single over in a symbol could trash the data. In one of Archimago's blog posts he found a pathological case in a commercial CD. If you look at the cause it is not hard to push it even further but the probability of having exactly that sequence occur vanishes rapidly. By simply pushing individual samples around in Audition I could get well over 3.5dB.

There are a bazillionty zillion of intersample overs in actual data submitted for actual, real, commercial distribution. I even wrote an article here about it some time ago. DAC's do not all respond well to that, nope.

I'll look for the thread. https://www.audiosciencereview.com/...is-of-some-tracks-unprocessed-off-of-cd.3636/ That was annoyingly hard to find back there. Just look at some of the details. there. Look at the intersample overs. :O No tricks here.
 
Top Bottom