cspec (version 0.1.2)

fft2: A new DFT function

Description

Function to calculate the DFT of time series vector as in the reference.

Usage

fft2(x, freq = 2 * pi * (1:length(x))/length(x))

Arguments

x

time series vector.

freq

frequency vector.

Value

DFT vector.

Details

sqrt(n) standardized. The default frequencies are 2*pi*(1:n)/n, where n is a length of a time series.

References

S. Das, S. Subba Rao, and J. Yang. Spectral methods for small sample time series: A complete periodogram approach. Submitted, 2020.

See Also

taperDFT

Examples

Run this code
# NOT RUN {
set.seed(123)
x <- arima.sim(model=list(ar=0.7), n=100)
v <- fft2(x)
# }

Run the code above in your browser using DataCamp Workspace