Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
IPython Notebook FFT Example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jedludlow
Copy link
Author

jedludlow commented Oct 30, 2020

@raproth, I apologize for not replying to your comment from so long ago. I somehow missed any notification about it.

The plot is not precisely a PSD. The power spectral density expresses signal power distribution as a function of frequency and has the property that the integral under the PSD over some frequency range represents the total signal power in that frequency range.

The plot I'm producing here is really just a plot of the magnitude of the Fourier coefficients. It's useful for reasoning about the amplitude of the various sinusoids that make up the underlying signal.

@jedludlow
Copy link
Author

jedludlow commented Oct 30, 2020

@pivdets, I'm not sure I fully understand your question, but I'll make an attempt at an answer to the ifft part.

I don't have time right now to extend the notebook to include the ifft case, but I can describe how you can figure it out on your own. You can take the Fourier spectrum results that are plotted in cell 9 at the end of the notebook and try to work backwards through the problem, using the ifft instead of fft in cell 4. If your code reproduces the signal plotted in cell 3 then you know you've got it working correctly. Maybe you can submit a pull request if you get it working. Once you have proven your method you can apply it to other Fourier spectra to recover the underlying signal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment