3

I would like to convert FFT data which is set of 396 values for 396 frequencies (from 4Hz to 399Hz by 1Hz) in unit of g's (gravitational akcceleration) to PSD in unit of (g^2)/Hz, is it possible? Thank you for your help.

Rosta123
  • 31
  • 1
  • 1
  • 2
  • which is accepted answer here please? psd = abs(X_fft)^2 (by @Harris) or psd = (X_fft^2)/(2.0*df) (by @James)? I would to know the correct formula. I have the fft of my data as X_fft. – arilwan Jan 16 '23 at 01:04

3 Answers3

2

If X is your fft data then you need to take Y=abs(X).^2; to convert it. Your frequency axis is f=4:399;. You can plot the result then using plot(f,Y).

Harris
  • 477
  • 2
  • 5
2

To get the PSD from your FFT values, square each FFT value and divide by 2 times the frequency spacing on your x axis.

PSDvalue=(fftValue^2.0)/(2.0*df)

If you want to check the output is scaled correctly, the area under the PSD should be equal to the variance of the original signal.

If your FFT is zero padded, you also need to multiply by the zero padding ratio:

zp=number of points in Fourier Transform/Number of points in original time series

James Dilworth
  • 118
  • 1
  • 7
1

See Scaling the PSD for proper Scaling after $|X|^2$ has been computed.

Jdip
  • 5,980
  • 3
  • 7
  • 29