fft2 - how does it work
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (1)
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
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.
Ver también
Categorías
Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!