Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magnitude of fft showing negative values #100

Closed
satra opened this issue May 7, 2012 · 4 comments
Closed

magnitude of fft showing negative values #100

satra opened this issue May 7, 2012 · 4 comments

Comments

@satra
Copy link
Member

satra commented May 7, 2012

in the following example:

http://nipy.sourceforge.net/nitime/examples/filtering_fmri.html

the first figure shows the FFT as having negative power.

@arokem
Copy link
Member

arokem commented May 7, 2012

Yeah - that doesn't seem right. I will take a look.

@arokem
Copy link
Member

arokem commented May 7, 2012

OK - got it. This is because S_original.spectrum_fourier returns the complex spectrum and when it is plotted, we only get the real part, not the absolute value.

So - there are a few possible ways to go about this: one would be that the analyzer would return the absolute value, to be consistent with the other spectral analysis methods. But that would mean throwing away the phase information. The other option is for the code in the example to take the absolute value before plotting. I favor the latter, but I am open to suggestions.

What do you think?

@satra
Copy link
Member Author

satra commented May 8, 2012

two thoughts. without having looked into the code and from my understanding of welch, i suspect the others are really returning the power spectral density (dB/Hz) whereas the fft is returning the complex spectrum. for the code example i think it would be prudent simply to plot the magnitude of the complex value.

@arokem
Copy link
Member

arokem commented Jun 6, 2012

This is closed by that commit

@arokem arokem closed this as completed Jun 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants