Qu

dft

Builtin index · Signal processing

result = dft(x)

Input: x · Output: result

What it is

x is a length-N real or complex vector.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = dft(x)
x vectornot documented yet
result CVec
Returns a length-N CVec. The direct, textbook O(n²) transform, kept as an independent reference implementation to validate fft against and as the definitional basis goertzel specializes.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

  err = max(abs(fft(x) - dft(x)))   # ~0 to floating precision

from numerics-dsp

How it works

dft(x)/idft(X) -- the direct, textbook O(n²) transform (distinct from the Bluestein/rustfft-accelerated fft), kept as an independent reference implementation to validate fft against and as the definitional basis goertzel below specializes to a single frequency.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.