Two dimensional fourier transform
Show older comments
How to determine and display the two dimensional fourier transform of a thin, rectangular object? The object should be 2 by 10 pixels in size and solid white against a black background. The size of the image should bye 22x30 pixels and the rectangular object should be placed in the center of the image. fft2 and n=128 as a mesh plot as well as an image plot. Before plotting log of [Fmat(u,v)] needs to be done to improve the details.
Accepted Answer
More Answers (1)
Well, a few hints since it's obviously homework
- Use ifftshift and fftshift in appropriate places
- Know where the origin is and where the "center" of the rectangle should be
A 1D example
>> x=[0 0 1 1 1 1 1 0]; fftshift( fft(ifftshift(x)) )
ans =
1.0000 -0.4142 -1.0000 2.4142 5.0000 2.4142 -1.0000 -0.4142
8 Comments
P
on 27 Jan 2013
P
on 27 Jan 2013
Image Analyst
on 27 Jan 2013
I'd guess that n=128 was supposed to be your image size (128 rows by 128 columns), not 22 x 30 as you have it.
P
on 27 Jan 2013
Image Analyst
on 27 Jan 2013
I don't know what she means by a mesh plot. You can't use an fft with 128 samples on an image with less than 128 samples (like 22 or 30) - it just won't fit. Regarding the black display, since you're displaying a floating point image, make sure you use [] in imshow:
imshow(theImage, []);
P
on 28 Jan 2013
Categories
Find more on Matched Filter and Ambiguity Function in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!