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$
  • $\begingroup$ To clarify, do you want to take the DFT of these images? Or get a symbolic function to work with? $\endgroup$ – CA Trevillian Sep 7 at 0:45
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]
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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