dft

dft(x, inverse=False)

Discrete Fourier transform.

Mirrors the C# Fourier.FFT: an in-place complex FFT on data packed as [re0, im0, re1, im1, ...]; len(x) / 2 must be a power of two.

Parameters

Name Type Description Default
x array_like Complex data packed as [re0, im0, re1, im1, ...]. required
inverse bool If True, computes n times the inverse transform (matching the C# doc comment – divide by n for the true inverse). False

Returns

Name Type Description
numpy.ndarray Same length as x.

Examples

>>> from corehydropy import dft
>>> len(dft([1, 0, 2, 0, 3, 0, 4, 0]))
8