1
$\begingroup$

I tried to study the diffraction pattern of the following zigzag grating by Matlab(FFT of this image)..

enter image description here

And the result showed like this(please ignore the scale bar in this img)

enter image description here

I think the program of FFT by Matlab is correct.. I am just wondering why, in the FFT, the midpoint(0,0) did not show the strongest intensity..Because I did some calculation by a simple model of zigzag(two lines), the midpoint always shows the strongest brightness..

Any suggestions are welcomed.

$\endgroup$
2
$\begingroup$

The midpoint is the zero frequency component of the image. That is, it will be the sum all pixels in the image (or the amplitude of a wave with no frequency, a flat field across the image). I did the FFT of the image you posted above (using Python, sorry), and found the midpoint value to be 12598085. The image is 336 x 205 pixels, so the midpoint pixel represents an offset value of: 12598085 / 336 / 205 = 182.9. When I average all the pixels in the image, I get a value of 182.9. So that looks fine. Code is here (notice I'm plotting the inverse FFT of the FFT, so we can meddle with the FFT later):

from numpy import *
from matplotlib.pyplot import *
I = imread('/Users/Stardust/Desktop/PFeZL.jpg')
F = fft.fft2(I)
imshow(abs(fft.ifft2(F)), cmap='gray')
colorbar()
print 'Midpoint divided by number of pixels:' + str(abs(F[0,0]) / 336 / 205)
print 'Average: ' + str(mean(I))

This produces the result:

Midpoint divided by number of pixels:182.899027294
Average: 182.899027294

enter image description here

If I divide that midpoint pixel by five, then the offset should change:

F2 = copy(F)
F2[0,0] /= 5
imshow(abs(fft.ifft2(F2)), cmap='gray')
colorbar()
print F2[0,0]
print 'Midpoint divided by number of pixels:' + str(abs(F2[0,0]) / 336 / 205)

with the result:

(2519617+0j)
Midpoint divided by number of pixels:36.5798054588

enter image description here

Which is basically the same image but now the average pixel value is 1/5 of the previous average value.

Now why isn't your pixel the highest intensity pixel? My guess is that it is. Your image hasn't got much in the way of low frequency components other than the average offset of 182.9, so it may be that your eye is fooling you: there is one bright pixel surrounded by dim pixels, which your eye interprets as noise. The other spots are not quite discrete and show up as blurred regions which your eye interprets correctly. It could also be the FFT plot simply doesn't show that one pixel if the zoom is too low or some other silly artifact. You can test this by looking at the (0,0) component in your matrix and compare that against max(matrix) and see if it matches.

$\endgroup$
  • $\begingroup$ Tks for your explanation..I tried to lower the intensity of the whole FFT specturm. And then I can see clearly the midpoint(0,0) showed the highest intensity.. $\endgroup$ – Cici Jan 28 '15 at 6:45

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.