Skip to content

FFT, frequs, magnitudes, phases

3 messages · Wolfgang Waser, Peter Dalgaard, Martin Maechler

#
Hi,

I'm in dire need of a fast fourier transformation for me stupid biologist, 
i.e. I have a heartbeat signal and would like to decompose it into pure sin 
waves, getting three vectors, one containing the frequencies of the sin 
waves, one the magnitudes and one the phases (that's what I get from my data 
acquisition software's FFT function).
I'd be very much obliged, if someone could point out which command would do 
the job in R.

Thanks!

Wolfgang
#
Wolfgang Waser <wolfgang.waser at rz.hu-berlin.de> writes:
fft(), but notice that it gives the complex transform. You need to do
a little homework to get at the magnitude/phase values. (Basically,
you just have to take Mod() and Arg(), but there some conventions
about the frequencies and multipliers that one can get wrong).
1 day later
#
PD> Wolfgang Waser <wolfgang.waser at rz.hu-berlin.de> writes:
    >> Hi,
    >> 
    >> I'm in dire need of a fast fourier transformation for me
    >> stupid biologist, i.e. I have a heartbeat signal and
    >> would like to decompose it into pure sin waves, getting
    >> three vectors, one containing the frequencies of the sin
    >> waves, one the magnitudes and one the phases (that's what
    >> I get from my data acquisition software's FFT function).
    >> I'd be very much obliged, if someone could point out
    >> which command would do the job in R.

    PD> fft(), but notice that it gives the complex
    PD> transform. You need to do a little homework to get at
    PD> the magnitude/phase values. (Basically, you just have to
    PD> take Mod() and Arg(), but there some conventions about
    PD> the frequencies and multipliers that one can get wrong).

Once you've finished the "homework", others might be interested
in your result... so it will be found in the future using 
RSiteSearch().

Martin