Re: [R] FFT, frequs, magnitudes, phases

From: Peter Dalgaard <>
Date: Fri 19 Aug 2005 - 22:16:42 EST

Wolfgang Waser <> 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.

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).

   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (                  FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Fri Aug 19 22:21:20 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:54 EST