Skip to content

signal.Fft.Function.fftRealHalf

Christian d'Heureuse edited this page Jun 7, 2026 · 2 revisions

dsp-collection / signal/Fft / fftRealHalf

Function: fftRealHalf()

function fftRealHalf(x, inclNyquist?): ComplexArray;

Defined in: signal/Fft.ts:189

Computes the lower half FFT of an array of real numbers and returns the lower half of the complex result.

This version is optimized for real numbers. The time-consuming FFT algorithm is only performed with half the array size of the input signal.

The size of the input array must be even.

Parameters

x

ArrayLike<number>

The input values (samples). The size must be even.

inclNyquist?

boolean = false

If true, the Nyquist frequency component artifact is appended to the output array.

Returns

ComplexArray

An array of complex numbers. If inclNyquistis `false, the output array is half the size of the input array. Otherwise it is 1 element longer.

Clone this wiki locally