Discrete Fourier transform
Represent a signal as a combination of spatial frequencies.
A slow oscillation and a faster ripple are added in the input signal.
The violet component completes three cycles; orange completes twelve over the same 64 samples.
The computed DFT places the energy in bins 3 and 12. Only the positive-frequency half is drawn.
Removing the bin-12 component and its conjugate leaves the slow component. Grey retains the input for comparison.
Apply an inverse transform to return to spatial data.
Computed 64-sample Fourier example. The result demonstrates an optional frequency filter, not a change performed automatically by dft.
Try it on an image
Experiment at pixel level
Transform grayscale to a complex Fourier spectrum. Preview shows log magnitude with DC at the upper left; native channels contain the real and imaginary coefficients.
The engine loads on your first run. Your images stay in this browser.
Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.
Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Select a pixel
Select a pixel
When to use it
Filter periodic noise, analyze textures, or perform frequency-domain correlation.
How it works
- 01Transform spatial samples into frequency coefficients.
- 02Modify magnitudes or combine spectra while preserving required complex structure.
- 03Apply an inverse transform to return to spatial data.
spatial samples ↔ complex frequency coefficients
What to tune
DFT flags control direction, scaling and complex layout. Use supported optimal sizes when padding is appropriate.
Where it breaks down
Boundary discontinuities spread energy across frequencies. Padding, windowing, complex layouts and inverse scaling need deliberate choices.
TypeScript API
Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.
All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.