3

I want to use FFTW to calculate a power spectrum of a signal. Using the real transforms (in <rfftw.h>) I can simply calculate the discrete fourier transforms for the sine- and cosine-functions, square the elements and add them together respectively. Or I can calculate the complex one-dimensional transform and take the norm of each element.

I was wondering if there is a better way of calculating the power spectrum directly. I looked in the FFTW reference, but didn't find a dedicated power-spectrum-function. Maybe I am splitting hairs here, but I was thinking maybe there is a dedicated algorithm that calculates the power in each frequency more efficiently since I don't need the phase-information at all. Calculating both components (sine and cosine coeficients, or real and imaginary parts) and then throwing away one seems kind of inefficient.

Eric Postpischil
  • 195,579
  • 13
  • 168
  • 312
exocortex
  • 375
  • 2
  • 9
  • 1
    To the close-voter: This question does not ask for recommendations for software etc. It asks for a method to compute a specific function, which might involve mathematics or some technique of using FFTW. – Eric Postpischil Aug 17 '21 at 11:53

0 Answers0