Coherent Backscattering from Multiple Scattering Systems - KOPS ...
Coherent Backscattering from Multiple Scattering Systems - KOPS ...
Coherent Backscattering from Multiple Scattering Systems - KOPS ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
MATLAB codes<br />
position = regions(index).Centroid ;<br />
position = round (position) ;<br />
% position = center of mass of blob area;<br />
% position(1) = x, position(2) = y !!!<br />
%% Calculate profile or average<br />
mode_selector = ’average’ ;<br />
% alternative: ’profile’<br />
if strcmp(mode_selector, ’average’)<br />
range = 1 ; % change value to average over a larger radial range<br />
[intensity,error,pixels] = ...<br />
calculate_average (matrix, errormatrix, position, range) ;<br />
else<br />
direction = 0 ; % change value to select other direction<br />
range = 1 ; % change value to average over a larger radial range<br />
[intensity,error,pixels] = ...<br />
calculate_profile (matrix, errormatrix, position, direction, range) ;<br />
end<br />
%% Display result<br />
plot ( pixels, intensity )<br />
hold on<br />
plot ( pixels, intensity-error, ’:’ )<br />
plot ( pixels, intensity+error, ’:’ )<br />
hold off<br />
xlabel (’scattering angle [pixels]’)<br />
ylabel (’intensity [a.u.]’)<br />
end<br />
function [intensity,error,pixels] = ...<br />
calculate_average (matrix, errormatrix, position, range)<br />
% create carthesian coordinate system<br />
X = repmat(1:2048,2048,1) ;<br />
Y = X’ ;<br />
% shift origin of the coordinate system to ’position’<br />
X = X - position(1) ;<br />
Y = Y - position(2) ;<br />
% turn carthesian coordinate system into polar coordinates<br />
[theta,rho] = cart2pol (X,Y) ; % range of theta: [-pi,pi]<br />
88