26.12.2013 Views

Coherent Backscattering from Multiple Scattering Systems - KOPS ...

Coherent Backscattering from Multiple Scattering Systems - KOPS ...

Coherent Backscattering from Multiple Scattering Systems - KOPS ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Evaluation of the small angle data<br />

% reshape matrices into vectors<br />

matrix = reshape (matrix,[],1) ;<br />

errormatrix = reshape (errormatrix,[],1) ;<br />

rho = reshape (rho,[],1) ;<br />

% sort vectors for rho<br />

sorted = sortrows ([rho,matrix,errormatrix], 1) ;<br />

rho = sorted(:,1) ;<br />

matrix = sorted(:,2) ;<br />

errormatrix = sorted(:,3) ;<br />

% define ranges for the radial average<br />

rho = rho / range ;<br />

rho = round (rho) ;<br />

% radial = values of rho without repetitions, sorted in ascending order<br />

[radial,first] = unique (rho, ’first’) ; % first = first occurrence of each<br />

% unique value in rho<br />

[radial,last] = unique (rho, ’last’) ; % last = last occurrence of each<br />

% unique value in rho<br />

% average of the values of matrix and errormatrix<br />

weight = 1 ./ errormatrix.^2 ;<br />

weighted_matrix = matrix .* weight ;<br />

intensity = zeros (size(radial,1), 1) ;<br />

error = zeros (size(radial,1), 1) ;<br />

for k = 1 : size(radial,1)<br />

intensity(k) = sum ( weighted_matrix(first(k):last(k)) ) ...<br />

/ sum ( weight(first(k):last(k)) ) ;<br />

error(k) = 1 / sqrt ( sum ( weight(first(k):last(k)) ) ) ...<br />

* 1 / sqrt ( last(k)-first(k)+1 ) ;<br />

end<br />

% define scale<br />

pixels = radial * range ;<br />

end<br />

function [intensity,error,pixels] = ...<br />

calculate_profile (matrix,errormatrix,position,direction,range)<br />

% calculate direction angle<br />

angle = direction / 180 * pi ;<br />

if angle < 0<br />

angle = angle + 2 * pi ; % angles between 0 and 2*pi<br />

89

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!