Skip to contents

Mirrors the C# Fourier.RealFFT: transforms length(x) real values in place (length(x) must be a power of two) into the positive-frequency half of the complex transform.

Usage

dft_real(x, inverse = FALSE)

Arguments

x

numeric vector, real-valued, power-of-two length.

inverse

if TRUE, computes the inverse transform of a complex array that is the transform of real data (matching the C# doc comment – multiply by 2/length(x) for the true inverse).

Value

the transformed vector, same length as x.

Examples

dft_real(c(1, 2, 3, 4))
#> [1] 10 -2 -2 -2