fft2 - how does it work

6 visualizzazioni (ultimi 30 giorni)
moose
moose il 18 Ago 2015
Commentato: moose il 25 Ago 2015
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?

Risposte (1)

Honglei Chen
Honglei Chen il 18 Ago 2015
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 Commenti
Honglei Chen
Honglei Chen il 24 Ago 2015
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 il 25 Ago 2015
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?

Accedi per commentare.

Categorie

Scopri di più su Fourier Analysis and Filtering in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by