DSPRelated.com
Forums

DFT interpretation

Started by Owen Duffy March 31, 2008
I see examples that indicate the the X[k] terms of a (rectangular window) 
DFT are naturally in the same units as the input samples x[n], ie the |X[k]
| is the amplitude of a sine wave (with some phase offset).

This does not seem consistent with energy conservation.

If parseval's relation holds, then it seems (sum(x[n]))/N=sum((|X[k]|/N)^2
=sum(P[n]).

I can select input sample sets that allocate all of the power to just one 
output bin. The cases that I have tried all suggest that P[k]=|X[k]/N|^2. 
These cases suggest that the amplitude of the sine wave at frequency k is 
NOT |X[k]|.

Am I correct in interpreting the power in bin k to be |X[k]/N|^2, and that 
the amplitude of the voltage sine wave is 2^0.5*|X[k]/N| for all k except 
k=0 where the amplitude of the DC voltage is |X[k]/N|?

Comments appreciated...

Owen
On Mar 31, 12:13&#4294967295;am, Owen Duffy <n...@no.where> wrote:
> I see examples that indicate the the X[k] terms of a (rectangular window) > DFT are naturally in the same units as the input samples x[n], ie the |X[k] > | is the amplitude of a sine wave (with some phase offset). > > This does not seem consistent with energy conservation. > > If parseval's relation holds, then it seems (sum(x[n]))/N=sum((|X[k]|/N)^2 > =sum(P[n]).
This is not what Parseval's theorem/relation says. You are missing something. Dirk
> > I can select input sample sets that allocate all of the power to just one > output bin. The cases that I have tried all suggest that P[k]=|X[k]/N|^2. > These cases suggest that the amplitude of the sine wave at frequency k is > NOT |X[k]|. > > Am I correct in interpreting the power in bin k to be |X[k]/N|^2, and that > the amplitude of the voltage sine wave is 2^0.5*|X[k]/N| for all k except > k=0 where the amplitude of the DC voltage is |X[k]/N|? > > Comments appreciated... > > Owen
dbell <bellda2005@cox.net> wrote in
news:9c533556-5b41-4317-9f69-4c2a9d8d975e@e39g2000hsf.googlegroups.com: 

...
>> If parseval's relation holds, then it seems >> (sum(x[n]))/N=sum((|X[k]|/N) > ^2 >> =sum(P[n]). > > This is not what Parseval's theorem/relation says. You are missing > something.
Yes, a typo, I left the ^2 off the sum(x[n]^2) term. So, if parseval's relation holds, then it seems that (sum(x[n]^2))/N=sum((|X[k]|/N)^2=sum(P[n]) . (I use P to mean normalised power, power divided by R.) Is that OK? Owen

Owen Duffy wrote:...........
Doesn't look like anyone knows or cares :)
Anyway, I still reckon the N/2 term should be treated the same as the DC 
term for the purposes of satifying Parseval.
Blowing a gale here.

Alan

On 31 Mar, 06:13, Owen Duffy <n...@no.where> wrote:
> I see examples that indicate the the X[k] terms of a (rectangular window) > DFT are naturally in the same units as the input samples x[n], ie the |X[k] > | is the amplitude of a sine wave (with some phase offset).
Wrong. In the usual definition of the DFT there is a scaling term 1/N which messes this up.
> This does not seem consistent with energy conservation.
Energy is not conserved in the DFT because of the scaling term. An energy-preserving DFT would need a sqling term 1/sqrt(N) in both the DFT and the IDFT. With the usual definition, these two terms are collected as one 1/N scaling term in the IDFT.
> If parseval's relation holds, then it seems (sum(x[n]))/N=sum((|X[k]|/N)^2 > =sum(P[n]).
Parseval's relation doesn't hold with the usual DFT definition. Rune
> Parseval's relation doesn't hold with the usual DFT definition. > > Rune
Rune, I think Owen has taken the scaling into account but what he is saying is that the output bins do not represent the amplitude of the input samples - assuming that these are sine waves. My feeling is that they do, but you need to take the "negative frequncies" into account as well so that Parseval is satisfied. Alan
On 2 Apr, 13:42, Alan Peake <adpe...@nosspam.activ8.net.au> wrote:
> > Parseval's relation doesn't hold with the usual DFT definition. > > > Rune > > Rune, I think Owen has taken the scaling into account but what he is > saying is that > the output bins do not represent the amplitude of the input samples - > assuming that these are sine waves. My feeling is that they do, but you > need to take the "negative frequncies" into account as well so that > Parseval is satisfied.
You are right in that the whole spectrum has to be accounted for in the summation. You can do that either by summing over all the coefficients, or by using only one half-spectrum and multiply by 2 - ignoring edge effects at DC and Fs/2. As for Parseval's relation, it goes as (matlab) N=20; x=randn(N,1); % x is a column vector ex= x'*x; % compute energy in time domain X = fft(x); eX = X'*X/N; % compute energy in frequency domain % and account for non-unitary scaling % of the DFT Now eX==ex to within numerical precision. Rune
Rune Allnor <allnor@tele.ntnu.no> wrote in news:595f6b3f-3118-4b41-904f-
19f926bf86da@e6g2000prf.googlegroups.com:

...
> > You are right in that the whole spectrum has to be accounted for > in the summation. You can do that either by summing over all > the coefficients, or by using only one half-spectrum and > multiply by 2 - ignoring edge effects at DC and Fs/2. > > As for Parseval's relation, it goes as (matlab) > > N=20; > x=randn(N,1); % x is a column vector > ex= x'*x; % compute energy in time domain > > X = fft(x); > eX = X'*X/N; % compute energy in frequency domain > % and account for non-unitary scaling > % of the DFT
Thanks Rune, Can I rewrite the above two expressions (not in Matlab) as: X[k]=FFT(x[n]) ...(1) e[k]=X[k]'*X[k]/N ...(2) I have no problems with that. If I divide both sides by N, I have energy/time which is power (considering x to be voltage, and power normalised for resistance=1): e[k]/N=X[k]'*X[k]/N^2=P[k] Considering the case of P[0] if you follow my notation; If P[0]=X[0]'*X[0]/N^2 and P[0]=V[0]^2 or v[0]=P[0]^0.5, so the voltage v[0]=(X[0]'*X[0]/N^2)^0.5 which can be simplified to v[0]=abs(X[0])/N. Considering the case of P[N/2]; If P[N/2]=X[N/2]'*X[N/2]/N^2 and P[N/2]=Vpk^2/2 or v[N/2]=P[N/2]^0.5*2^0.5, so the voltage v[N/2]=(X[N/2]'*X[N/2]/N^2)^0.5*2^0.5 which can be simplified to v[N/2]=2^0.5*abs(X[N/2])/N. Considering the case of bins for n from 1 to N/2-1, if we wish to account for the power in the negative frequency bins to moving it (adding it) to the associated positive freqency bins; If P[n]=2*X[n]'*X[n]/N^2 and P[n]=Vpk^2/2 or v[n]=P[n]^0.5*2^0.5, so the voltage v[n]=(2*X[n]'*X[n]/N^2)^0.5*2^0.5 which can be simplified to v[n]=2*abs(X[n])/N. In all cases, v[x] is the peak value of the voltage. Are my calculations for the three cases of v flawed? Owen

Owen Duffy wrote:
..........
> Considering the case of P[N/2]; > > If P[N/2]=X[N/2]'*X[N/2]/N^2 and P[N/2]=Vpk^2/2 or
........... Owen, where are you getting the X[N/2]' term from? I can only see one term for X[N/2] just as there is only one DC term. Alan
Alan Peake <adpeake@nosspam.activ8.net.au> wrote in news:47F3FFF7.2030705
@nosspam.activ8.net.au:

> > > Owen Duffy wrote: > .......... >> Considering the case of P[N/2]; >> >> If P[N/2]=X[N/2]'*X[N/2]/N^2 and P[N/2]=Vpk^2/2 or > ........... > > Owen, where are you getting the X[N/2]' term from? I can only see one > term for X[N/2] just as there is only one DC term.
I assumed that Rune used the notation X[N/2]' to mean the comples conjugate of X[N/2], and I have used it in that way. Ah, the limits of ASCII text in writing mathematics.
> > Alan > >