• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required as is 20 years of participation in forums (not all true). Come here to have fun, be ready to be teased and not take online life too seriously. We now measure and review equipment for free! Click here for details.

Alternative method for measuring distortion

KSTR

Addicted to Fun and Learning
Joined
Sep 6, 2018
Messages
532
Likes
1,236
Location
Berlin, Germany
Comparing file sizes isn't that meaningful as it all depends on the algorithm. An endless repetition of the same 48 sample values is of course easy to detect and pack. 7zip reduces it to 400bytes(undithered) and 90kB(dithered). FLAC was created to have a simple to implement (fixed point) and fast unpacking scheme that also is compatible with streaming, it's not optimized for making best use of inherent redundancy.

Since dither is a PWM submodulation of a PCM stream it of course retains information that would be lost otherwise when reducing bit depth or manipulating the data (even a simple level change requires a re-dither). That submodulation is harder to compress.
Note that adding a noise signal later to an undithered output (that was obtained by truncation or rounding) does not retain information although it almost looks the same like true dither and also shows the same compression ratio mismatches. File size difference tells us nothing in the end.
 
Last edited:

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,056
Likes
928
signal --> adding 1LSB dither (for 16 bit) --> encoding in 16 bit.
I encoded Ian Shepherd's voice from your favorite video in 4-bit, with only 1 bit being used. IMO the snippet I used is the most important message in his video.

Many dithering algorithms actually use +/-1 LSB, which means 2 LSBs, but the attached audio files are strictly 1 LSB.
1-bit.png
 

Attachments

OP
S
Joined
Dec 7, 2019
Messages
207
Likes
84
Thread Starter #224
since your premise is incorrect
At this stage/level of the discussion such “general” arguments are not enough. Please, elaborate - what exact premise you mean, why is it incorrect and provide the correct one.

No to all of these
Here I will show how linearizion of quantizer by means of dithering increase resulting quantization error. It is easy. Signal-to-Quantization-Noise Ratio of simple quantizer (rounding):

SQNRr = 20*lg( Srms / Qrms ), where Srms is RMS amplitude of a signal and Qrms is RMS amplitude of quantization noise.

When we add dither, which is perfectly uncorrelated to quantization error the expression for SQNR transforms as follows:

SQNRz = 20*lg( Srms / sqrt( Qrms^2 + Zrms^2 )), where Zrms is RMS amplitude of dither.

For simplicity we will assume that amplitude of dither is equal to amplitude of quantization noise = 1/2LSB. This gives us some estimation of quantization noise increase:

SQNRz = 20*lg( Srms / sqrt( 2*Qrms^2 )) = 20*lg( Srms / Qrms ) - 3.01 [dB]

In case of lower levels of dither (1/3LSB) the increase will be lower; in case of higher level of dither (triangular, 1LSB) the increase will be higher. In the example, which I already demonstrated [triangular, 1LSB, https://www.audiosciencereview.com/...ot-a-psychoacoustic-process.11169/post-322865] the increase equals to 4.8dB/5.6dB. In such cases df level measures the same physical quantity - degradation of signal due to quantization - in the same units and is reciprocal to SQNR, i.e. Df(dB) = - SQNR(dB). So, the increase of quantization error because of dithering is evident.

***​

Below are some excerpts from “Principles of Digital Audio” by Ken Pohlmann (Second Edition, you can borrow the full version for two weeks for free - https://openlibrary.org/books/OL2066359M/Principles_of_digital_audio); highlighting is mine:

001.jpg

002.jpg

003.jpg

004.jpg

005.jpg

006.jpg

007.jpg


Thus, (sorry for persistence) the one and the only reason for dithering quantizer in audio is “suppressing of any audible qualities of quantization error”. In particular, highly disturbing granular noise in quiet passages of audio is the reason for linearizing quantizer in this area and “pulling out” those below-LSB signals; even at the expense of increasing quantization error. The necessity to exchange one type of error (annoying) to another one (benign) is determined/required not by math but by psychoacousic features of hearing. The math in this case clearly shows that quantization error increases (by ~3+ dB). And from the math point of view there is no purpose to change the structure of quantization error, the more so - to increase its level. In other fields of application of quantizers (time series of measured medicine, financial, weather parameters) such “pulling out” of below-LSB information can be not essential (not required) and dithering is not applied before quantization. On the contrary, increased error of quantization could be harmful for some applications. So, dithering is not a universal technique, helpful in all cases. Its use is determined by application area; in audio its use is determined by psychoacoustics. In this sense I call it the psy operation, not the math one.
 
OP
S
Joined
Dec 7, 2019
Messages
207
Likes
84
Thread Starter #227
Even the simple examples of dithering in image quantization shows that it is prevents loss of information
yes, this is another area where dithering is beneficial, and also those benefits are due to features of human perception.
 
OP
S
Joined
Dec 7, 2019
Messages
207
Likes
84
Thread Starter #228
When I spent years getting data on molecular vibrations from interferometer signals well below the quantization limit, I had no idea I was using psychoacoustics. I'm glad someone set me straight. :D
In various fields of application dither can benefit to various purposes; I'm talking about benefits of dither in audio, where such benefits determined by psychoacoustics.
 
OP
S
Joined
Dec 7, 2019
Messages
207
Likes
84
Thread Starter #229
Why would this situation exist, of not knowing the application, and even if it did, then of what relevance would it be to audio?
It is just a thought experiment helping to understand the difference between engineering/math/syntactic and semantic levels of audio information.
 
OP
S
Joined
Dec 7, 2019
Messages
207
Likes
84
Thread Starter #230
Please stop with this false claim. The reason is PRESERVATION OF INFORMATION. This shows, precisely, why linearization is necessary, because you PRESERVE INFORMATION by adding noise. According to information theory that can happen when you have a nonlinearity.
The information you are talking about is relevant only in the context of hearing. Linearization is not the main goal/necessity, it is just a means for achieving the main goal - to reduce the annoyance of granular noise of quantization.
 

solderdude

Major Contributor
Joined
Jul 21, 2018
Messages
6,588
Likes
12,363
Location
The Neverlands
I would add - the loss of information, which is important for hearing. In other areas such information can be unimportant.
If it were unimportant in other situations I would argue it would not be applied there.
 
OP
S
Joined
Dec 7, 2019
Messages
207
Likes
84
Thread Starter #233
It doesn't matter where dither "comes from," as long as it has the required characteristics. How is "self-dither" not an indication that dither is universally needed to linearise the quantiser?
Self-dither does not require linearization of quantizer. Whether the signal is self-dithered or not can not be determined by math, only by ear. So, the necessity of linearization is determined by ear, not by math.
 

solderdude

Major Contributor
Joined
Jul 21, 2018
Messages
6,588
Likes
12,363
Location
The Neverlands
No doubt, it is beneficial for hearing, not for math.
This is an audio forum, per definition for hearing and reproducing music.
This is NOT about math and compression of file sizes... it is about the hearing.
Audio resolution exceeding that of the theoretical limit of say .. an 8 or 16 bit depth while making noise less obtrusive for the hearing by exchanging the sample errors by (shaped) noise.
I assume that last part is what you mean by a psycho acoustics decision.
Dither is not used for a psycho acoustic reason. It is there to linearize and obtain resolution (for lower to mid frequencies).
The frequency spectrum of the dither is the only psycho acoustic aspect of the dither itself when one attempts to minimize frequencies that the hearing is most sensitive to and to shift the noise frequencies as high as possible where it is less audible.

View dither as kind of an DSD stream in 1LSB amplitude but with a narrower audio bandwidth on top of the original bit depth where the noise is shifted upwards in spectrum and is very small in amplitude.
I would say inaudibly small under normal listening circumstances so why worry about it ?
 
Last edited:
OP
S
Joined
Dec 7, 2019
Messages
207
Likes
84
Thread Starter #238
The dithered file's higher entropy tells us it contains more information.
If you add more noise the entropy will increase more; if you add a lot of noise the entropy will increase even more; at some high level of entropy the original signal will disappear completely. Entropy and information are reciprocal.
 

SIY

Major Contributor
Technical Expert
Joined
Apr 6, 2018
Messages
5,015
Likes
10,153
Location
Phoenix, AZ
Exactly, adding randomness decreases information, not increases it.
Saying something incorrect over and over does not increase information.

Especially amusing is the complete ignorance of the sentences following your underlines.
 
Top Bottom