[R] calculate phase/amplitude of fourier transform function in R

Jose-Marcio Martins da Cruz Jose-Marcio.Martins at mines-paristech.fr
Sun Feb 13 11:41:16 CET 2011


sammyny wrote:
>
> I did a fourier transform on a function in time domain to get the following
> functions in frequency domain (in latex):
>
> $Y_1[\omega] = \frac{1}{1-\phi_1 e^{-jw}}$
>
> $Y_2[\omega] = \frac{1}{1-(\phi_1 + \phi_2)e^{-jw} +\phi_1\phi_2e^{-2jw}}$
>
> How do I find the spectrum of this function for given $\phi_1$ and $\phi_2$
> coefficients and in the discretization interval $w = [-\pi:.1*\pi: \pi]$?
> Then, how do I find the 'magnitude' of spectrum and 'phase' of spectrum in
> R?
>
> Is there an existing package/function in R? An example would be very
> helpful.

Take a look at fft - help(fft) - to know how to get the fourier 
transform and complex - help(complex) - to know how to get the magnitude 
and phase of complex values. Usually you'll find examples on help pages.

>



More information about the R-help mailing list