periodogram_fft¶
- kgpy.fft.power.periodogram_fft(data, retain_dc=False)¶
This is a port of CCK’s pperiodogram_fft.pro to Python 3. Ported by NCG, 2020-07-30
Perform the simplest reasonable power spectral estimate, using the FFT and a Hann window. The normalization is such that the mean value of the result is approximately the mean squared value of the data. Works for 1D or 2D inputs. It should be noted that the expected error of this estimate of the power spectrum is about 100% (see Numerical Recipes). However, this routine is needed by the much better estimators powerspec and spec2d.
- Parameters:
data (
numpy.ndarray) – 1d or 2d array for which the power spectrum is desired. It is not assumed that the data is periodic; therefore, the data will be Hann windowed. It is also not assumed that the image is real. That’s why the normalization is such that the sum must be performed over both positive and negative k.retain_dc (
bool) – if True, then retain the DC offset when calculating the FFT. Ordinarily, the DC offset is subtracted before calculating the spectrum, because the Hanning window tends to make the offset bleed into the nearest neighbors of the DC element of the FFT.
- Returns: