TransWikia.com

2-D Fourier series components from image

Mathematica Asked by Tom Waits on December 20, 2020

Suppose I draw a black/white image where the color black represents 1.0 and the color white represents 0. Is there a way to extract numerical estimates for the coefficients of a (real) 2-D Fourier series which approximates this image?

Here is a simple example:
enter image description here

What about for more complex images such as:

enter image description here

or

enter image description here

One Answer

As you want a real FFT, the picture must by symmetric or anti-symmetric. Here is a simple symmetric example:

dat = Table[If[x^2 + y^2 < 4, 0, 1], {x, -n, n}, {y, -n, n}];
MatrixPlot[dat]
fdat = FourierDCT[dat] // Chop;
MatrixPlot[fdat]

Here a more complicated one:

n = 5;
dat = Table[If[OddQ[x + y], 0, 1], {x, -n, n}, {y, -n, n}];
MatrixPlot[dat]
fdat = FourierDCT[dat] // Chop;
MatrixPlot[fdat]

And here a circle:

n = 100;
dat = Table[If[x^2 + y^2 < .5 10^4, 0, 1], {x, -n, n}, {y, -n, n}];
MatrixPlot[dat]
fdat = FourierDCT[dat] // Chop;
MatrixPlot[fdat]

Answered by Daniel Huber on December 20, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP