Borrar filtros
Borrar filtros

fft2 - how does it work

4 visualizaciones (últimos 30 días)
moose
moose el 18 de Ag. de 2015
Comentada: moose el 25 de Ag. de 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?

Respuestas (1)

Honglei Chen
Honglei Chen el 18 de Ag. de 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 comentarios
Honglei Chen
Honglei Chen el 24 de Ag. de 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 el 25 de Ag. de 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?

Iniciar sesión para comentar.

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by