2D FFT Image Calculator

Compute spectra, phase, centered magnitude, and filtered reconstructions fast. Enter grayscale matrices and inspect symmetry. Compare frequency patterns using clear tables and graphs instantly.

Calculator Inputs

This educational implementation uses direct DFT logic. For quick performance, keep matrices at 16 × 16 or smaller.

The matrix must match the selected rows and columns exactly.

Example Data Table

You can paste this small matrix to test the calculator quickly.

r\c 1 2 3 4
112182418
218324832
324487248
418324832

Formula Used

Forward 2D discrete Fourier transform:

\( F(u,v)=\sum_{x=0}^{M-1}\sum_{y=0}^{N-1} f(x,y)\,e^{-j2\pi(\frac{ux}{M}+\frac{vy}{N})} \)

Magnitude spectrum:

\( |F(u,v)|=\sqrt{\Re(F)^2+\Im(F)^2} \)

Phase spectrum:

\( \phi(u,v)=\tan^{-1}\left(\frac{\Im(F)}{\Re(F)}\right) \)

Inverse 2D transform:

\( f(x,y)=\frac{1}{MN}\sum_{u=0}^{M-1}\sum_{v=0}^{N-1} F(u,v)\,e^{j2\pi(\frac{ux}{M}+\frac{vy}{N})} \)

Frequency filtering:

A binary mask \( H(u,v) \) is multiplied with the centered spectrum, so the filtered spectrum becomes \( G(u,v)=F(u,v)\cdot H(u,v) \).

The calculator also reports energy, entropy, peak bins, and reconstruction error. Under the displayed scaling, Parseval-style energy comparison remains a useful diagnostic.

How to Use This Calculator

  1. Choose the matrix size. Keep rows and columns between 2 and 16.
  2. Paste a grayscale intensity matrix. Each line is one image row.
  3. Select an optional window to reduce edge discontinuities before analysis.
  4. Pick a frequency filter and enter one or two radii.
  5. Enable log magnitude for easier spectrum viewing when values vary widely.
  6. Enable reconstruction if you want the filtered image estimate back.
  7. Press the calculate button. Results, tables, and graphs appear above the form.
  8. Use the CSV and PDF buttons to export the summary and coefficient results.

FAQs

1. What does this calculator measure?

It converts a grayscale matrix into its 2D frequency representation, then reports magnitude, phase, dominant bins, filtering effects, and optional inverse reconstruction.

2. Why is the matrix size limited?

This page uses direct discrete Fourier transform loops for clarity. Larger matrices grow computational cost rapidly, so smaller educational inputs keep processing smooth.

3. What is a centered spectrum?

Centering moves the zero-frequency component from the corner to the middle. That makes low-pass and high-pass patterns easier to see and interpret visually.

4. Why use log magnitude?

Raw spectra often have one very large low-frequency term. Log scaling compresses large values and reveals weaker components that would otherwise look invisible.

5. What do Hann and Hamming windows do?

They taper image edges before transforming. This reduces abrupt border jumps and can lower spectral leakage in the displayed frequency content.

6. How do the filters work?

The calculator builds a binary mask in frequency space. Low-pass keeps nearby central bins, high-pass keeps distant bins, and band filters keep or reject ranges.

7. Why does the reconstructed image look different?

Filtering removes selected frequencies, so reconstruction uses only the remaining spectrum. Clipping can also change values if the recovered matrix exceeds the display range.

8. Can I use color images?

This version expects a single grayscale matrix. For color work, transform each channel separately or convert the image into grayscale first.

Related Calculators

fft spectrum analyzersignal spectrum analyzerfrequency to time converterinverse fourier transform calculatorfourier energy calculatoridft calculatorsymbolic fourier transformconvolution theorem calculatorexponential fourier series calculator3d fourier transform calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.