% Matt Fetterman 2005 % see M.R. Fetterman, Optics Letters 2005, improvement in derivative % spectroscopy. % this is the MAIN program NumPoints=1025;displayX=1; derivNum=1; % time_0 is all times even...time_1 is for 1st deriv...time_2 for 2nd deriv time_0=ones(1,NumPoints);time_0=time_0/sum(time_0); % the FTIR_sim program returns the SNR values for the modified time, and % the time intervals. first we try it for first deriv [SNR_mod_1,SNR_unmod_1,time_1]=FTIR_sim(NumPoints,derivNum,displayX); % now we try it for second deriv. derivNum=2; [SNR_mod_2,SNR_unmod_2,time_2]=FTIR_sim(NumPoints,derivNum,displayX); aEnd=(NumPoints-1)/2;aStart=-aEnd; indexer=[aStart:aEnd]; % now plot the results. large fontsizes good for display. FontSize=16;StringFont='FontSize'; r1=plot(indexer,time_0,':',indexer,time_1,'b',indexer,time_2,'b--'); set(r1,'LineWidth',2); ax=legend('0th derivative','1st derivative','2nd derivative'); leg=findobj(ax,'type','text'); set(leg,'FontSize',.3); pos1=get(ax,'position'); pos2=pos1; pos2(1)=pos2(1)-0.2; pos2(3)=pos2(3)+0.15; set(ax,'position',pos2); AxisHandle=get(gcf,'CurrentAxes'); set(AxisHandle,StringFont,FontSize); h=gcf; xlabel('index q',StringFont,FontSize); ylabel('time interval t(q) (seconds)',StringFont,FontSize); % report the improvement with the technique Noise_equal=Noise_Out(indexer,time_0,derivNum,NumPoints); Noise_vary=Noise_Out(indexer,time_2,derivNum,NumPoints);