ft | R Documentation |
The function returns a 2 column data frame with the first column (named fr or wf, depending whether w=F or w=T in the arguments respectively) containing the frequencies of the frequency space. The second column named fy contains the complex values of the fourier transform
ft(X,Y,w=F, set.nyquist = T)
X |
Contains the X component of the input function |
Y |
Contains the Y component of the input function |
w |
Set to w=F by default, it toggles between fr or wf=2*pi*fr on the frequency axis |
set.nyquist |
Ordinarily set to true, this argument(when true) promotes the dataset which is greater than half of the sampling frequency to the negative frequencies. |
Chitran Ghosal
library(StatsChitran) #Call library
X <- seq(-10*pi, 10*pi, length=200) #define the X values
Y <- sin(3*X) #define the Y values
df <- ft(X, Y, w = T, set.nyquist = T) #call the two-sided fourier transform
plot(df$wf, abs(df$fy), type='b', c(-5,5)) #plots the amplitude function
abline(v = c(-3, 3), col='red') #draws vertcals along the expected frequency points
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (x)
{
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.