Predrag Valozic- Also keep in mind that the 1/N scaling is for the time domain data length, not necessarily for full FFT length. For example, if time data set is 10, and FFT length is 8 (zero filling = 54), then scale value is 1/10 for accurate amplitude scaling in f-domain. In the general case, if a window is used, then I think the accurate scaling factor, for example to see same linear magnitude amplitude value in f domain as Vpp in time domain for a sine wave, is sum(window values)/N, where N = window length. Jeff Brower DSP sw/hw engineer Signalogic > There are few reasons, fft and Parseval theorem doesn't fit: > 1. 1/N scaling is missing in fft Matlab algorithm > 2. One sided and two sided spectrums > 3. Relation between signal period and N > 4. Window function. > > 1. If one do a simple test: > N; > P2=2*4*atan(1); > t=[0:P2/N:P2]; > x=sin(2*t); > Xt(x,N); > Xas(X) > Xa = > Columns 1 through 7 > 0.0000 0.0000 8.0000 0.0000 0.0000 0.0000 0.0000 > Columns 8 through 14 > 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 > Columns 15 through 16 > 8.0000 0.0000 > It is obvious, that 1/N is missing because the correct value is 0.5. > If one does scaling, then Parsaval theorem is fulfilled. > Xa = Xa/N > Xa = > Columns 1 through 7 > 0.0000 0.0000 0.5000 0.0000 0.0000 0.0000 0.0000 > Columns 8 through 14 > 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 > Columns 15 through 16 > 0.5000 0.0000 > > 2. Amplitude of a single sided spectral component is twice the amplitude in > FFT spectrum. > > 3. If the signal period is not N or N/2, or N/3 ... the slight difference is > possible. > > 4. If window function is implemented, then the Parsaval theorem stands for > modified signal. > > Best regards, > > Predrag Valozic > > ----- Original Message ----- > From: Sergio Dominguez <> > To: Ervin <> > Cc: <> > Sent: 2003. velja 17 09:57 > Subject: Re: [matlab] spectrum and fft > > > OK, I understand what you mean, but it is different for every > implementation, > > not for every transform you do, is that right?? I mean, has not the people > > from matlab determined what is the scaling factor for their > implementation, > > because in the single example they give of it they scale it by the number > of > > points, which does not give the right scaling. Does it? > > > > Basically what I am trying to do is to estimate the spectrum of a time > series > > (using spectrum or psd) and test the parseval theorem. Has anyone been > working > > with the spectrum with coherents results? > > > > Sergio > > > > > > A las 05:25 del 15 de Feb de 2003, Ervin <> dijo: > > > Helo Sergio! > > > Basically every FFT algorithm implemented on the > > > computer has a problem with it. It doesnt do scaling > > > properly, so you have to play with it, until you find > > > out what scales it uses. > > > Cheers! > > > Ervin > > > --- Sergio Dominguez <> wrote: > > > > Hi all! > > > > > > > > Has anybody found anything strange working with the > > > > spectrum and fft functions > > > > implemented in matlab?? > > > > > > > > The frecuency behaviour is OK, but there is some > > > > scaling factor missing. > > > > Basically I do not get the parseval theorem to apply > > > > when I find the spectrum > > > > with matlab, and if I do a fft of some functions the > > > > initial values are not > > > > correct. > > > > > > > > Anybody seen something like this? > > > > > > > > Thanks, > > > > > > > > Sergio > > > > > > > > > > > > > > > > > > > > > ===== > > > Ervin |
|