This function implements an anomaly detection method that combines the Fast Fourier daltoolbox::transform (FFT)
with a changepoint-based cutoff strategy using the Binary Segmentation (BinSeg) method applied
to the cumulative sum (CUSUM) of the frequency spectrum.
The method first computes the FFT of the input time series and obtains its power spectrum.
Then, it applies a CUSUM transformation to the spectral density to enhance detection of gradual
transitions or accumulated changes in energy across frequencies. The Binary Segmentation method
is applied to the CUSUM-transformed spectrum to identify a changepoint that defines a cutoff
frequency.
Frequencies below this cutoff are removed from the spectrum, and the signal is reconstructed
using the inverse FFT. This produces a filtered signal that retains only the high-frequency
components, emphasizing potential anomalies.
Anomalies are then detected by measuring the deviation of the filtered signal from the original one,
and applying an outlier detection mechanism based on this residual.
This function extends the HARBINGER framework and returns an object of class hanr_fft_binseg_cusum
.