fftab {fftab}R Documentation

Perform FFT and IFFT with Tidy Results

Description

Provides functions to compute the Fast Fourier Transform (FFT) and its inverse (IFFT) while maintaining results in a tabular format. Supports vectors, time series (ts), and arrays as inputs.

Usage

fftab(x, norm = FALSE)

## Default S3 method:
fftab(x, norm = FALSE)

## S3 method for class 'ts'
fftab(x, norm = FALSE)

## S3 method for class 'array'
fftab(x, norm = FALSE)

ifftab(x)

Arguments

x

Input object for which to compute the FFT or IFFT. This can be:

  • A numeric vector (default method for fftab).

  • A time series object (ts) for fftab.ts.

  • A multidimensional numeric array for fftab.array.

  • A fftab object for ifftab.

norm

Logical. If TRUE, computes normalized coefficients for FFT.

Details

Value

FFT

The fftab function computes the FFT for different input types:

Results are returned as a tibble containing Fourier frequencies and FFT values.

IFFT

The ifftab function reconstructs the original signal from a fftab object. It supports vectors, arrays, and time series inputs. The inverse transform preserves the original structure (e.g., array dimensions or time series attributes).

See Also

stats::fft()

Examples

fftab(c(1, 0, -1, 0))

fftab(c(1, 0, -1, 0)) |> ifftab()

ts(sin(1:10), frequency = 12) |> fftab()

array(1:8, dim = c(2, 2, 2)) |> fftab()


[Package fftab version 0.1.0 Index]