DSPRelated.com
Forums

Newbee question: FFT to total signal power

Started by Cranisch October 29, 2014
Hello everyone,

I have a maybe quite easy question but I got stuck there.
So hopefully you can help solving it for me.

From a measured power signal (I am not able to have the original one) I
have a FFT spectrum mit a 8 Hz resolution and amplitudes A_i in [mW]. I am
now interested in calculating the total power of the original signal.
I think the easiest way is to sum up all amplitudes?!

But I don't think this is correct, right?!

Assuming I would have a spectrum with a resolution of 4 Hz (twice as high
compared to the previous one), which might have the same amplitude
distribution. If I'd sum up all amplitudes of that signal, I obtained a
total power which would be twice as high than the one from the 8 Hz
resolution.  So, don't I need to consider the frequency resolution for the
total power of the signal?
How do I obtain the total power of the signal properly without having a
scaling influence from the number of bins that I am considering?

Thanks in advance!	 

_____________________________		
Posted through www.DSPRelated.com
On Wed, 29 Oct 2014 06:43:16 -0500, Cranisch wrote:

> Hello everyone, > > I have a maybe quite easy question but I got stuck there. > So hopefully you can help solving it for me. > > From a measured power signal (I am not able to have the original one) I > have a FFT spectrum mit a 8 Hz resolution and amplitudes A_i in [mW]. I > am now interested in calculating the total power of the original signal. > I think the easiest way is to sum up all amplitudes?! > > But I don't think this is correct, right?! > > Assuming I would have a spectrum with a resolution of 4 Hz (twice as > high compared to the previous one), which might have the same amplitude > distribution. If I'd sum up all amplitudes of that signal, I obtained a > total power which would be twice as high than the one from the 8 Hz > resolution. So, don't I need to consider the frequency resolution for > the total power of the signal? > How do I obtain the total power of the signal properly without having a > scaling influence from the number of bins that I am considering? > > Thanks in advance!
Look up Parseval's theorem in Wikipedia. _IF_ the FFT has captured all of the signal content, then the sum of the powers of all the frequency bins should be the total power of the signal. _HOWEVER_ if your putative 4Hz FFT was taken from a signal that was low- pass filtered to fit into the range of the FFT, then the sum-the-bins method will not work -- not because the FFT does not accurately capture the power in the signal that was presented to it, but because some of the signal energy was discarded before the FFT was taken. -- www.wescottdesign.com
On 10/29/2014 11:45 PM, Tim Wescott wrote:
> On Wed, 29 Oct 2014 06:43:16 -0500, Cranisch wrote: > >> Hello everyone, >> >> I have a maybe quite easy question but I got stuck there. >> So hopefully you can help solving it for me. >> >> From a measured power signal (I am not able to have the original one) I >> have a FFT spectrum mit a 8 Hz resolution and amplitudes A_i in [mW]. I >> am now interested in calculating the total power of the original signal. >> I think the easiest way is to sum up all amplitudes?! >> >> But I don't think this is correct, right?! >> >> Assuming I would have a spectrum with a resolution of 4 Hz (twice as >> high compared to the previous one), which might have the same amplitude >> distribution. If I'd sum up all amplitudes of that signal, I obtained a >> total power which would be twice as high than the one from the 8 Hz >> resolution. So, don't I need to consider the frequency resolution for >> the total power of the signal? >> How do I obtain the total power of the signal properly without having a >> scaling influence from the number of bins that I am considering? >> >> Thanks in advance! > > Look up Parseval's theorem in Wikipedia. > > _IF_ the FFT has captured all of the signal content, then the sum of the > powers of all the frequency bins should be the total power of the signal. > > _HOWEVER_ if your putative 4Hz FFT was taken from a signal that was low- > pass filtered to fit into the range of the FFT, then the sum-the-bins > method will not work -- not because the FFT does not accurately capture > the power in the signal that was presented to it, but because some of the > signal energy was discarded before the FFT was taken. >
You could just as well say look up the conservation of energy. Steve
On 10/29/14 11:50 AM, Steve Underwood wrote:
> On 10/29/2014 11:45 PM, Tim Wescott wrote: >> On Wed, 29 Oct 2014 06:43:16 -0500, Cranisch wrote: >> >>> Hello everyone, >>> >>> I have a maybe quite easy question but I got stuck there. >>> So hopefully you can help solving it for me. >>> >>> From a measured power signal (I am not able to have the original one) I >>> have a FFT spectrum mit a 8 Hz resolution and amplitudes A_i in [mW]. I >>> am now interested in calculating the total power of the original signal. >>> I think the easiest way is to sum up all amplitudes?! >>> >>> But I don't think this is correct, right?! >>> >>> Assuming I would have a spectrum with a resolution of 4 Hz (twice as >>> high compared to the previous one), which might have the same amplitude >>> distribution. If I'd sum up all amplitudes of that signal, I obtained a >>> total power which would be twice as high than the one from the 8 Hz >>> resolution. So, don't I need to consider the frequency resolution for >>> the total power of the signal? >>> How do I obtain the total power of the signal properly without having a >>> scaling influence from the number of bins that I am considering? >>> >>> Thanks in advance! >> >> Look up Parseval's theorem in Wikipedia. >> >> _IF_ the FFT has captured all of the signal content, then the sum of the >> powers of all the frequency bins should be the total power of the signal. >> >> _HOWEVER_ if your putative 4Hz FFT was taken from a signal that was low- >> pass filtered to fit into the range of the FFT, then the sum-the-bins >> method will not work -- not because the FFT does not accurately capture >> the power in the signal that was presented to it, but because some of the >> signal energy was discarded before the FFT was taken. >> > You could just as well say look up the conservation of energy. >
well, it takes Parseval's theorem to establish that the energy (square of the magnitude) in each bin corresponds to the energy for each particular frequency band, so that when you add it up, conservation of energy applies. one thing to worry about when using an FFT function is whether or not there is that leading 1/N factor in the definition. it might be 1 instead (the 1/N is in the inverse FFT) or there might be 1/sqrt(N) used in both forward and inverse. in the latter case (called a "unitary" transform) the energy mapped from one domain to the other is preserved. but not in the other two cases where all of the 1/N factor lives in only one directional transform. this factor of N is important and you'll see it in the discrete version of Parsevals theorem. just wanna dot my t's and cross my i's. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On Wed, 29 Oct 2014 23:50:54 +0800, Steve Underwood wrote:

> On 10/29/2014 11:45 PM, Tim Wescott wrote: >> On Wed, 29 Oct 2014 06:43:16 -0500, Cranisch wrote: >> >>> Hello everyone, >>> >>> I have a maybe quite easy question but I got stuck there. >>> So hopefully you can help solving it for me. >>> >>> From a measured power signal (I am not able to have the original one) >>> I >>> have a FFT spectrum mit a 8 Hz resolution and amplitudes A_i in [mW]. >>> I am now interested in calculating the total power of the original >>> signal. >>> I think the easiest way is to sum up all amplitudes?! >>> >>> But I don't think this is correct, right?! >>> >>> Assuming I would have a spectrum with a resolution of 4 Hz (twice as >>> high compared to the previous one), which might have the same >>> amplitude distribution. If I'd sum up all amplitudes of that signal, I >>> obtained a total power which would be twice as high than the one from >>> the 8 Hz resolution. So, don't I need to consider the frequency >>> resolution for the total power of the signal? >>> How do I obtain the total power of the signal properly without having >>> a scaling influence from the number of bins that I am considering? >>> >>> Thanks in advance! >> >> Look up Parseval's theorem in Wikipedia. >> >> _IF_ the FFT has captured all of the signal content, then the sum of >> the powers of all the frequency bins should be the total power of the >> signal. >> >> _HOWEVER_ if your putative 4Hz FFT was taken from a signal that was >> low- pass filtered to fit into the range of the FFT, then the >> sum-the-bins method will not work -- not because the FFT does not >> accurately capture the power in the signal that was presented to it, >> but because some of the signal energy was discarded before the FFT was >> taken. >> > You could just as well say look up the conservation of energy.
Just because energy is conserved in physical systems is no guarantee that energy is conserved in some mathematical transformation. In fact, even among 1:1 mappings, there's no guarantee that sum(x^2) = sum (transformed(x)^2). (With "sum" in this case taking the larger meaning of "sum or integral", since some transformations go from one domain to another). -- www.wescottdesign.com
On 10/30/2014 12:28 AM, Tim Wescott wrote:
> On Wed, 29 Oct 2014 23:50:54 +0800, Steve Underwood wrote: > >> On 10/29/2014 11:45 PM, Tim Wescott wrote: >>> On Wed, 29 Oct 2014 06:43:16 -0500, Cranisch wrote: >>> >>>> Hello everyone, >>>> >>>> I have a maybe quite easy question but I got stuck there. >>>> So hopefully you can help solving it for me. >>>> >>>> From a measured power signal (I am not able to have the original one) >>>> I >>>> have a FFT spectrum mit a 8 Hz resolution and amplitudes A_i in [mW]. >>>> I am now interested in calculating the total power of the original >>>> signal. >>>> I think the easiest way is to sum up all amplitudes?! >>>> >>>> But I don't think this is correct, right?! >>>> >>>> Assuming I would have a spectrum with a resolution of 4 Hz (twice as >>>> high compared to the previous one), which might have the same >>>> amplitude distribution. If I'd sum up all amplitudes of that signal, I >>>> obtained a total power which would be twice as high than the one from >>>> the 8 Hz resolution. So, don't I need to consider the frequency >>>> resolution for the total power of the signal? >>>> How do I obtain the total power of the signal properly without having >>>> a scaling influence from the number of bins that I am considering? >>>> >>>> Thanks in advance! >>> >>> Look up Parseval's theorem in Wikipedia. >>> >>> _IF_ the FFT has captured all of the signal content, then the sum of >>> the powers of all the frequency bins should be the total power of the >>> signal. >>> >>> _HOWEVER_ if your putative 4Hz FFT was taken from a signal that was >>> low- pass filtered to fit into the range of the FFT, then the >>> sum-the-bins method will not work -- not because the FFT does not >>> accurately capture the power in the signal that was presented to it, >>> but because some of the signal energy was discarded before the FFT was >>> taken. >>> >> You could just as well say look up the conservation of energy. > > Just because energy is conserved in physical systems is no guarantee that > energy is conserved in some mathematical transformation. > > In fact, even among 1:1 mappings, there's no guarantee that sum(x^2) = sum > (transformed(x)^2). (With "sum" in this case taking the larger meaning > of "sum or integral", since some transformations go from one domain to > another). >
If energy is not conserved in the transform, double transforming wouldn't get you back where you start, and our entire likelihood would be at stake. Steve
On Thu, 30 Oct 2014 00:51:44 +0800, Steve Underwood wrote:

> On 10/30/2014 12:28 AM, Tim Wescott wrote: >> On Wed, 29 Oct 2014 23:50:54 +0800, Steve Underwood wrote: >> >>> On 10/29/2014 11:45 PM, Tim Wescott wrote: >>>> On Wed, 29 Oct 2014 06:43:16 -0500, Cranisch wrote: >>>> >>>>> Hello everyone, >>>>> >>>>> I have a maybe quite easy question but I got stuck there. >>>>> So hopefully you can help solving it for me. >>>>> >>>>> From a measured power signal (I am not able to have the original >>>>> one) >>>>> I >>>>> have a FFT spectrum mit a 8 Hz resolution and amplitudes A_i in >>>>> [mW]. I am now interested in calculating the total power of the >>>>> original signal. >>>>> I think the easiest way is to sum up all amplitudes?! >>>>> >>>>> But I don't think this is correct, right?! >>>>> >>>>> Assuming I would have a spectrum with a resolution of 4 Hz (twice as >>>>> high compared to the previous one), which might have the same >>>>> amplitude distribution. If I'd sum up all amplitudes of that signal, >>>>> I obtained a total power which would be twice as high than the one >>>>> from the 8 Hz resolution. So, don't I need to consider the >>>>> frequency resolution for the total power of the signal? >>>>> How do I obtain the total power of the signal properly without >>>>> having a scaling influence from the number of bins that I am >>>>> considering? >>>>> >>>>> Thanks in advance! >>>> >>>> Look up Parseval's theorem in Wikipedia. >>>> >>>> _IF_ the FFT has captured all of the signal content, then the sum of >>>> the powers of all the frequency bins should be the total power of the >>>> signal. >>>> >>>> _HOWEVER_ if your putative 4Hz FFT was taken from a signal that was >>>> low- pass filtered to fit into the range of the FFT, then the >>>> sum-the-bins method will not work -- not because the FFT does not >>>> accurately capture the power in the signal that was presented to it, >>>> but because some of the signal energy was discarded before the FFT >>>> was taken. >>>> >>> You could just as well say look up the conservation of energy. >> >> Just because energy is conserved in physical systems is no guarantee >> that energy is conserved in some mathematical transformation. >> >> In fact, even among 1:1 mappings, there's no guarantee that sum(x^2) = >> sum (transformed(x)^2). (With "sum" in this case taking the larger >> meaning of "sum or integral", since some transformations go from one >> domain to another). >> > If energy is not conserved in the transform, double transforming > wouldn't get you back where you start, and our entire likelihood would > be at stake. > > Steve
[ 0 -100 ] y = [ ] x [ 1 0 ] is a rather trivial 1:1 mapping between the space described by x and the space described by y. Yet the norm (and thus "energy") of y will, in general, be different from the norm of x. Why is this not fall-on-the-floor obvious to you? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Wednesday, October 29, 2014 12:51:47 PM UTC-4, Steve Underwood wrote:
> On 10/30/2014 12:28 AM, Tim Wescott wrote: > > On Wed, 29 Oct 2014 23:50:54 +0800, Steve Underwood wrote: > > > >> On 10/29/2014 11:45 PM, Tim Wescott wrote: > >>> On Wed, 29 Oct 2014 06:43:16 -0500, Cranisch wrote: > >>> > >>>> Hello everyone, > >>>> > >>>> I have a maybe quite easy question but I got stuck there. > >>>> So hopefully you can help solving it for me. > >>>> > >>>> From a measured power signal (I am not able to have the original one) > >>>> I > >>>> have a FFT spectrum mit a 8 Hz resolution and amplitudes A_i in [mW]. > >>>> I am now interested in calculating the total power of the original > >>>> signal. > >>>> I think the easiest way is to sum up all amplitudes?! > >>>> > >>>> But I don't think this is correct, right?! > >>>> > >>>> Assuming I would have a spectrum with a resolution of 4 Hz (twice as > >>>> high compared to the previous one), which might have the same > >>>> amplitude distribution. If I'd sum up all amplitudes of that signal, I > >>>> obtained a total power which would be twice as high than the one from > >>>> the 8 Hz resolution. So, don't I need to consider the frequency > >>>> resolution for the total power of the signal? > >>>> How do I obtain the total power of the signal properly without having > >>>> a scaling influence from the number of bins that I am considering? > >>>> > >>>> Thanks in advance! > >>> > >>> Look up Parseval's theorem in Wikipedia. > >>> > >>> _IF_ the FFT has captured all of the signal content, then the sum of > >>> the powers of all the frequency bins should be the total power of the > >>> signal. > >>> > >>> _HOWEVER_ if your putative 4Hz FFT was taken from a signal that was > >>> low- pass filtered to fit into the range of the FFT, then the > >>> sum-the-bins method will not work -- not because the FFT does not > >>> accurately capture the power in the signal that was presented to it, > >>> but because some of the signal energy was discarded before the FFT was > >>> taken. > >>> > >> You could just as well say look up the conservation of energy. > > > > Just because energy is conserved in physical systems is no guarantee that > > energy is conserved in some mathematical transformation. > > > > In fact, even among 1:1 mappings, there's no guarantee that sum(x^2) = sum > > (transformed(x)^2). (With "sum" in this case taking the larger meaning > > of "sum or integral", since some transformations go from one domain to > > another). > > > If energy is not conserved in the transform, double transforming > wouldn't get you back where you start, and our entire likelihood would > be at stake.
well energy is *not* conserved in the transform if it is not the *unitary* DFT: https://en.wikipedia.org/wiki/Discrete_Fourier_transform#The_unitary_DFT . this is: N-1 X[k] = N^(-1/2) SUM{ x[n] e^(-j 2 pi nk/N) } n=0 and N-1 x[n] = N^(-1/2) SUM{ X[k] e^(+j 2 pi nk/N) } k=0 the DFT and iDFT are qualitatively identical because +j and -j are qualitatively identical. if you DFT x[n] and then DFT the result (*not* iDFT), you will get the original *without* scaling, but reversed in time. this is the only definition that preserves energy across the transform. that means Parseval looks like N-1 N-1 SUM{ |x[n]|^2 } = SUM{ |X[k]|^2 } n=0 k=0 with *no* scaling of N involved. (using Google-Groups (yuck) because i can't get the NNTP server to work.) r b-j
Tim Wescott <tim@seemywebsite.com> wrote:
> On Wed, 29 Oct 2014 23:50:54 +0800, Steve Underwood wrote:
>> On 10/29/2014 11:45 PM, Tim Wescott wrote:
(snip)
>>> Look up Parseval's theorem in Wikipedia.
(snip)
>> You could just as well say look up the conservation of energy.
> Just because energy is conserved in physical systems is no > guarantee that energy is conserved in some mathematical > transformation.
Yes. That is why linearity, and sometimes knowing the difference between linear and affine, is important. (Besides the fact that often linear problems can be solved analytically, and non-linear ones can't.)
> In fact, even among 1:1 mappings, there's no guarantee that > sum(x^2) = sum (transformed(x)^2). (With "sum" in this case > taking the larger meaning of "sum or integral", since some > transformations go from one domain to another).
With linearity, one can figure out if a transform conserves energy, and under which restrictions or constraints. When kinetic and potential energy are conserved separately, and when only the sum is conserved. And also why non-linear optics is such an interesting field. (Note that many optical materials are close enough to linear with ordinary fields and power levels. Electron energy levels are shifted by such small amounts that a linear approximation is very good. But things get interesting when that isn't true.) And then you get into funny details, like where to put the 2*pi. When I actually learned them (not counting when my Physics 1 TA tried to teach us at 8:00 AM), I learned it using omega (angular frequency) instead of 2*pi*f. When using omega, it is convenient to divide d(omega) by 2*pi in the normalization. It is especially inconvenient to divide by sqrt(2*pi). -- glen
Tim Wescott <seemywebsite@myfooter.really> wrote:

> On Thu, 30 Oct 2014 00:51:44 +0800, Steve Underwood wrote:
(snip)
>> If energy is not conserved in the transform, double transforming >> wouldn't get you back where you start, and our entire likelihood would >> be at stake.
> [ 0 -100 ] > y = [ ] x > [ 1 0 ]
> is a rather trivial 1:1 mapping between the space described by x and the > space described by y. Yet the norm (and thus "energy") of y will, in > general, be different from the norm of x.
I think by "double transform" he meant using a transform of the same form twice. That isn't true for the one you show.
> Why is this not fall-on-the-floor obvious to you?
Because you didn't include units. If a transform, for example, multiplies all numbers by two, conservation of energy holds with the appropriate transform of the units. -- glen