Learn R Programming

fftab (version 0.1.0)

get_fx: Extract Fourier Coefficients and Components

Description

These utility functions extract specific components from a fftab object. get_fx retrieves the raw Fourier coefficients, while get_fx_norm ensures the coefficients are either normalized or not normalized based on the norm parameter.

Usage

get_fx(x)

get_fx_norm(x, norm = FALSE)

get_re(x)

get_im(x)

get_mod(x)

get_arg(x)

Value

The requested components:

  • get_fx: A complex vector of raw Fourier coefficients (fx) as stored in the object.

  • get_fx_norm: A complex vector of Fourier coefficients, explicitly normalized or non-normalized based on the norm parameter.

  • get_re: A numeric vector of real parts (re).

  • get_im: A numeric vector of imaginary parts (im).

  • get_mod: A numeric vector of magnitudes (mod).

  • get_arg: A numeric vector of phase angles (arg), in radians.

Arguments

x

A fftab object containing FFT results.

norm

Logical. If TRUE, forces normalized coefficients. If FALSE, ensures non-normalized coefficients.

Details

  • get_fx: Returns coefficients as they are stored in the fftab object.

  • get_fx_norm: Adjusts coefficients if they are not in the desired normalization state.

  • get_re, get_im: Extract real and imaginary components.

  • get_mod, get_arg: Compute magnitude and phase of coefficients.

See Also

to_cplx(), to_rect(), to_polr()

Examples

Run this code
fftab(c(1, 0, -1, 0)) |> get_fx()

fftab(c(1, 0, -1, 0)) |> get_fx_norm(norm = TRUE)

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

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

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

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

Run the code above in your browser using DataLab