A Taylors-series procedure for measuring the wavelength miscalibration of digital spectrophotometers based on spectra of a certified standard.sample.

A method is presented to determine the wavelength offset between two sdigital spectra of the same sample to a precision significantrly greater than the sampling interval of the spectra. Using this procedure to compare the spectrum obtained on a working spectrophotometer with that obtained with the same sample by the certifying autority, or that obtained for a similarly prepared sample, allows an accurate measure of the difference in the wavelength scalesw of the two spectrophotometers, and hence the amount by which the working spectrophotometer should be recalibrated to make its results identical to the certification spectrophotometr. A rational way to deal with the effect of finite scan speed and response time on the apparent peak positions is also presented.

Maintaining precise calibrationof the wavelength scale of spectrophotometers is an important part of quality control in an analytical laboratory. This is often achieved by scanning a certified standard sample on the working spectrophotometer and comparing the peak positions with those obtained by the certifying authority. The precision of this exercise is limited by the accuracy with whichpeak positions of a spectrum can be determined. By definition the peak is the position where absorbance is least sensitive to wavelenght miscallibration, and peaks of UV-Visible spectra tend not  to be very sharp. An alternate procedure based on extrapolation from the endpoints has been used , but with results that were inferior to those based on peak position.
Since the end result desired is not to accrately determine the peak positions but to measure the shift of the whole spectrum etween two instruments, it might be better to forget pekposition and find an accurate way to estimate how much a spectrum has shifted. 
We have been developing methods for analyzing spectra of mixtures of components to determine the concentration, or changes in concentration of each component by fitting the experimental spectrum to a linear combination of the spectra of the pure components. This procedure is highly sensitve to wavelength error between the standards and the experimental spectra. In order to minimize the effect of wavelength miscalibration, we have developed a method inspired by the Taylor's series expression for variation in a function around a point, which allows addition of one or two spectra to the basis set to compenstate for wavelength offset ad give meaningfulo estimates of the concentrations of the components.. this procedure gives as an additional result an accurate measure of the wavelength error in the sample spectrum relative to the standard spectra. It occurred to us that aapplication to a single, well-defined sample would provide a more accurate method for comparing calibration of spectrophotometers than the peak position mentioned above..

taylor's theorem applied at a single point.  Taylors theorem  holds that for any (sufficiently nice) function, the value of the fuction in a small range around a given point  x (Figure 1) is given by the value at that point plus a polynomial in dx=(x-xo): Y(xo+dx)= y(xo) +Y'(xo)dx +y"(xo)dx2/2 + y'"(xo)dx3/6 . . . Because vis-UV spectra are relatiovely smooth over the range of a few nm, higher order derivatives are small and the series can be truncated to two or three terms with good results. Local fitting with a sliding polynomial provides a convenient way of interpolating between the sampling points or filtering to remove high-frequency noise. In a reversal of Taylors theorem, we also use this method for calculating derivatives of spectra: Taylors theorem says that the curve can be approximated by this polynomial in  dx, we find the least-squares best-fitting polynomial in a small linear region about x and take it's derivatives at 0, which are exactly the coefficients of the polynomial (factorial). Using this as the definition of the derivatives of a digital spectrum, the taylors-series polynomial about a point is just the best-fitting polynomial. The goodness of fit of the polynomial can then indicates the width of the range over which taylors' series expansion of the given order is valid. Figure 1 illustrates taylors-series polynomials of order 1, 2, and 3 at several points on the spectrum of a holmium oxide glass filter.

. Fitting a symmetrical range around the central point with a polynomial gives a good estimate of the number of terms required (or the wavelength range over which the series will be valid).   Thus if a range of say 2 nm can be fit to within the noise level with a cubic polynomial, then the central point could be taken as the point for Taylors expansion, and  3 derivative terms would suffice over this range (because the coefficients of the polynomial are the derivatives(?), and a cubic polynomial has all derivatives of order > 3 zero. (in fact the way we calculate derivatives 1-3 is by fitting such a short range about the point, and taking the derivatives of the fitting polynomial at the central point as the derivatives of the spectrum at that point). However the range we expect to use the taylors series expansion over is much smaller, specifically the actuall miscalibration of the spectrophotometer,, probably a few tenths of a nm.  Over these ranges two or even 1 derivative terms would fit the spectrum satisfactorily.

Taylor series expansion applied to every point in a spectrum:

digital spectra are composed of absorbtion measurements taken at discrete values of wavelenght l, often but not necessarily at even interval of wavelength or energy. If we apply taylors-series expansion to each of the n points, we get n equations for the vales at each wavelength shifted by dl. 

A(l+dl) = A(l) + A'(l)dl + A"(l)dl2 + . . . 
A(l+dl) = A(l) + A'(l)dl + A"(l)dl2 + . . . 
A(l+dl) = A(l) + A'(l)dl + A"(l)dl2 + . . . 
	.	.
	.	.
	.	.
A(l+dl) = A(l) + A'(l)dl + A"(l)dl2 + . . . 

These can be seen one vector equation in n-dimensional vector space:

Ashifted = Acorrect  + dlA'correct + dl2A"correct  . . .

This suggests, as we have verified (Figure 2) that a  wavelength-shifted spectrum can be fit accurately as a linear combination of the unshifted spectrum and its first several derivatives. Furthermore as we show in Figure 3, the amount of the first derivative required to fit is proportional to the magnitude of the shift, and quantitatively equal to the shift in nm (or whatever unitws were assumed when taking the drivatives). This is a special case where the amplitude/magnitude of the spectrum being fit is exactly the same as the fitting spectrum. If it were scaled up or down, then proportionately larger or wsmaller amounts of each term would be required. Thus dividing the first derivative required by the amount of unshifted spectrum required gives the magnitude of the shift in nm in the general case.  Likewise the shift could be calculated as the square root of the amount of the second deriative term divided by the coefficient for the unshifted spectrum. However for small shifts the first derivative value is likely to be more accurate for several reasons- visible spectra tend to be rather smooth on the wavelength scale of reasonable errors (at least the reproducible part; noise may result in a larger 2nd derivative but that is not useful), so the second derivative term will be small. Second, differences in bandwidth between instruments is likely to affect the second derivative(?), interfering with its use to measure the shift. Omitting the second and higher derivative terms has little effect onthe value obtained for the first derivative, as derivatives tend to be more or less orthogonal. 

Figure 4 compares the use of the first derivative when the second derivative is included(A) in the fitting or omitted(B).  The rms residuals from the fit are also included, demonstrating together with the accuracy of the amount of original spectrum the usefulnes of the second derivative in fitting the spectrum. However the value of the first derivative is scarcely affected except at very large shifts by the inclusion of the second derivative term.
Figure 4C illustrates a cruder way to estimate the shifts between two spectra: the test spectrum is shifted by different multiplesof the sampling interval and fit with the standard spectrum. and the valuse The goodness of fit as measured by the RMS residual deteriorates rapidly on eaither side of the correct shift value, and when plotted against wavelength the minimum can be estimated to a fraction of the sampling interval. A similar approach applied to the first derivative instead of the residual leads to a straight line which crosses zero at the correct shift value, making estimation of the shift value much easier. However as the value of the shift can be read directly by dividing the first derivative coefficient by the initial spectrum coefficient, this is hardly necessary. Averaging the two values on either side of the crosspoint should give the same result.

The experiment of Fig 4 involved two separate spectra of the standard, one as the standard fitting spectrum, and the other being shifted to similate spectra with wavelength miscalibration. Thus even whenthe shift is zero, the residual does not go to zero, resulting in a rounded bottom for the plot of residuals vs shift.

The effect of scanning speed and instrumental response time.  The apparent position of peaks, as well as the shape of the spectra, can be affected by scanning the spectrum at a rate which is not very slow compared to the response time of the instrument. Many qualitative assys are carried out using absorbance at a constant wavelength. For these experiments the relevant calibration is that obtined at infinitely slow scan rates and/or infinitely fast response time. However it can be shown, and we verify in Figure 5, that for scan rates not greatly slower thanthe response time, the effect of convolution with response time can be well approximated by a simple shift in wavelength, and measured by the same fitting procedure described above for a real wavelength shift. If the calibration procedure above is carried out at several scan speeds with the same response time, then the miscalibration value obtained cn be plotted against scan rate to give a linear plot, and extrapolated to zero scan rate for the true static miscalibration. This is really a significant correction that cannot be ignored if one is to claim wavelength accuracy of 0.1 nm or less. The slope of the plot gives a functional measure of the response time, and users can be warned that they will have a wavelength mscalibration of what value if they scan at what speed (assuming the spectrophotometer is calibrated for static measurements).

The effect of variable bandpass

Figure 1. Illustration of the Taylors expansion of a function in the vicinity of a point.
( make this by taking an actual spectrum, calculating 1,2,3-order polynomials based on derivatives at a point. extend far enough that they diverge from true spectrum.)
1b. (or text only) applying this at every point in a digital spectrum gives a vector-valued function of the oricginal spectrum and the offset which provides the offset spectrum that would be obtained at the SAME wl points with a spectrum shifted by an arbitrary amount (not necessarily even multiple of sampling interval).)

Figure 2. Demonstrating that a wavelength-shifted spectrum can be fit by a linear combination of the original spectrum and its first and second derivatives.
a spectrum of a standard Holmium oxide filter was taken from 350 to 450 nm. This spectrum and its first and second derivatives wrt wavelength, (together with baseline offset?)were used to fit that same spectrum after shifting by different amount from -1 to 1 nm by 0.1 nm  intervals. The fitting coefficients for each, and the rms residuals for each fit, are plotted against the wavelength offset. The amount of first derivative used in the fit is proportional to the wavelength offset, while the amount of second derivative is proportional to the square of the offset. The rms residual goes precisely to zero for zero shift because even the noise is the same in the experimental and standard spectra, they being the same.

Figure 3.

Figure 4. a spectrum of the same HO filter was scanned on spectrophotometer 2 and fit useing the same basis set described in Figure 1. to simulate further miscalibration, the spectrum from spectrophotometer 2 was shifted by various amounts as in figure 1. In panel AThe resulting spectra were fit with the same basis set described in Figure 1, derived from the spectrum taken on spectrophotometer 1. In panel B the second derivative term was omitted from the fitting set. In panel C both first and second derivative were omitted, i.e the shifted spectra  from spec 2 were fit with the original unshifted spectrum from spec 1, plus the cnstant baseline offset.  In this case the rms magnitude of the residuals is very sensitive to wavelength offset, and extrapolation of the two arms to an intersection gives an estimate of the point where the offset is zero, i.e. the shift that shouls be applied to get the correct calibration. However this is less accurate than using the derivative coefficient.

Figure  5,  Spectra of the HO filter were recorded at different scan rates using two different response times ()fast, () medium. each spectrum was fit using the set of fitting spectra from Fig 1, recorded at ()). There is a wavelength shift that is proportional to scanning speed, the proportionality constant depends on the response time (=RC according to the analysis in the text), and extrapolation to zero scan speed gives the same valu, which can be considered the static calibration of the instrument.

Materials and methods
The HO filter used was -
Spec 1 is a shimadzu ???. operated through the uvspec program provided by the manufacturer running on a Dell laptop connected via the serial port. Spec 2 was an Aminco DW2 dual waelength spectrophotometer operating in dual beam mode,
 controlled by a PC using a homemade interface. wavelenth points were taken at 0.1 nm intervalsbased on an optical interupter disk attached . Spec 3 was a second aminco DW2 retrofit for digital operation by OLIS online instrument systems, inc.