| ts_fil_fft | R Documentation |
Frequency-domain smoothing using the Fast Fourier Transform (FFT) to attenuate high-frequency components.
ts_fil_fft()
The implementation keeps the lowest frequencies that explain most of the spectral energy and reconstructs the series from that low-pass spectrum.
A ts_fil_fft object.
J. W. Cooley and J. W. Tukey (1965). An algorithm for the machine calculation of complex Fourier series. Math. Comput.
# Frequency-domain smoothing via FFT low-pass reconstruction
# Load package and example data
library(daltoolbox)
library(tspredit)
x <- seq(0, 4 * pi, length.out = 128)
y <- sin(x) + 0.25 * sin(12 * x)
# Fit FFT-based filter and reconstruct the low-frequency signal
filter <- ts_fil_fft()
filter <- fit(filter, y)
yhat <- transform(filter, y)
# Compare original vs frequency-smoothed series
plot_ts_pred(y = y, yadj = yhat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.