DSPRelated.com
Forums

Noise floor / FFT relationship

Started by Unknown December 31, 2004
Newsgroups: comp.dsp, ...

This started out as a short question and now is 3 long ones...

1. I am playing with cool edit and this program
(http://digilander.libero.it/hsoft/ any better alternatives?) and some
USB audio devices and trying to figure out how to get a "real,
official" number for the noise floor and hence dynamic range (right?).

If I generate a wave at -10 dBFS on the level meters and wave display,
it also peaks at -10 dBFS on an FFT spectrum of that recording.  This
makes sense to me.  Is this true of the actual FFT, or was some math
done in between?  (In other words, if the peak sample values of the
original waveform are 10000, say, would the peak samples of the FFT
with no weighting or other processing also be at 10000? I can test this
myself in matlab later.)

If I generate two added waves of different frequencies at -10 dBFS
each, the peaks on the spectrum are each at -10 dBFS, but the total
wave peaks the level meters at  -4 dBFS, which makes sense to me, since
they are added and the level will rise by x2 = ~6 dB.

If I record a sample of quiet audio from my interface, I will get a
measurement that peaks at about -65, valleys at about -71, and visually
averages about -67.  If I then do an FFT of that recording, I get a
mostly flat line at around -106 dBFS.  I am trying to figure out what
the actual noise floor of this recording is, and its relationship to
the theoretical 96 dB dynamic range of 16-bit audio.

If I reduce a white noise signal to the point where it is only moving
up or down by one quantization level, that first quantization level
shows up on the scale as -90.5 dB or so, the level meter shows at -90.5
or so, and the spectrum shows up at -103.5.  I know I'm
misunderstanding the 96 dB dynamic range, and I learned the
calculations in DSP classes in school, but I can't remember the theory
anymore.  Can someone explain the relationship between these numbers?

2. If I try to measure the dynamic range of a system by measuring the
ratio between maximum sine wave and noise floor with a peak measuring
instrument, and do the same with an RMS measuring instrument, I will
get different results, right?  Because the RMS and peak values of noise
are not the sqrt(2) ratio as the RMS and peak values of sine wave.  The
RMS dynamic range measurement would generally be considered correct,
right?  Do I need to worry about this with my digital measurements as
well, since all of them seem to be peak-mode measurements?

3. If you do a calculation (I forget what.  square, absolute value,
then sqrt i think), you get the "power spectrum" of the FFT.  This has
no relationship to electrical power, like in an amplifer, does it?

4. What effect does averaging the spectrum have on measurement
accuracy?  Is averaging a realtime windowed FFT over many windows
mathematically the same as taking an FFT of the entire prerecorded
signal at once?

Anyone know a good reference for all of this kind of information?  I
found only this so far: http://www.daqarta.com/aa0fspav.htm  I would
get a good (used) book, too, if it were not that much.

u035m4i02@sneakemail.com wrote:

> Newsgroups: comp.dsp, ... > > This started out as a short question and now is 3 long ones... > > 1. I am playing with cool edit and this program > (http://digilander.libero.it/hsoft/ any better alternatives?) and some > USB audio devices and trying to figure out how to get a "real, > official" number for the noise floor and hence dynamic range (right?).
Tee hee.
> > If I generate a wave at -10 dBFS on the level meters and wave display, > it also peaks at -10 dBFS on an FFT spectrum of that recording. This > makes sense to me. Is this true of the actual FFT, or was some math > done in between? (In other words, if the peak sample values of the > original waveform are 10000, say, would the peak samples of the FFT > with no weighting or other processing also be at 10000? I can test this > myself in matlab later.)
There are a number of different ways to scale FFT's. With no "officially accepted" way of scaling, it's the job of the designer to pick a good one. Choosing one so that A sin(wt) works out to a line that's A high at w is a good way to go.
> > If I generate two added waves of different frequencies at -10 dBFS > each, the peaks on the spectrum are each at -10 dBFS, but the total > wave peaks the level meters at -4 dBFS, which makes sense to me, since > they are added and the level will rise by x2 = ~6 dB.
Yes, that's correct.
> > If I record a sample of quiet audio from my interface, I will get a > measurement that peaks at about -65, valleys at about -71, and visually > averages about -67. If I then do an FFT of that recording, I get a > mostly flat line at around -106 dBFS. I am trying to figure out what > the actual noise floor of this recording is, and its relationship to > the theoretical 96 dB dynamic range of 16-bit audio.
It appears that your noise is white and bandlimited. This means that it has finite energy that's evenly spread out in the FFT. In the time domain you get a signal that crawls around all over the place -- this is what you're seeing on your peak meter.
> > If I reduce a white noise signal to the point where it is only moving > up or down by one quantization level, that first quantization level > shows up on the scale as -90.5 dB or so, the level meter shows at -90.5 > or so, and the spectrum shows up at -103.5. I know I'm > misunderstanding the 96 dB dynamic range, and I learned the > calculations in DSP classes in school, but I can't remember the theory > anymore. Can someone explain the relationship between these numbers?
First misunderstanding: The 96dB is the difference between one LSB and the full range, +max to -max. Your peak meter is just reading the distance from 0 to one maximum or the other, that's 15 bits worth -- or about 90dB. The 0.5dB is just there to make you think (unrelated note: A previous manager of mine maintained that "you should always tolerance your wild-ass guesses" -- that way folks looking at your preliminary drawings would think they're real).
> > 2. If I try to measure the dynamic range of a system by measuring the > ratio between maximum sine wave and noise floor with a peak measuring > instrument, and do the same with an RMS measuring instrument, I will > get different results, right?
That depends on how you choose to define things, so definitely "maybe" -- keep in mind that you'll be RMSing the noise floor, too.
> Because the RMS and peak values of noise > are not the sqrt(2) ratio as the RMS and peak values of sine wave. The > RMS dynamic range measurement would generally be considered correct, > right? Do I need to worry about this with my digital measurements as > well, since all of them seem to be peak-mode measurements?
Dunno -- the RMS measurement may be more "correct" but it's an impossible spec -- your results will vary depending on whether your audio contains square waves or Dirac delta distributions.
> > 3. If you do a calculation (I forget what. square, absolute value, > then sqrt i think), you get the "power spectrum" of the FFT. This has > no relationship to electrical power, like in an amplifer, does it?
Square, yes, and it has every relationship to electrical power. Assuming that you've gotten your scaling right the sum of the squares of the samples in the time domain should equal the sum of the squares of the absolute values of the frequency bins in the FFT.
> > 4. What effect does averaging the spectrum have on measurement > accuracy?
Define "accuracy". For all practical purposes it probably enhances it.
> Is averaging a realtime windowed FFT over many windows > mathematically the same as taking an FFT of the entire prerecorded > signal at once?
No. I haven't worked out the math for that one, but taking the FFT of the entire signal then adding up groups of bins, or doing a frequency-domain convolution of the result and subsampling it is more closely equivalent -- but beyond assuring you that it ain't the same I can't say.
> > Anyone know a good reference for all of this kind of information? I > found only this so far: http://www.daqarta.com/aa0fspav.htm I would > get a good (used) book, too, if it were not that much. >
For the academically inclined, "Signals and Systems" by Oppenheim, Willsky and Young is a classic -- but I don't know how good it is for self-study. Robert Lyons's "Understanding Digital Signal Processing" is highly recommended on this group. I have a copy -- it's a solid book and aimed more toward the practicing engineer who needs to pick the stuff up. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
in article 10tbj4acvnai99b@corp.supernews.com, Tim Wescott at
tim@wescottnospamdesign.com wrote on 12/31/2004 17:02:

> Robert Lyons's "Understanding Digital Signal Processing" is > highly recommended on this group.
it's Richard (Rick) Lyons. good book. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
robert bristow-johnson wrote:

> in article 10tbj4acvnai99b@corp.supernews.com, Tim Wescott at > tim@wescottnospamdesign.com wrote on 12/31/2004 17:02: > > >>Robert Lyons's "Understanding Digital Signal Processing" is >>highly recommended on this group. > > > it's Richard (Rick) Lyons. > > good book. >
Thanks Robert. Sorry Rick. And yes, it's a good book. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
<u035m4i02@sneakemail.com> wrote in message
news:1104526253.000219.67160@c13g2000cwb.googlegroups.com...
> Newsgroups: comp.dsp, ... > > If I record a sample of quiet audio from my interface, I will get a > measurement that peaks at about -65, valleys at about -71, and visually > averages about -67. If I then do an FFT of that recording, I get a > mostly flat line at around -106 dBFS. I am trying to figure out what > the actual noise floor of this recording is, and its relationship to > the theoretical 96 dB dynamic range of 16-bit audio.
Remember that the total noise is the sum (integral) of all the frequency bins (delta frequency) There is a classic paper by Fred Harris on the scaling required to find SNR using various different windows. The scaling for hanning is 1.5 if I recall correctly. Also hanning will span the center bin over the tone and the bin on each side. You must use a tone that has an integer number of cycles in the FFT length you chose. You add up the power in all the bins that would not include the tone you are looking at and remember to be wary of the DC component and his nearest neighbor.
> If I reduce a white noise signal to the point where it is only moving > up or down by one quantization level, that first quantization level > shows up on the scale as -90.5 dB or so, the level meter shows at -90.5 > or so, and the spectrum shows up at -103.5. I know I'm > misunderstanding the 96 dB dynamic range, and I learned the > calculations in DSP classes in school, but I can't remember the theory > anymore. Can someone explain the relationship between these numbers?
Looks about right since you said -106 above and the quantization noise floor would be for errors of about 1/2 LSB or about 3 dB lower, unless I am off by a factor of 2 and it should be -109 dB.
"Att" <david.g.shaw@att.net> wrote in message
news:9gmBd.1199963$Gx4.10930@bgtnsc04-news.ops.worldnet.att.net...
> > <u035m4i02@sneakemail.com> wrote in message > news:1104526253.000219.67160@c13g2000cwb.googlegroups.com... > > Newsgroups: comp.dsp, ... > There is a classic paper by Fred Harris on the scaling required to find
SNR
> using various different windows. The scaling for hanning is 1.5 if I
recall
> correctly.
I found the reference. Unfortunately it looks like a chapter from a book and I only have the chapter. "DATA WINDOWS: Finite Aperture Effects and Applications in Signal Processing" Fred Harris Sandiego State University.
> Tee hee.
:-( Dost thou mock me? Or the idea of an "official" measurement?
> There are a number of different ways to scale FFT's. With no > "officially accepted" way of scaling, it's the job of the designer to > pick a good one. Choosing one so that A sin(wt) works out to a line > that's A high at w is a good way to go.
Oh, right.
> It appears that your noise is white and bandlimited. This means that it > has finite energy that's evenly spread out in the FFT. In the time > domain you get a signal that crawls around all over the place -- this is > what you're seeing on your peak meter.
Yes, I know. So what is the noise floor measurement? :-) What I'm looking for is a single number for the level of background noise so I can have a definite SNR or dynamic range or noise floor. (Which are all the same for digital, right? Maybe that idea is what you are teeheeing about?) I guess an RMS measurement is typical. So I can't get that value from either the peak measurement or the FFT spectrum, can I?
> First misunderstanding: The 96dB is the difference between one LSB and > the full range, +max to -max. Your peak meter is just reading the > distance from 0 to one maximum or the other, that's 15 bits worth -- or > about 90dB. The 0.5dB is just there to make you think (unrelated note: > A previous manager of mine maintained that "you should always tolerance > your wild-ass guesses" -- that way folks looking at your preliminary > drawings would think they're real).
Oh I get it! I was thinking you start at zero and migrate up *or* down one quantization level, but the 96 dB is moving between two adjacent levels only, hence the +6 dB. *Tries it* Eh. I think Cool Edit just absolute values it and measures the peak value, whether both sides are moving or not. It still says -90ish. Oh. Here in the "statistics" window it says "Average RMS Power -96.34 dB". (Why is it "power"?) But 96 is actually just the "6 dB per bit" approximation; the actual dynamic range of 16-bit audio is apparently around 98 according to SNR = (6.02M + 1.76) dB. But whatever. That's just being picky. I still don't understand the relationship to the spectrum though. If I make a variety of signals confined to two quantization levels, I get pretty different spectrums, and pretty different values from the statistics window. White noise makes a flat line at -123ish dB. Repeating waves make spikeys that end near -95, so maybe that's what I'm looking for, for a generalization of level vs spectrum. The level varies between those two numbers? I'm not sure... (Remember I'm asking 4 things at once, so I am "looking for" several different things.)
> That depends on how you choose to define things, so definitely "maybe" > -- keep in mind that you'll be RMSing the noise floor, too.
Yes. That's what I meant. I meant these two will give different values: 1. Maximum sine wave measures 0 dBFS peak, so dynamic range is whatever the peak value of the noise floor is. 2. Maximum sine wave measures -3.01 dBFS RMS, so dynamic range is whatever the RMS value of the noise floor is - 3 dB. Right? Since the noise floor could be anything, so the RMS noise floor will probably not be -3 dB from the peak noise floor. I believe 2 would be the generally agreed upon definition of dynamic range. But not sure.
> Dunno -- the RMS measurement may be more "correct" but it's an > impossible spec -- your results will vary depending on whether your > audio contains square waves or Dirac delta distributions.
What do you mean? I am talking about real life digital quantized sampled audio, so there are no Diracs.
> Define "accuracy". For all practical purposes it probably enhances it.
Ok. That's what I thought. It certainly makes it easier to spot constant frequencies buried under the wildness of the noise floor. I just meant accuracy to the average value of the noise floor... which... I guess... by definition... never mind. :-)
> No. I haven't worked out the math for that one, but taking the FFT of > the entire signal then adding up groups of bins, or doing a > frequency-domain convolution of the result and subsampling it is more > closely equivalent -- but beyond assuring you that it ain't the same I > can't say.
I mean using a realtime spectrum analyzer that windows and FFTs, then displays the average of that and the last 100 similar results, or just recording the entire length covered by those 100 windows and FFTing that. I imagine they are different, but by how much?
> For the academically inclined, "Signals and Systems" by Oppenheim, > Willsky and Young is a classic
Yes. Already have it. > -- but I don't know how good it is for
> self-study. Robert Lyons's "Understanding Digital Signal Processing" is > highly recommended on this group. I have a copy -- it's a solid book > and aimed more toward the practicing engineer who needs to pick the > stuff up.
Alright. I'll look into it. Jon -- Include "newsgroup" in the subject line to reply by email (or get dumped with the spam).
> Tee hee.
:-( Dost thou mock me? Or the idea of an "official" measurement?
> There are a number of different ways to scale FFT's. With no > "officially accepted" way of scaling, it's the job of the designer to > pick a good one. Choosing one so that A sin(wt) works out to a line > that's A high at w is a good way to go.
Oh, right.
> It appears that your noise is white and bandlimited. This means that it > has finite energy that's evenly spread out in the FFT. In the time > domain you get a signal that crawls around all over the place -- this is > what you're seeing on your peak meter.
Yes, I know. So what is the noise floor measurement? :-) What I'm looking for is a single number for the level of background noise so I can have a definite SNR or dynamic range or noise floor. (Which are all the same for digital, right? Maybe that idea is what you are teeheeing about?) I guess an RMS measurement is typical. So I can't get that value from either the peak measurement or the FFT spectrum, can I?
> First misunderstanding: The 96dB is the difference between one LSB and > the full range, +max to -max. Your peak meter is just reading the > distance from 0 to one maximum or the other, that's 15 bits worth -- or > about 90dB. The 0.5dB is just there to make you think (unrelated note: > A previous manager of mine maintained that "you should always tolerance > your wild-ass guesses" -- that way folks looking at your preliminary > drawings would think they're real).
Oh I get it! I was thinking you start at zero and migrate up *or* down one quantization level, but the 96 dB is moving between two adjacent levels only, hence the +6 dB. *Tries it* Eh. I think Cool Edit just absolute values it and measures the peak value, whether both sides are moving or not. It still says -90ish. Oh. Here in the "statistics" window it says "Average RMS Power -96.34 dB". (Why is it "power"?) But 96 is actually just the "6 dB per bit" approximation; the actual dynamic range of 16-bit audio is apparently around 98 according to SNR = (6.02M + 1.76) dB. But whatever. That's just being picky. I still don't understand the relationship to the spectrum though. If I make a variety of signals confined to two quantization levels, I get pretty different spectrums, and pretty different values from the statistics window. White noise makes a flat line at -123ish dB. Repeating waves make spikeys that end near -95, so maybe that's what I'm looking for, for a generalization of level vs spectrum. The level varies between those two numbers? I'm not sure... (Remember I'm asking 4 things at once, so I am "looking for" several different things.)
> That depends on how you choose to define things, so definitely "maybe" > -- keep in mind that you'll be RMSing the noise floor, too.
Yes. That's what I meant. I meant these two will give different values: 1. Maximum sine wave measures 0 dBFS peak, so dynamic range is whatever the peak value of the noise floor is. 2. Maximum sine wave measures -3.01 dBFS RMS, so dynamic range is whatever the RMS value of the noise floor is - 3 dB. Right? Since the noise floor could be anything, so the RMS noise floor will probably not be -3 dB from the peak noise floor. I believe 2 would be the generally agreed upon definition of dynamic range. But not sure.
> Dunno -- the RMS measurement may be more "correct" but it's an > impossible spec -- your results will vary depending on whether your > audio contains square waves or Dirac delta distributions.
What do you mean? I am talking about real life digital quantized sampled audio, so there are no Diracs.
> Define "accuracy". For all practical purposes it probably enhances it.
Ok. That's what I thought. It certainly makes it easier to spot constant frequencies buried under the wildness of the noise floor. I just meant accuracy to the average value of the noise floor... which... I guess... by definition... never mind. :-)
> No. I haven't worked out the math for that one, but taking the FFT of > the entire signal then adding up groups of bins, or doing a > frequency-domain convolution of the result and subsampling it is more > closely equivalent -- but beyond assuring you that it ain't the same I > can't say.
I mean using a realtime spectrum analyzer that windows and FFTs, then displays the average of that and the last 100 similar results, or just recording the entire length covered by those 100 windows and FFTing that. I imagine they are different, but by how much?
> For the academically inclined, "Signals and Systems" by Oppenheim, > Willsky and Young is a classic
Yes. Already have it.
> -- but I don't know how good it is for > self-study. Robert Lyons's "Understanding Digital Signal Processing" is > highly recommended on this group. I have a copy -- it's a solid book > and aimed more toward the practicing engineer who needs to pick the > stuff up.
Alright. I'll look into it. Jon -- Include "newsgroup" in the subject line to reply by email (or get dumped with the spam).
> Tee hee.
:-( Dost thou mock me? Or the idea of an "official" measurement?
> There are a number of different ways to scale FFT's. With no > "officially accepted" way of scaling, it's the job of the designer to > pick a good one. Choosing one so that A sin(wt) works out to a line > that's A high at w is a good way to go.
Oh, right.
> It appears that your noise is white and bandlimited. This means that it > has finite energy that's evenly spread out in the FFT. In the time > domain you get a signal that crawls around all over the place -- this is > what you're seeing on your peak meter.
Yes, I know. So what is the noise floor measurement? :-) What I'm looking for is a single number for the level of background noise so I can have a definite SNR or dynamic range or noise floor. (Which are all the same for digital, right? Maybe that idea is what you are teeheeing about?) I guess an RMS measurement is typical. So I can't get that value from either the peak measurement or the FFT spectrum, can I?
> First misunderstanding: The 96dB is the difference between one LSB and > the full range, +max to -max. Your peak meter is just reading the > distance from 0 to one maximum or the other, that's 15 bits worth -- or > about 90dB. The 0.5dB is just there to make you think (unrelated note: > A previous manager of mine maintained that "you should always tolerance > your wild-ass guesses" -- that way folks looking at your preliminary > drawings would think they're real).
Oh I get it! I was thinking you start at zero and migrate up *or* down one quantization level, but the 96 dB is moving between two adjacent levels only, hence the +6 dB. *Tries it* Eh. I think Cool Edit just absolute values it and measures the peak value, whether both sides are moving or not. It still says -90ish. Oh. Here in the "statistics" window it says "Average RMS Power -96.34 dB". (Why is it "power"?) But 96 is actually just the "6 dB per bit" approximation; the actual dynamic range of 16-bit audio is apparently around 98 according to SNR = (6.02M + 1.76) dB. But whatever. That's just being picky. I still don't understand the relationship to the spectrum though. If I make a variety of signals confined to two quantization levels, I get pretty different spectrums, and pretty different values from the statistics window. White noise makes a flat line at -123ish dB. Repeating waves make spikeys that end near -95, so maybe that's what I'm looking for, for a generalization of level vs spectrum. The level varies between those two numbers? I'm not sure... (Remember I'm asking 4 things at once, so I am "looking for" several different things.)
> That depends on how you choose to define things, so definitely "maybe" > -- keep in mind that you'll be RMSing the noise floor, too.
Yes. That's what I meant. I meant these two will give different values: 1. Maximum sine wave measures 0 dBFS peak, so dynamic range is whatever the peak value of the noise floor is. 2. Maximum sine wave measures -3.01 dBFS RMS, so dynamic range is whatever the RMS value of the noise floor is - 3 dB. Right? Since the noise floor could be anything, so the RMS noise floor will probably not be -3 dB from the peak noise floor. I believe 2 would be the generally agreed upon definition of dynamic range. But not sure.
> Dunno -- the RMS measurement may be more "correct" but it's an > impossible spec -- your results will vary depending on whether your > audio contains square waves or Dirac delta distributions.
What do you mean? I am talking about real life digital quantized sampled audio, so there are no Diracs.
> Define "accuracy". For all practical purposes it probably enhances it.
Ok. That's what I thought. It certainly makes it easier to spot constant frequencies buried under the wildness of the noise floor. I just meant accuracy to the average value of the noise floor... which... I guess... by definition... never mind. :-)
> No. I haven't worked out the math for that one, but taking the FFT of > the entire signal then adding up groups of bins, or doing a > frequency-domain convolution of the result and subsampling it is more > closely equivalent -- but beyond assuring you that it ain't the same I > can't say.
I mean using a realtime spectrum analyzer that windows and FFTs, then displays the average of that and the last 100 similar results, or just recording the entire length covered by those 100 windows and FFTing that. I imagine they are different, but by how much?
> For the academically inclined, "Signals and Systems" by Oppenheim, > Willsky and Young is a classic
Yes. Already have it.
> -- but I don't know how good it is for > self-study. Robert Lyons's "Understanding Digital Signal Processing" is > highly recommended on this group. I have a copy -- it's a solid book > and aimed more toward the practicing engineer who needs to pick the > stuff up.
Alright. I'll look into it. Jon -- Include "newsgroup" in the subject line to reply by email (or get dumped with the spam).
Re: My triple posting.

(Argh.  Just installed Thunderbird.)