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?
What about for more complex images such as:
or
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
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP