[R] FFT, frequs, magnitudes, phases

Martin Maechler maechler at stat.math.ethz.ch
Sat Aug 20 15:58:34 CEST 2005


>>>>> "PD" == Peter Dalgaard <p.dalgaard at biostat.ku.dk>
>>>>>     on 19 Aug 2005 14:16:42 +0200 writes:

    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




More information about the R-help mailing list