Skip to content

signal.Goertzel.Function.goertzelSingle

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

dsp-collection / signal/Goertzel / goertzelSingle

Function: goertzelSingle()

function goertzelSingle(x, relativeFrequency): MutableComplex;

Defined in: signal/Goertzel.ts:26

Computes the DFT on an array of real numbers for a single frequency.

Parameters

x

ArrayLike<number>

The input values (samples).

relativeFrequency

number

A frequency relative to x.length. It represents the number of sinusoidal oscillations within x and is normally an integer within the range 0 (for DC) to Math.floor((x.length - 1) / 2). The absolute frequency is relativeFrequency * samplingRate / x.length.

Returns

MutableComplex

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.

Clone this wiki locally