Commit cd4877b4 authored by Laurent Belcour's avatar Laurent Belcour

Adding an example of a ABC function.

parent 1963695d
function rho = ABS(theta_in, phi_in, theta_out, phi_out, a, b, c)
fx = sin(theta_out)*cos(phi_out) - sin(theta_in);
fy = sin(theta_out)*sin(phi_out);
f = sqrt(fx*fx + fy*fy);
psd = a / (1+b*b * f*f)^(c);
rho = 4*pi*pi * (cos(theta_in)+cos(theta_out))^2 * psd;
endfunction
theta = -0.5*pi:0.01:0.5*pi;
a = 1; b =10; c=1.5;
cost = cos(theta);
sint = sin(theta);
f = sint;
psd = a ./ (1 + b*b * f.*f).^(0.5*(c+1)) ;
rho = cost.^2 .* psd ;
Frho = fftshift(fft(rho)) / max(size(rho));
Prho = sqrt(Frho .* conj(Frho));
figure(1); plot(rho);
figure(2); plot(Prho);
figure(3); plot(imag(Frho) ./ real(Frho));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment