Skip to content

Discrete Fourier transform

Represent a signal as a combination of spatial frequencies.

Try it on your image ↓

VISUAL WALKTHROUGHSignal
REFERENCE INPUTMixed spatial frequencies

A slow oscillation and a faster ripple are added in the input signal.

RESULTReconstruct after removing the ripple

Removing the bin-12 component and its conjugate leaves the slow component. Grey retains the input for comparison.

STEP 03 / 03

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

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

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.

Input448 × 320
OutputWaiting for a result

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
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Filter periodic noise, analyze textures, or perform frequency-domain correlation.

How it works

  1. 01Transform spatial samples into frequency coefficients.
  2. 02Modify magnitudes or combine spectra while preserving required complex structure.
  3. 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.