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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MATLAB codes<br />

% reference files<br />

index = regexp (name_ref, ’_’, ’start’) ;<br />

index = index (length(index) - 1) ;<br />

namebase = name_ref (1 : index) ;<br />

list = dir ([path_ref,namebase,’*.dat’]) ;<br />

data_ref = zeros (size(list,1),256,2) ;<br />

P_ref = zeros (size(list,1),1) ;<br />

for N = 1 : size(list,1)<br />

filename = [path,list(N).name] ;<br />

data_ref(N,:,:) = load (filename,’-ascii’) ;<br />

parts = regexp (list(N).name, ’_|+-|.dat’, ’split’) ;<br />

p_ref = parts ( size(parts,2) - 2 ) ;<br />

P_ref(N) = str2double (p_ref:,1) ;<br />

end<br />

% other data<br />

k = 2 * pi / wavelength ;<br />

c = 3e8 ; % speed of light<br />

l_approx = D * n_eff / c ;<br />

n_surr = 1 ; % refractive index of surrounding medium = air<br />

R = reflectivity (n_eff,n_surr) ;<br />

%% Calibrate data<br />

cone = zeros(256,1) ;<br />

cone_delta = zeros(256,1) ;<br />

for n = 1 : 256<br />

x = data_ref(:,n) ;<br />

y = P_ref * diffuson(theta(n),l_approx,R) ;<br />

temp1 = sortrows ([x,y],1) ; % sort by x<br />

x = temp1(:,1) ;<br />

y = temp1(:,2) ;<br />

warning off % many warnings because of defect photodiodes (causing NANs)!<br />

[p,s,mu] = polyfit (x,y,3) ;<br />

[cone(n),cone_delta(n)] = polyval (p,data_samp(n),s,mu) ;<br />

warning on<br />

end<br />

%% Fold data<br />

dummy = sortrows ([abs(theta), cone, cone_delta]) ;<br />

theta = dummy (:,1) ;<br />

cone = dummy (:,2) ;<br />

cone_delta = dummy (:,3) ;<br />

82

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

Saved successfully!

Ooh no, something went wrong!