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.
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 thenorm
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.
Details
get_fx
: Returns coefficients as they are stored in thefftab
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.
Examples
fftab(c(1, 0, -1, 0)) |> get_fx()
#> [1] 0+0i 2+0i 0+0i 2+0i
fftab(c(1, 0, -1, 0)) |> get_fx_norm(norm = TRUE)
#> [1] 0.0+0i 0.5+0i 0.0+0i 0.5+0i
fftab(c(1, 0, -1, 0)) |> get_re()
#> [1] 0 2 0 2
fftab(c(1, 0, -1, 0)) |> get_im()
#> [1] 0 0 0 0
fftab(c(1, 0, -1, 0)) |> get_mod()
#> [1] 0 2 0 2
fftab(c(1, 0, -1, 0)) |> get_arg()
#> [1] 0 0 0 0