Diffraction pattern manipulation.

2 visualizaciones (últimos 30 días)
Regis Robles
Regis Robles el 22 de Mzo. de 2016
Comentada: Ali Dordaee el 31 de Oct. de 2019
I want to know how to take only the right part of a diffraction pattern matrix. Here is the diffraction pattern in a 1000x1000 matrix :
Here is the code I am using to take only the part from the center to the first 0 of the 'sinc like' pattern
Mask_radius = 0.431*dx;
Mask = sqrt(X.^2 + Y.^2) < Mask_radius;
S1 = abs(U_real.^2);
S2 = abs((Mask.*abs(fft_U)).^2);
It works but it is not very classy :s.
Result with the code :
  1 comentario
Ali Dordaee
Ali Dordaee el 31 de Oct. de 2019
Could you please send me the whole coding if you have fixed it? I really appreciate it. this is my Email:
alidordaee@gmail.com
If you want, you can also send the coding as my answer on this website. thanks so much.

Iniciar sesión para comentar.

Respuestas (2)

Image Analyst
Image Analyst el 22 de Mzo. de 2016
There is nothing wrong or unclassy about that code, except that you don't need the outer abs on S2. There are alternative ways of getting the same thing but they're not necessarily better, like
S2 = abs(fft_U); % Initialize
S2(~Mask) = 0; % Erase outside Mask
S2 = S2 .^ 2; % Square.
  2 comentarios
Regis Robles
Regis Robles el 23 de Mzo. de 2016
Yes, it is another way to do the same thing. But I want to know if it is possible to take only the center part of the fft_I = abs(fft_U.^2) matrix.
I want this because when I change some parameters in my program, the Mask matrix does not change and thus S2 = abs((Mask.*abs(fft_U)).^2) gives the wrong result. And in your way, it will be the same wrong result.
Image Analyst
Image Analyst el 23 de Mzo. de 2016
What does "take" mean? I can think of only two things: erase outside of it (which we've done), or to crop it out to its own image, which you can do by indexing or by using imcrop().

Iniciar sesión para comentar.


Tanweepriya Das
Tanweepriya Das el 9 de Ag. de 2018
was the problem solved finally?
  1 comentario
Image Analyst
Image Analyst el 9 de Ag. de 2018
Evidently not or else he would have marked my answer as "Accepted". Plus he never answered my question about what he means by take. However I doubt he's still working on it after 2 years.

Iniciar sesión para comentar.

Categorías

Más información sobre Financial Toolbox 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!

Translated by