I'm facing a problem for the conversion of x axis from DFT. As my sample model of my x axis is in meters (m) and y axis represents the rho (scattering length density). After taking the fft(rho)
in matlab I will get the intensity but I cannot figure out how I should get the x axis. I want to know if there is a specific formula or limits to calculate the x axis after DFT.
Here is my source code, I just want the values for my x axis:
al=100;
nipam=20;
water=300;
j=1;
for i=1:15
rho(j:j+al)=2.07;
k=j+al;
rho(k:k+nipam)=0.81;
l=k+nipam;
rho(l:l+water)=-0.56;
m=l+water;
rho(m:m+nipam)=0.81;
j=m+nipam;
end
del_x=1;
xmax=6600;
x=(0:del_x:xmax);
% plot(x,rho)
A=abs(fft(rho));
I=A.^2;
% del_q=2*pi./xmax; I want to how should I get the x axis???after doing FFT
% qmax=2*pi./del_x;
% q=(0:del_q:qmax);
plot(q,I)