Is my code correct?
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hind Aljallaf
el 8 de Dic. de 2022
Comentada: Walter Roberson
el 8 de Dic. de 2022
Is my code correct?
Get the Fourier transform of image3 using the fft2() command.
If the result does not seem to be interesting, center the spectrum of the result using the fftshift() command.
A=fft2(img3)
X=fftshift(img3)
image3=abs(A)
plot(image3)
imshow(image3,[])
image32=abs(X)
plot(image32)
imshow(image32,[])
0 comentarios
Respuesta aceptada
Walter Roberson
el 8 de Dic. de 2022
Your code will produce plots with one line for each column in A or X. It is not forbidden ... it just is seldom a good idea. Too difficult to make any sense out of the resulting plot.
5 comentarios
Walter Roberson
el 8 de Dic. de 2022
Steven is indicating that he does not see a statement from you of what you are trying to achieve, and so cannot make a recommendation as to whether your code is acceptable or should be changed. And I replied that it looks to me as if your lines
Get the Fourier transform of image3 using the fft2() command.
If the result does not seem to be interesting, center the spectrum of the result using the fftshift() command.
are the statement of what you want to do.
I find your code a bit awkward but it looks like it would work.
Hint:
a = randi([-9 9], 1,5) + 1i*randi([-9 9],1,5);
mat2str(a)
out1 = fftshift(abs(a));
out2 = abs(fftshift(a));
mat2str(out1)
mat2str(out2)
out1 == out2
Más respuestas (0)
Ver también
Categorías
Más información sobre Bartlett 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!