• 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!

Quantization Noise 101: Where does SNR about 6N dB come from?

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,491
Likes
4,119
Location
Pacific Northwest
Your explanation, while more complex, has the advantage of explaining the extra +1.761 dB factor.
On further thought, it's even more interesting than that. The intuitive numerical approach that @MusicNBeer and I mentioned puts 6*N as an upper bound on the dynamic range of N bits. That's because the first bit just rises just above the noise - assuming the lowest or LSB is randomized/dither added to the signal, so its value is a signal-weighted or biased random. Since the first bit gives you less than 6 dB, the total is something less than 6*N. Yet @DonH56 's explanation shows that 6*N is a lower bound, saying the dynamic range is slightly greater than that.
 
Last edited:
OP
DonH56

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,915
Likes
16,746
Location
Monument, CO
On further thought, it's even more interesting than that. The intuitive numerical approach that @MusicNBeer and I mentioned puts 6*N as an upper bound on the dynamic range of N bits. That's because the first bit just rises just above the noise - assuming the lowest or LSB is randomized/dither added to the signal, so its value is a signal-weighted or biased random. Since the first bit gives you less than 6 dB, the total is something less than 6*N. Yet @DonH56 's explanation shows that 6*N is a lower bound, saying the dynamic range is slightly greater than that.
I had previously started a long post explaining the pros and cons of the simpler dynamic range concept as related to 2^N instead of going to PDFs and such, but lost it in the process, and decided it was just not worth it. And I think I mentioned previously that I tend to think of dynamic range in terms of SFDR and not SNR, a consequence of my early days dealing with this stuff. The hand-waving explanation offered to me in the past was that you have a little extra fudge factor in SNR since the error (variance) corresponds to about +/-1/2 an lsb and not a full lsb. But it is not just 3 dB, thus the long-winded math to accurately describe the error and resulting SNR. And dither is not any part of my calculations; that adds noise, and leads to fairly complicated integrals depending upon the type of dither added. We were adding band-limited colored noise so the PhD systems gurus used convolution theory to estimate the SNR, and SFDR was derived numerically as the integrals did not appear to have closed-form solutions. I do not recall those equations, they are not in my basic notes from way back then that I ran across for this article, and I have zero interest in trying to find them again. They made my head hurt. I'll leave that to you mathematician types. :)

Decades ago when I started all this we had created essentially "ideal" data converters and confirmed the extra 1.8 dB was real.
 
Last edited:

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,491
Likes
4,119
Location
Pacific Northwest
... Decades ago when I started all this we had created essentially "ideal" data converters and confirmed the extra 1.8 dB was real.
Interestingly, the difference between the 2 methods is bigger than that.
To be more precise, using ratio 2.0 as 6.021 dB: the 2^N approach leads to 16*6.021 - 0.5*6.021 = 93.32 dB
Your method gives 16*6.021 + 1.761 = 98.09 dB
The difference is 98.09 - 93.32 = 4.77 dB.
 
OP
DonH56

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,915
Likes
16,746
Location
Monument, CO
Interestingly, the difference between the 2 methods is bigger than that.
To be more precise, using ratio 2.0 as 6.021 dB: the 2^N approach leads to 16*6.021 - 0.5*6.021 = 93.32 dB
Your method gives 16*6.021 + 1.761 = 98.09 dB
The difference is 98.09 - 93.32 = 4.77 dB.
This is over my head, probably beyond the scope of this thread, and honestly not something I am vested in resolving since "my" way is accepted by the IEEE Standards and has been around "forever". I suspect the difference is due to using a simple linear'ish estimate of dynamic range based on the number of codes vs. taking into account the variance from the noise (like) quantization error compared to signal variance. Estimating based just upon the number of bits (codes) does not take into account the (noise) profile of the quantization error and probability of where the signal lands with respect to the quantization thresholds (lsbs). That is why I made the post...
 

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,491
Likes
4,119
Location
Pacific Northwest
This is over my head, probably beyond the scope of this thread, and honestly not something I am vested in resolving since "my" way is accepted by the IEEE Standards and has been around "forever". I suspect the difference is due to using a simple linear'ish estimate of dynamic range based on the number of codes vs. taking into account the variance from the noise (like) quantization error compared to signal variance. Estimating based just upon the number of bits (codes) does not take into account the (noise) profile of the quantization error and probability of where the signal lands with respect to the quantization thresholds (lsbs). That is why I made the post...
And I'm glad you took the time to make that post because it explains the difference for those who want to dig beyond the simple intuitive 2^N derivation.
 

pseudoid

Master Contributor
Forum Donor
Joined
Mar 23, 2021
Messages
5,198
Likes
3,547
Location
33.6 -117.9
This post attempts to explain where the SNR = 6N dB approximation comes from. ASR does not have the symbol font available, and after an hour or so of trying to fix things, I ended up just pasting the whole thing as an image. Sorry about that! I did attach a PDF of the original.
Thank you for the tut, @DonH56,
Is this the similar routine that @amirm's AP uses to derive the published 'SNR' results?
Although, there are no time/frequency dependencies, as shown in your *.pdf.
 

pseudoid

Master Contributor
Forum Donor
Joined
Mar 23, 2021
Messages
5,198
Likes
3,547
Location
33.6 -117.9
It took me long enough to type in this one, not used to equations in Word, then got blindsided because I couldn't copy and paste it here without losing the symbols.
TLDR: Don't bother, it will be in vain. :(
Office/Word® has always been handicapped at handling most math-notations.
Some older versions of Office/Word® (e.g. 2010/2007) require user to install the 'equation' tool manually:
From /*Add or Remove Features/*Office Tools/Equation Editor/*Run from My Computer/*Continue/*Close wizard.
Use /*Insert Equation on floating ribbon thingy.
(note: Older Word® had a link for "More Equations from Office.com" but has always been as useless as using a cash-register for the purpose.)
 

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,491
Likes
4,119
Location
Pacific Northwest
I find that Libreoffice handles equations nicely, the Math equation editor "integrates" (;)) easily with Writer. And the Libreoffice apps read and write the formats for MS Office docs across various versions & platforms. And they are open source and free with native clients for Mac, Win and Linux.
 
OP
DonH56

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,915
Likes
16,746
Location
Monument, CO
Thank you for the tut, @DonH56,
Is this the similar routine that @amirm's AP uses to derive the published 'SNR' results?
Although, there are no time/frequency dependencies, as shown in your *.pdf.
This is the math behind quantization noise so pure theory. And true time/frequency drops out of the derivations, and don't even appear in this version. They actually sort-of do, but I left them out since they cancel everywhere. In some ways using probabilities makes the math easier.

The AP measures the noise directly, does not do these sort of calculations, but you can see how close you get to the ideal. However, SNR measurements usually include everything except the harmonics, so it's good to see the FFT (frequency) plot and not just the raw number. Things like power supply noise, clock spurs, and such can enter into the SNR number and sometimes make certain noise spurs (tones, frequencies) more or less objectionable than just the raw SNR number indicates.
 
OP
DonH56

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,915
Likes
16,746
Location
Monument, CO
TLDR: Don't bother, it will be in vain. :(
Office/Word® has always been handicapped at handling most math-notations.
Some older versions of Office/Word® (e.g. 2010/2007) require user to install the 'equation' tool manually:
From /*Add or Remove Features/*Office Tools/Equation Editor/*Run from My Computer/*Continue/*Close wizard.
Use /*Insert Equation on floating ribbon thingy.
(note: Older Word® had a link for "More Equations from Office.com" but has always been as useless as using a cash-register for the purpose.)
Other than missing a couple of symbols I needed, Word's equation editor works OK for me, I just find it tedious. I used to use Mathcad but my version is very, very old since they went to a different business model and the upgrades got really pricey. I used to have a third-party Word add-on that worked well but it was still a pain to type out more complex equations.

The current problem is that there's no way to copy symbols directly from a Word document onto a Web page like these. I have to use an online symbol program after the fact, or write the whole thing out in the Web post to begin with. Neither works well for my workflow. I bailed after fiddling for an hour or so and just copied and pasted the pages as images (and attached a PDF). It's not a problem with Word's equations, not that there's not room for improvement, but that I cannot copy and paste the text without losing all the symbols. I've always had to create and paste images separately, including equations, but when I have a bunch of Greek symbols sprinkled throughout the text it is very painful to fix. I used to have a program (from a friend) that would add Unicode wrapped around the symbols, but I don't have that now, no idea if it would still work with the latest Word, and could not get Unicode to work in my original post anyway. (I tried and failed, probably user error). From what @amirm and others have said there does not appear to be a simple solution.
 

pseudoid

Master Contributor
Forum Donor
Joined
Mar 23, 2021
Messages
5,198
Likes
3,547
Location
33.6 -117.9
I find that Libreoffice handles equations nicely
ScreenCapture of rendering:
202307_WordEquation.jpg

Can you show how LibreOffice handles that equation?;)
ADD: The math.stackexchange.com site (re: 'length of an LP grove') manages to readily handle the proper math equations/notations.
 
Last edited:
OP
DonH56

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,915
Likes
16,746
Location
Monument, CO

danadam

Addicted to Fun and Learning
Joined
Jan 20, 2017
Messages
997
Likes
1,554
Can you show how LibreOffice handles that equation?;)
When I copy it from Okular (a pdf viewer) then it looks similar to yours, but if I open the pdf in Libre Draw and copy to Writer then it looks quite ok:
writer1.png

It's not very editable because each character seems to be it's own object and they are all just grouped together.

But surprisingly, when I enter it in the math editor:
Code:
m_e
= int from -%DELTA/2 to %DELTA/2 e cdot P(e)de
= int from -%DELTA/2 to %DELTA/2 e cdot {1 over %DELTA} de
= evaluate { {1 over %DELTA} cdot {e^2 over 2} } from{ -frac{%DELTA}{2} } to{ frac{%DELTA}{2} }
= 1 over %DELTA left( {left(%DELTA over 2 right)^2 - left(- {%DELTA over 2} right)^2} over 2 right)
= 1 over %DELTA cdot left( %DELTA^2 over 8 - %DELTA^2 over 8 right)
= 0
writer2.png


and copy/paste that object into the comment box here, it automatically gets converted to an image:
1690323650353.png


Sadly it doesn't work when I copy/paste it together with the surrounding text :( :
Lorem ipsum Δ dolor sit amet

Lorem ipsum Δ dolor sit amet
 
OP
DonH56

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,915
Likes
16,746
Location
Monument, CO
Why so complicated: 2^16 = 65536 = 96,3295dB... divided by 16 = 6.02... [dB per bit]

Anyone here against the trivial solution?
Because it's wrong? Please read the rest of the thread. Or just put it (and me) on ignore.
 

MaxwellsEq

Major Contributor
Joined
Aug 18, 2020
Messages
1,757
Likes
2,663
Why so complicated: 2^16 = 65536 = 96,3295dB... divided by 16 = 6.02... [dB per bit]

Anyone here against the trivial solution?
The "trivial solution" is handy as a heuristic, but it's doesn't properly account for quantization error (e.g. see post #5). So I'm not against the trivial solution (if I'm doing mental calculation), but I am for the more realistic solution.
 

pseudoid

Master Contributor
Forum Donor
Joined
Mar 23, 2021
Messages
5,198
Likes
3,547
Location
33.6 -117.9
...Would've been easier to just drop a link to that or another reference and call it done, I suppose.
I disagree (and you can put me on ignore, for the future).
It's been informative/educational AS IS.
10Q
 

danadam

Addicted to Fun and Learning
Joined
Jan 20, 2017
Messages
997
Likes
1,554
I disagree (and you can put me on ignore, for the future).
It's been informative/educational AS IS.
I don't see how you can disagree that it would be easier, dropping a link vs writing an article. Maybe it wouldn't be better, for us, but that's not what he said :)
 
Top Bottom