R/E/P Community

Please login or register.

Login with username, password and session length
Advanced search  

Pages: [1]   Go Down

Author Topic: Something I Don't Understand  (Read 6665 times)

Rob Darling

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 294
Something I Don't Understand
« on: December 08, 2004, 09:27:48 AM »

I know that each bit accounts for 6db of dynamic range, but what is reason for this value?  
Logged
____________________
rob darling
rob@robdarling.net
www.robdarling.net

Ondrej Gratz

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
Re: Something I Don't Understand
« Reply #1 on: December 08, 2004, 10:19:52 AM »

Hi Inquisitive Guy !
 
 Let's get some high school math.

 ^ means power.  

no. of bits          no. of possible combinations
 0                    2^0  =  1
 1                    2^1  =  2
 2                    2^2  =  4
 3                    2^3  =  8
and so on...

 Note that no. of combinations doubles as you increase no. of bits .
 6 dB means double ! Example: I earn $1000/month. My neighbour earns 6 dB more. How much does my neighbour earn ? The answer is: he earns $2000/month.  Shocked

Evidence:
  X = no. of decibels
  20 * log (S2/S1) = X
  20 * log (2000/1000) = X
  X = 6 dB !!!!!!!!!

And for no. of bit combinations:
  20 * log (A2/A1) = X
  20 * log (8/4) = X
  X = 6 dB !!!!!!!!!

Is this what you've been wondering ??  Very Happy
Logged
Sincerely
Ondrej Gratz

Rob Darling

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 294
Re: Something I Don't Understand
« Reply #2 on: December 08, 2004, 10:59:52 AM »

That's what I was looking for.  Thanks.
Logged
____________________
rob darling
rob@robdarling.net
www.robdarling.net

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: Something I Don't Understand
« Reply #3 on: December 08, 2004, 11:02:51 AM »

There is the "signal" that you are putting into the converter and then there is the "error," the result of having to round the signal to the nearest quantization step.  Let's take a converter with a fixed range - say 0V to 4V - a maximum amplitude of 4.  If we divide this range into 4 quantization steps (each being 1V) then the maximum amount of "rounding" that will occur is half of one quantization step.  The signal can't round more than +/- .5 quantization steps because then it would be closer to the next step and would round the other direction.  The "error" here, or the distortion that we add to the signal, is at an amplitude of, essentially, .5.

Now, let's double the number of quantization steps (add a bit).  What happens to the maximum amount of error we introduce to our signal?  The error gets cut in half.  Now the signal doesn't round more than +/-.25V, right?  Every time you cut the size of the quantization steps in half by adding a bit you reduce by 50% the amplitude of the error.

If we reduce the amplitude of the error then we lower the distortion (or perhaps noise - don't go there) in relation to the maximum amplitude.  The maximum amplitude stays at 4V, but the amount of error keeps getting smaller as I add more quantization steps.  So what we effectively do is increase the "dynamic range" of our material.  Since a drop in signal of 50% is equivalent to a drop of 6dB, each time we drop the quantization error in half we lower it 6dB.  Each bit, therefore, means an additional 6dB of dynamic range - roughly.

Nika
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: Something I Don't Understand
« Reply #4 on: December 09, 2004, 02:07:01 PM »

Not so fast...

For AD conversion, the outcome is 6dB for each ADDITIONAL bit. A perfect 16 bit AD yields nearly 98dB, not 6*16=96dB. A perfect 4 bit yields nearly 26dB, not 6*4=24. A perfect 20 bit yields near 122dB, not 6*20=120.

There is an extra almost 2dB in the process (closer to 1.7dB). It is convenient to view it as about 8dB for the first bit and 6dB for each additional bit. (7.7 and 6.02 is more accurate).

regards

Dan Lavry
Logged

bobkatz

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2926
Re: Something I Don't Understand
« Reply #5 on: December 09, 2004, 03:28:40 PM »

danlavry wrote on Thu, 09 December 2004 14:07

Not so fast...

For AD conversion, the outcome is 6dB for each ADDITIONAL bit. A perfect 16 bit AD yields nearly 98dB, not 6*16=96dB. A perfect 4 bit yields nearly 26dB, not 6*4=24. A perfect 20 bit yields near 122dB, not 6*20=120.

There is an extra almost 2dB in the process (closer to 1.7dB). It is convenient to view it as about 8dB for the first bit and 6dB for each additional bit. (7.7 and 6.02 is more accurate).

regards

Dan Lavry


Could you please elaborate, Dan? I thought PCM was linear  Smile
Logged
There are two kinds of fools,
One says-this is old and therefore good.
The other says-this is new and therefore better."

No trees were killed in the sending of this message. However a large number of
electrons were terribly inconvenienced.

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: Something I Don't Understand
« Reply #6 on: December 09, 2004, 04:28:19 PM »

Bob,

I've seen this before and concocted what seemed like the logical explanation to me, but perhaps this isn't the complete story.  In any event:

1 bit gives us two quantization steps. 0, 1
2 bits gives us four quantization steps. 0, 1, 2, 3
3 bits gives us eight quantization steps.

Etc.

The amplitude of the quantization steps, however, does not get cut in half as we double the quantity, and the quantization error is directly related to the AMPLITUDE of the quantization steps, not the quantity.  The amplitude of the quantization steps is directly related to the number of quantization intervals not the number of quantization steps..  The number of intervals in a 1 bit system is 1 (0-1).  The number of intervals in a 2 bit system is 3 (0-1 1-2 2-3).  

Look at the 1 bit example - the amplitude of the quantization step is 100% of the range.  Theoretically, we double the number of steps and the amplitude of the quantization step gets cut in half, right?  Not so.  With four quantization step each step is 33% of the range!  The four steps are 0%, 33%, 66%, and 100%.  The change from 1 bit to 2 gave us more than 6dB of increase in dynamic range!  Furthermore, this never actually becomes a linear relationship.  When we add another bit we have 8 quantization steps, but the quantization steps go from 33% of the range to 14.3% of the range (100/7).  This, also, is greater than 6dB of increase.  

The number of quantization intervals is always one less than the number of quantization steps, and this is what throws the formulas amuck.  If you want a 6dB increase over a single bit (two quantization steps) you need to make three quantization steps, or a bit and a half.

Now, whether this provides the 1.7dB that Dan was referring to, I'm not sure, but it is a logical breakdown in the formulas that accounts for some extra deebees from my perspective.

Nika
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: Something I Don't Understand
« Reply #7 on: December 10, 2004, 04:20:15 PM »

Nika Aldrich wrote on Thu, 09 December 2004 21:28

Bob,

I've seen this before and concocted what seemed like the logical explanation to me, but perhaps this isn't the complete story.  In any event:

1 bit gives us two quantization steps. 0, 1
2 bits gives us four quantization steps. 0, 1, 2, 3
3 bits gives us eight quantization steps.

Etc.

The amplitude of the quantization steps, however, does not get cut in half as we double the quantity, and the quantization error is directly related to the AMPLITUDE of the quantization steps, not the quantity.  The amplitude of the quantization steps is directly related to the number of quantization intervals not the number of quantization steps..  The number of intervals in a 1 bit system is 1 (0-1).  The number of intervals in a 2 bit system is 3 (0-1 1-2 2-3).  

Look at the 1 bit example - the amplitude of the quantization step is 100% of the range.  Theoretically, we double the number of steps and the amplitude of the quantization step gets cut in half, right?  Not so.  With four quantization step each step is 33% of the range!  The four steps are 0%, 33%, 66%, and 100%.  The change from 1 bit to 2 gave us more than 6dB of increase in dynamic range!  Furthermore, this never actually becomes a linear relationship.  When we add another bit we have 8 quantization steps, but the quantization steps go from 33% of the range to 14.3% of the range (100/7).  This, also, is greater than 6dB of increase.  

The number of quantization intervals is always one less than the number of quantization steps, and this is what throws the formulas amuck.  If you want a 6dB increase over a single bit (two quantization steps) you need to make three quantization steps, or a bit and a half.

Now, whether this provides the 1.7dB that Dan was referring to, I'm not sure, but it is a logical breakdown in the formulas that accounts for some extra deebees from my perspective.

Nika



Nika, your statement:

The amplitude of the quantization steps, however, does not get cut in half as we double the quantity, and the quantization error is directly related to the AMPLITUDE of the quantization steps, not the quantity....

is wrong. When you cut the quantization step by 2, the noise energy is a quarter, the noise voltage is half.    

So here is the explanation, and it is very fundamental to AD conversion. You can find it in many books and articles dealing
with quantization issues regarding AD and/or dither.

You start by defining a range for the signal. The range is between -d/2 and +d/2.

You now can make the claim that the quantization noise has equal probability to reside withing that range. Therefore the energy e(rms)in the quantization noise is:

e^2=1/(d/2)X integral(e^2)de with limits of -d/2 and +d/2

That yields energy e^2 equal to d^2/12
Now the voltage is sqrt of (2/12) = .408
In the log scale 20*log(.408) = -7.782dB
which is about 1.78dB more than 6.02dB....

So it is just simple math, figuring out the energy of a random signal bounded by min and max values. There is no reason for it to be -6dB. The starting point is -7.782dB

But once you figure the 1 bit case, each doubling of the quantization lines cuts the quantization energy by half thus -6dB/bit...

It is analogous to cutting a cake. The initial size is one thing. Once it is given, slicing it by 2 is another matter.

Regards

Dan Lavry




Logged

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: Something I Don't Understand
« Reply #8 on: December 10, 2004, 07:08:15 PM »

danlavry wrote on Fri, 10 December 2004 16:20



Nika, your statement:

The amplitude of the quantization steps, however, does not get cut in half as we double the quantity, and the quantization error is directly related to the AMPLITUDE of the quantization steps, not the quantity....

is wrong. When you cut the quantization step by 2, the noise energy is a quarter, the noise voltage is half.  

Then...

But once you figure the 1 bit case, each doubling of the quantization lines cuts the quantization energy by half thus -6dB/bit...

It is analogous to cutting a cake. The initial size is one thing. Once it is given, slicing it by 2 is another matter.



OK.  So when you start with one bit the range of the error is -d/2 to +d/2, and then you increase the quantization steps from two to four, what happens to the range of the error.  You are saying that it is cut in half?  Peculiar.  As far as I see it is cut to -d/6 to +d/6 - cut in thirds.

Analgous to cutting a cake?  How about analgous to a square pan of brownies.  Put two horizontal slices in the pan and how big is each piece?  My math says 1/3, not 1/2.

How does this play with the math?  First bit is 7.78dB.  That's fine.  How much is the second bit?  How much is the third bit?  Are you sure that they're consistent?  I don't see how that's possible.

Nika
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: Something I Don't Understand
« Reply #9 on: December 10, 2004, 07:59:04 PM »

Nika Aldrich wrote on Sat, 11 December 2004 00:08

danlavry wrote on Fri, 10 December 2004 16:20



Nika, your statement:

The amplitude of the quantization steps, however, does not get cut in half as we double the quantity, and the quantization error is directly related to the AMPLITUDE of the quantization steps, not the quantity....

is wrong. When you cut the quantization step by 2, the noise energy is a quarter, the noise voltage is half.  

Then...

But once you figure the 1 bit case, each doubling of the quantization lines cuts the quantization energy by half thus -6dB/bit...

It is analogous to cutting a cake. The initial size is one thing. Once it is given, slicing it by 2 is another matter.



OK.  So when you start with one bit the range of the error is -d/2 to +d/2, and then you increase the quantization steps from two to four, what happens to the range of the error.  You are saying that it is cut in half?  Peculiar.  As far as I see it is cut to -d/6 to +d/6 - cut in thirds.

Analgous to cutting a cake?  How about analgous to a square pan of brownies.  Put two horizontal slices in the pan and how big is each piece?  My math says 1/3, not 1/2.

How does this play with the math?  First bit is 7.78dB.  That's fine.  How much is the second bit?  How much is the third bit?  Are you sure that they're consistent?  I don't see how that's possible.

Nika


You do not get 1/3 of a bit. You start with the whole. Than you slice once and have 2 pieces. Next you slice each piece by 2 and get 4 pieces. Next you get 8 pieces. Each time the span of the noise is reduced by half thus -6dB.  

You really should know that adding a bit causes the amplitude of each step to be 1/2 which means -6dB in voltage. This part is very simple.

Regarding the noise associated with a signal bounded by -d/2 and +d/2 (a total of one d) it is as I posted, and is basic AD and quantization engineering. As I stated, it appears in a lot of literature about AD's and about dither. I do not believe I have a single AD text book that does not begin with that d^2/12 derivation.

Regards
Dan Lavry

Logged

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: Something I Don't Understand
« Reply #10 on: December 10, 2004, 08:18:47 PM »

Dan,

If you have a range -  say a to b, which requires two quantization steps, or 1 bit, and you divide this range into two (to add 6dB of dynamic range), how many quantization steps did you add?  How many quantization steps are there total?

Now add two quantization steps - equivalent to adding a whole bit - into how many regions is the area cut?  How much dynamic range have you added?

Again, you said that I'm flatout wrong on this.  I'm trying to get you to show how.  You're the engineer.  It's all math.  Math doesn't lie, and engineers don't make mistakes, right?  

So, if you go from 1 bit (2 steps) of quantization to 2 bits (4 steps) what happens to the dynamic range?  +6dB?  Really?

Nika
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: Something I Don't Understand
« Reply #11 on: December 11, 2004, 12:41:14 AM »

Nika Aldrich wrote on Sat, 11 December 2004 01:18

Dan,

If you have a range -  say a to b, which requires two quantization steps, or 1 bit, and you divide this range into two (to add 6dB of dynamic range), how many quantization steps did you add?  How many quantization steps are there total?

Now add two quantization steps - equivalent to adding a whole bit - into how many regions is the area cut?  How much dynamic range have you added?

Again, you said that I'm flatout wrong on this.  I'm trying to get you to show how.  You're the engineer.  It's all math.  Math doesn't lie, and engineers don't make mistakes, right?  

So, if you go from 1 bit (2 steps) of quantization to 2 bits (4 steps) what happens to the dynamic range?  +6dB?  Really?

Nika



Nika,

No, the a to b range is not about 2 quantization steps. It is the range of operation of the whole converter, where you are always above the lower limit and below the upper limit. The focus is not about how many steps there are or how many lines defining the boundary between codes. It is about the size of the smallest step.

When your signal gets you from code to code, crossing boundaries, that is SIGNAL. The part of the signal that stays between the lines is NOISE. You take the same converter range and add a bit - double the regions between transition points (I call it codes), and each step is half the size it used to be. The noise is half, because it is defined by the step size which is half. In terms of voltage it is proportionally so.

When modeling the behavior make sure to model in such a way that will yield the following: the quantization noise is assumed to be equal probability over a range of a step.  

For example:
Take a random number generator between say 0 and 10 and find the rms AC power and from it the rms voltage (take the square root). Now take a random number between say 0 and 5 and do the same. The rms voltage is halved.  

I just “forced” you to assume that the signal within a step has an equal probability to land anywhere. Is the assumption a good one? It is a great assumption when you have a signal range broken to say 256 steps (8 bits). Even a very deliberate signal, say a 1KHz sine wave, shares very little with such a fine grid, not to mention a 16 bit with 65536 steps. The assumption of a flat random distribution is way beyond statistical certainty.

So our 6dB per bit is really so for the practical cases of conversion,

Such assumption falls apart when using say a 1KHz sine wave with a 1 bit converter. If the sine wave is 0.1 the step size, one can not claim it has the same probability to be at 0.1 as it does at say .9 of the step. So we lost our randomness. This is exactly why we have quantization distortions and noise when the signal approaches a few LSB’s (very few quantization transitions). BTW, we add dither to regain that randomness.

So when figuring that 6dB per bit, we rely on the concept of flat random statistical distribution, and can do so because we assume 8 or more bits (that is plenty).
So we do not need to worry about the fact that a 1 bit converter noise is not random. We start by saying that if it is highly random (such as the case of  6 or more bits) each additional bit yields 1/2 the noise.

With enough bits, the MSB is “more connected to the signal”. In fact, our 1KHz sine wave will yield 500usec of 0’s followed by 500usec of 1’s – predictable and not random, thus the noise error is not at the MSB. The next bit is still pretty systematic, and still makes for a very predictable pattern…. The LSB is just plain flat random noise…
It is this noise that determines the dynamic range.

So when modeling a 1 or 2 bit converter, to see the behaviour of an 8 or more bits,  do it with a flat random quantization noise, and the outcome will be correct…

I hope it helps

Dan Lavry  


Logged

Phillip Graham

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Something I Don't Understand
« Reply #12 on: December 14, 2004, 01:19:37 PM »

Dan,

That is the clearest description of stochastics relating to quantitization I have ever read, great job!
Logged
Phillip Graham

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: Something I Don't Understand
« Reply #13 on: December 15, 2004, 02:02:20 PM »

Dan,

Thank you for your efforts.  I understand all of that.  I did not find it to correlate with the question I was asking.  I found my answer another way, however.  The breakdown in my logic as I presented it was that the boundaries of the system are not the top and bottom quantization steps - they are 1/2 LSB beyond the quantization steps on an n bit system of any variety of n.  This is the maximum amplitude of a linear digital system.  Using this as the basis, my previous math was erroneous.  

Again, thanks for the effort.

Nika
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: Something I Don't Understand
« Reply #14 on: December 17, 2004, 10:28:05 AM »

Quote:

Also, the reason many people come here is to learn. Yet, you stated ?I found your answers to be unsatisfactory? where someone else response to the SAME THREAD was ?That is the clearest description of stochastics relating to quantitization I have ever read, great job!?. There are a lot of people that appreciate the forum, and that is good enough for me


Dan,

I pulled this quote from the other thread because I think it is more related to this one.  Yes, your explanation of stochastics was good.  I am not disputing that.  It is just that your explanation of stochastics was not related in any way to my question.

Reminder - my question: If your top and bottom boundaries of the linear digital system are the top and bottom quantization steps in an n quantization step system then the number of quantization "regions" is always n-1 and the quantization error is (n-1)/2.  In your explanation above you say that the system doesn't become linear and doesn't follow its idealized state until it has more than one - possibly more than two quantization steps.  You have to get out a ways - perhaps to eight or so quantization bits (you say this would be plenty) before the system becomes linear - the quantization error becomes random enough.  I follow that whole argument.  It just does not relate to what I was saying.  This was not a thread about stochastics - so far as I could tell.

Based on the premise I described above, an 8 bit system would have 255 quantization "regions" and a 9 bit system would have 511 quantization "regions."  The difference between the quantization error amplitude of an 8 bit system would be around 6.04dB, not 6.02dB.  Clearly this answer does not counter what I suggested my confusion was above if the system still does not perform as expected where you say it should.

This is why I said that I found your answer unhelpful and thus went elsewhere to find the answer - you and I were clearly not communicating, and while you were writing great stuff that is tangentially related, it was not addressing my specific issue.

If ANYONE is following along right now the actual problem with my approach is that the top and bottom quantization steps are not the top and bottom of the linear digital system.  Each quantization step is the mid-point of it's own quantization "region," so the top and bottom points can still be "rounded to" from the other direction - outside of full scale.  The linear digital system exceeds its quantization steps by -1/2LSB on the bottom end and +1/2LSB on the top end.  With this correction in place it is easy to see that an n quantization step system has n quantization regions, that the quantization error is n/2, and that each additional bit thus adds 6.02dB of dynamic range.

Nika
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.
Pages: [1]   Go Up
 

Site Hosted By Ashdown Technologies, Inc.

Page created in 0.066 seconds with 20 queries.