function y = ddif(spectra) % this file takes repetitive scans of a sample in columns as the % input and returns a single vector after the following treatments. % The expected input is ABSORBANCE data. % % 1) 21-point smoothing of the original spectra % 2) truncation of the spectra (must be changed in the m-file) % 3) all the column spectra are averaged together % 4) this spectrum is differentiated % 5) the result is 21-point smoothed % 6) this smmothed derivative is differentiated again % 7) this new f" is 41-point smoothed % 8) the resulting spectrum is mean centered % % Questions? Call Roger @ 1-900-IMTIRED % ys=smooth(spectra,21); yst=ys(200:550,:); yst_=mean(yst')'; d1=diff(yst_); d1s=smooth(d1,21); d2=diff(d1s); d2s=smooth(d2,41); y=d2s; end