1
$\begingroup$

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

$\endgroup$
1
  • $\begingroup$ To clarify, do you want to take the DFT of these images? Or get a symbolic function to work with? $\endgroup$ Commented Sep 7, 2020 at 0:45

1 Answer 1

1
$\begingroup$

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]
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.