Clear Filters
Clear Filters

I would like to see the output when an inpiut field passes through a diffuser and retraces its path through the same scattering medium. I have written the following code. Am I correct while retracing ? Please can someone advice me?

1 view (last 30 days)
clear all
close all
%define diffuser
diffuser=rand(100,100);
%define input phase matrix
Ein=exp(1i*rand(100,100));
%filed just after the diffuser
dback=diffuser.*Ein;
%field after first forward propagation
forwardfield=fftshift(fft2(dback));
%now to retrace the path i took the transpose of the forward field and then
%applied the fft to get the field just on the diffuser
forwarddield1=transpose(forwardfield);
bdiff=fftshift(fft2(forwarddield1));
%now to get the filed just after the diffudser multiplyied with the
%transpose of diffuser
Eout=bdiff.*transpose(diffuser);

Accepted Answer

Walter Roberson
Walter Roberson on 2 May 2017
I am not familiar with diffusers, but it looks likely to me that you should be doing
bdiff = ifft2( fftshift(forwarddield1) );
In particular your forwarddield1 has already had fftshift() applied to an fft2, so doing an fft2() on that would not be an inverse operation even if the units were right.
  2 Comments
sanjeev a
sanjeev a on 2 May 2017
Thanks Walter. Yes you are right. I would like to clarify one more thing. Bascially my setup is like I have a diffuser then screen which directs back the filed through the same diffuser. So just after applying the ifft , shouldn't we take the transpose of it and multiply with the transpose of the diffiser? I am not sure. I am just asking if I am correct

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!