Hello I'm having a difficulty using the split step Fourier method. Assuming I want to propagate a Gaussian in free space, I'm supposed to use:
A(x,z) = F^-1 [exp((i*k^2*z)/(2*k_0))* F[A(x,0)]]
where F is the Fourier and F^-1 is the inverse Fourier.
What I want to do is plot I(x,z=0), I(x,z=3) and the intensity distribution in the x-z plane.
I tried doing it numerically (plotting I(x,z=0), I(x,z=3)) using the following code:
lambda = 0.5*10^-6;
k0 = 2*pi/lambda;
w = 10*10^-6;
N=500;
a=0.4*10^-4;
dx=a/N;
x = -a/2:dx:a/2-dx;
Dk_x = 2*pi*N/a;
dk_x=2*pi/a;
k_x=-Dk_x/2:dk_x:Dk_x/2-dk_x;
N = (k_x.^2)/(2*k0);
z = 0:(5*10^-3)/length(N):5*10^-3;
z(end) = [];
% A0 = A(x,z=0)
A0 = exp(-x.^2/w^2);
I_0 = A0.*conj(A0);
% F_A0 is the fourier of A0
F_A0 = fft(A0);
% A3 = A(x,z=3)
A3 = ifft(exp(1i*N*3).*F_A0);
I_3 = A3.*conj(A3);
figure
plot(x,I_3,x,I_0)
However, I_3 is not what I expected to receive which is another Gaussian of smaller intensity.
Also, I'm unsure how I'd plot the intensity distribution in the x-z plane. They suggest using the imagesc function which I suppose I'd use it like:
imagesc(x,z, abs(ifft(exp(1i*N.*z).*F_A0).^2)
but the third argument, which is supposed to be a matrix, is a vector in what I've written..
Can anyone please help me with this?
Thank you in advance.