calc_fft | R Documentation |
Provides a utility wrapper for the builtin FFT function that is applied directly to function objects and that allows for the specification of desired sampling intervals, number of sampling points and spatial and amplitude scaling.
calc_fft(func, NFFT, range, scale_spatial = 1, scale_amp = 1)
func |
The function to be fft-ed. |
NFFT |
The number of sample points to be taken, thus the number of points in the fft. |
range |
The (spatial/temporal) range from which the samples are to be selected. Expected to be a two-element numerical vector. First element should be the smaller of the two boundaries. Note that the lower boundary will not be sampled since lower_bound + stepsize is taken as the starting point. |
scale_spatial |
(Optional) Can be given to take the fft of func(scale_spatial * x) instead of func(x). Yields exactly the same result as 'calc_fft(function(x) func(2*x), NFFT, range)'. |
scale_amp |
(Optional) Scale the amplitude of func by taking the fft of scale_amp * func(x) instead of func(x). |
An object of class "fft" that has two properties: $fft, which contains the actual result of the fft, and $vars, which contains a variety of parameters involved with the fft, such as the sampled frequencies, etc.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.