ts_fil_fft: FFT Filter

View source: R/ts_fil_fft.R

ts_fil_fftR Documentation

FFT Filter

Description

Frequency-domain smoothing using the Fast Fourier Transform (FFT) to attenuate high-frequency components.

Usage

ts_fil_fft()

Details

The implementation estimates a cutoff based on spectral statistics and reconstructs the series from dominant frequencies.

Value

A ts_fil_fft object.

References

  • J. W. Cooley and J. W. Tukey (1965). An algorithm for the machine calculation of complex Fourier series. Math. Comput.

Examples

# Frequency-domain smoothing via FFT cutoff
# Load package and example data
library(daltoolbox)
data(tsd)
tsd$y[9] <- 2 * tsd$y[9]  # inject an outlier

# Fit FFT-based filter and reconstruct without high frequencies
filter <- ts_fil_fft()
filter <- fit(filter, tsd$y)
y <- transform(filter, tsd$y)

# Compare original vs frequency-smoothed series
plot_ts_pred(y = tsd$y, yadj = y)

tspredit documentation built on Feb. 11, 2026, 9:08 a.m.