-
Notifications
You must be signed in to change notification settings - Fork 0
signal.Dft.Function.dftRealSpectrum
Christian d'Heureuse edited this page Jun 6, 2026
·
2 revisions
dsp-collection / signal/Dft / dftRealSpectrum
function dftRealSpectrum(x, inclNyquist?): ComplexArray;Computes the complex spectrum of an array of real numbers. The result is the normalized lower half of the DFT.
ArrayLike<number>
The input values (samples).
boolean = false
If true and x.length is even, the value for the relative frequency x.length / 2
(Nyquist frequency, half the sample rate) is included in the output array.
This is done to allow an exact re-synthesis of the original signal from the spectrum.
But the Nyquist frequency component is an artifact and does not represent the phase
and amplitude of that frequency. The phase is always 0.
It's not possible to compute a proper value for the Nyquist frequency.
An array of complex numbers that represent the spectrum of the input signal.