fft2 - how does it work

조회 수: 6 (최근 30일)
moose
moose 2015년 8월 18일
댓글: moose 2015년 8월 25일
Hello, I am trying to understand how fft2 works and what it really means by simple example - my image is black&white stripes:
n = 256;
step = 4;
m_in = zeros(n,n);
for i = 1 : step : n
m_in(:,i) = 1;
end
I've noticed that if my step is power of 2 then
imshow(abs(fftshift(fft(m_in))))
will provide a black image with step number of white dots (4 in the above example).
Why is that?
Also, if my step in NOT power of 2 (for example step=7), then
imshow(abs(fftshift(fft(m_in))))
will result in simply a full white line accross the entire pic (like in the image below):
Why is that?

답변 (1개)

Honglei Chen
Honglei Chen 2015년 8월 18일
I'm a bit confused by your question, there is no fft2 in your code. All you do is fft along columns. Also for your code, if I change step to 7, I also get a series white dots, which is expected. I don't get that white line.
  댓글 수: 3
Honglei Chen
Honglei Chen 2015년 8월 24일
This time your code is using fft2 instead of fft. Before, you set every 7th column to all 1's, so the fft of that is an impulse. That's why you'll see white dots at every 7th column.
moose
moose 2015년 8월 25일
Thanks again Chen. But my question remains - why in the above code, when my step is a power of 2 (4,8,16, etc...), I receive a series of dots (4,8,16 dots, respectively)... while if my step is NOT a power of 2 (7,9, etc...), I get a straight line?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by