SMF Spectral Matching Factor Demo

by Chuck DiMarzio
   Northeastern University
   December 2008

uses af488.m (Fluorescein spectra)

!! This file may be copied, used, or modified for educational and
!! research purposes provided that this header information is not
!! removed or altered, and provided that the book is cited in
!! publications, as DiMarzio, Charles A., Optics for Engineers,
!! CRC Press, Boca Raton, FL, 2011.
!! http://www.crcpress.com
!! Other distribution is prohibited without permission.
set(0,'DefaultAxesColorOrder',[0 0 0]);
af488;
wavelabs=data(:,1);
absorption=data(:,2);
wavelem=data(find(data(:,3)>0),3);
emission=data(find(data(:,3)>0),4);  % Arbitrary units emission spectrum
dlambda=wavelem(2)-wavelem(1);
intem=sum(emission)*dlambda;  % Integrated emission spectrum
fig1=figure;plot(wavelabs,absorption,'--');
hold on;
fem=emission/intem;  % Fractional emission spectrum
[ax,h1,h2]=plotyy(wavelem,emission,wavelem,fem);
a1=axis(ax(1));a2=axis(ax(2)); % Scale factor for plotting
set(h2,'LineStyle','-.')
moose=find(emission==max(emission)); % Find Peak
yscale=(a2(4)-a2(3))/(a1(4)-a1(3)); % After plotyy, we can only plot based
                                    % on the left axis, so we need to find
                                    % the scale factor between axes for the
                                    % plot command on the next line.
% Plot pointer to axis for each curve:  First the emission and fem
plot(wavelem(moose)+[0,-70],emission(moose)*[1,1],'-',...
     wavelem(moose)-70,emission(moose),'<',...
     wavelem(moose)+[0, 70],fem(moose)*[1,1]/yscale+a1(3),'-',...
     wavelem(moose)+70,fem(moose)/yscale+a1(3),'>');
% Now the absorption
moose=find(absorption==max(absorption));
plot(wavelabs(moose)+[0,-70],absorption(moose)*[1,1],'-',...
     wavelabs(moose)-70,absorption(moose),'<');
xlabel('\lambda, Wavelength, nm');
ylabel(ax(1),'Absorption, Emission, \%');
ylabel(ax(2),'f_\lambda, Spectral Emission Fraction nm^{-1}');
grid on;
%
%
%  Filter modified from m10353i.m
% by Chuck DiMarzio, Northeastern University
%  August 2003
% November 2001 in m10017_3.m
%
designwavelength=550e-9;  % Variables in meters from here
orders=[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3];  %  Order for each layer
rho=zeros(1,length(wavelem));
for count=1:length(wavelem);
   lambdaf=wavelem(count)*1e-9;
n0=1;nt=1.5;
n1=1.35;n2=2.3;
m=[1,0;0,1];  % Start with an identity matrix
for norder=1:floor(length(orders)/2);
s1=designwavelength/4/n1*orders(norder*2-1);
s2=designwavelength/4/n2*orders(norder*2);
term1=2*pi*n1*s1/lambdaf;
term2=2*pi*n2*s2/lambdaf;
m1=[cos(term1),-1i/n1*sin(term1);-1i*n1*sin(term1),cos(term1)];
m2=[cos(term2),-1i/n2*sin(term2);-1i*n2*sin(term2),cos(term2)];
m=m*(m1*m2);
end;
rho(count)=(n0*m(1,1)+n0*nt*m(1,2)-m(2,1)-nt*m(2,2))/...
   (n0*m(1,1)+n0*nt*m(1,2)+m(2,1)+nt*m(2,2));
end;
R=(abs(rho).^2)';
fig2=figure;plot(wavelem,R);
grid on;xlabel('\lambda, Wavelength, nm');ylabel('R, Reflectivity')
title([num2str(length(orders)),' Layers']);

intem=sum(emission)*dlambda
intprod=sum(R.*emission)*dlambda
smfactor=intprod/intem/max(R)

fig3=figure;plot(wavelem,R.*emission,'-',wavelem,emission,'-.');
grid on;
xlabel('\lambda, Wavelength, nm');ylabel('Input and Output')
title(['SMF = ',num2str(smfactor)]);
Warning: Unable to interpret TeX string "Absorption, Emission, \%" 
intem =
   1.0290e+04
intprod =
   6.9121e+03
smfactor =
    0.6720