Type: Package
Title: Fast Iterative Filtering (FIF) with Portable FFT Backend
Version: 1.0
Description: Provides an R interface to a C implementation of Fast Iterative Filtering (FIF) for decomposing a univariate signal into intrinsic mode functions (IMFs) and a residual. The package uses Fast Fourier Transform library FFTW, if found. If not, it provides instructions to install it for your OS. This is recommended, as R's internal fft(), while avoiding external FFT dependencies, is two orders of magnitude slower.
Suggests: testthat (≥ 3.0.0), knitr, rmarkdown
Config/testthat/edition: 3
License: MIT + file LICENSE
Encoding: UTF-8
VignetteBuilder: knitr
URL: https://github.com/ChuckColeman/RFIF
BugReports: https://github.com/ChuckColeman/RFIF/issues
NeedsCompilation: yes
Packaged: 2026-03-26 21:19:01 UTC; Common
Author: Chuck Coleman ORCID iD [aut, cre]
Maintainer: Chuck Coleman <cdcoleman113@gmail.com>
Repository: CRAN
Date/Publication: 2026-03-31 10:10:11 UTC

Fast Iterative Filtering (C backend)

Description

Decompose a univariate signal into Intrinsic Mode Functions (IMFs) using the vendored C implementation of Fast Iterative Filtering (FIF).

Usage

rfif(x)

Arguments

x

Numeric vector (signal).

Value

A list with components:

Examples

t <- seq(0, 1, length.out = 1024)
x <- sin(2*pi*5*t) + 0.5*sin(2*pi*20*t)
res <- rfif(x)
recon <- if (res$nimf > 0) colSums(res$imfs) + res$residual else res$residual
max(abs(x - recon))