sammyny
2011-Feb-13 01:47 UTC
[R] calculate phase/amplitude of fourier transform function in R
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. -- View this message in context: http://r.789695.n4.nabble.com/calculate-phase-amplitude-of-fourier-transform-function-in-R-tp3303345p3303345.html Sent from the R help mailing list archive at Nabble.com.
Jose-Marcio Martins da Cruz
2011-Feb-13 10:41 UTC
[R] calculate phase/amplitude of fourier transform function in R
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.>