-
Notifications
You must be signed in to change notification settings - Fork 0
signal.Dft.Function.dftRealSingle
dsp-collection / signal/Dft / dftRealSingle
function dftRealSingle(x, relativeFrequency): MutableComplex;Defined in: signal/Dft.ts:35
Computes the DFT on an array of real numbers for a single frequency.
This is a reference implementation without any optimization. It's simple to understand, but slow.
ArrayLike<number>
The input values (samples).
number
A frequency relative to x.length.
It represents the number of sinusoidal oscillations within x
and is normally within the range 0 (for DC) to Math.floor((x.length - 1) / 2).
The absolute frequency is relativeFrequency * samplingRate / x.length.
A complex number that corresponds to the amplitude and phase of a sinusoidal frequency component.
The amplitude can be normalized by mutliplying 1 / x.length for DC and 2 / x.length
for frequencies > 0 and < x.length / 2.