fourier_frequencies {fftab}R Documentation

Compute Fourier Frequencies

Description

Computes Fourier frequencies for various types of inputs, such as scalars, vectors, matrices, time series, or arrays. This generic function dispatches appropriate methods based on the input type.

Usage

fourier_frequencies(x)

## Default S3 method:
fourier_frequencies(x)

## S3 method for class 'ts'
fourier_frequencies(x)

## S3 method for class 'array'
fourier_frequencies(x)

Arguments

x

The input object. Supported input types:

  • Scalar or vector: The length of the sequence.

  • Time series (ts): Frequencies are scaled based on the sampling rate.

  • Multidimensional array or matrix: Frequencies are computed for each dimension.

Details

This function has the following methods:

See the examples for details on each case.

Value

A tibble where:

See Also

tidyr::expand_grid(), frequency()

Examples

# Default input (vector)
fourier_frequencies(8)

# Time series input
ts(rnorm(36), frequency = 12) |> fourier_frequencies()

# Multidimensional array input
array(1:27, dim = c(3, 3, 3)) |> fourier_frequencies()

# Matrix input
matrix(1:9, nrow = 3, ncol = 3) |> fourier_frequencies()


[Package fftab version 0.1.0 Index]