Development and preliminary evaluation of modified Savitzky-Golay

Development and preliminary evaluation of modified Savitzky-Golay smoothing ... Supervised semi-automated data analysis software for gas chromatograph...
0 downloads 0 Views 332KB Size
2249

Anal. Chem. 1984, 56, 2249-2251 (3) Peterson, J. I.; Vurek, G. G. Science (Washlngton, D . C . ) 1984, 224, 123-1 27. (4) Polanyi, M. L.; Hehir, R. M. Rev. Sci. Instrum. 1962, 33, 1050-1055. (5) Polanyl, M. L. "Dye Curves"; University Park Press: Baltimore, 1974; pp 267, 284. (6) Peterson, J. 1.; Goldstein, S. R.; Fltzgerald, R. V.; Buckhold, D. K. Anal. Chem. 1980, 52, 864-869. (7) Sepanlak, M. J.; Tromberg, B. J.; Eastham, J. F. Clin. Chern. (Winston-Salem, N.C.) 1983, 29. 1678-1682. (8) Beyers, M.; Dudas, S. "The Clinical Practice of Medical-Surgical Nursing"; Little, Brown, and Company: Boston, MA, 1977, pp 442, 913. 'Present address: E. I . du Pont de Nemours and Company, Atomic En-

ergy Division, Savannah River Plant, Alken, SC 29808.

J. Todd Coleman' Jerome F. Eastham Michael J. Sepaniak* Department of Chemistry University of Tennessee Knoxville, Tennessee 37996-1600

RECEIVED for review May 11, 1984. Accepted June 11, 1984.

Development and Preliminary Evaluation of Modified Savitzky-Golay Smoothing Functions Sir: The digital smoothing filters described by Savitzky and Golay (1)have been used extensively because they are versatile, they are easy to implement with digital computers, and they yield reasonably reliable results. These filters offer other more subtle advantages. Because they are nonrecursive filters, there are no feedback paths and the filters are selfdamping so there is not possibility of an oscillating response. Because they are linear-phase filters, they preserve linear relationships between data and time. However, this does not mean that these filters are without limitations in some situations. In some recent studies of the utility of imaging detectors for derivative spectroscopy, it was noted that second-derivative spectroscopic signals frequently exhibited partially resolved double peaks where single peaks were expected. The problem was eventually traced to the Savitzky-Golay (S-G) functions that were being used to compute the derivatives, and modified functions were developed to resolve the problem. The resulting functions are similar to those of Savitzky and Golay, differing only in the coefficients of selected terms. This paper describes the basis for those modified functions and some results obtained with them. GENERAL CONSIDERATIONS A problem associated with the S-G functi~nsis illustrated by the computed responses in Figure 1 for a quadratic function, where the frequency range is limited to 50% (0.5) of the sampling frequency in recognition of the Nyquist criterion. The observed oscillation about the zero point is known as Gibbs phenomenon (21,and results from truncation of terms in an infinite Fourier series to achieve a practical finite series. In practice, the coefficients in digital-filter functions are selected to reduce errors caused by the Gibbs phenomenon to acceptable levels (2). This provides the basis for the approach used to modify the S-G filter functions. Equation 1 is the S-G function over a five-point quadratic convolution. In words, the smoothed value, U(n),is the

U ( n )= (-3Un-2

+ 12Un-1 + 17Un + 12Un+, - 3Un+J/35

(1)

weighted average of the central datum and selected data on either side of the central point. To modify this equation to express response as a function of frequency, assume that the signal contains a single frequency and substitute Un = eCotwhere w = 2af and t is time. In this special case, data points are equally space in time, with 0003-2700/84/0356-2249$01.50/0

t = 0 for the central datum and t = +1,+2 ...,etc. for adjacent points. The resulting equation for a five-point smooth of equally spaced data points is

F ( w ) = (-3e-jo2

+ 12e-i" + 17 + 12eio- 3eiU2)/35

(2)

This function can be simplified with the Euler relations (erx + e-ix = 2 cos x ) , to obtain

F(w) = (17

+ 24 cos (w) - 6 cos (2w))/35

(3a)

This is the type function that is plotted in Figure 1for 5-, 7-, 9-, and ll-point filters. As noted earlier, a problem with this filter is the oscillatory response at higher frequencies. One feature of an ideal Iow-pass filter is that the response drops to zero and remains there for the highest frequency of interest. To impose this criterion on eq 3, we set F(w) = 0 for the maximum frequency equal to 50% of the sampling frequency (f = 0.5), and replace the third coefficient in the equation with a parameter 2B, to obtain

0 = (17 + 24

COS

(a)

+ B X 2 COS (2a))/35

(3b)

which is solved to give B = 3.5. Inserting this value of B and reversing the above process to obtain an equation of the same form as eq 1,we would have coefficients with values of -3.5, 12, 17, 12, and -3.5. Multiplying these new coefficients by 2 to obtain whole numbers, the new coefficients are -7, 24, 34,24, and -7, and the normalization constant is the sum of these coefficients, namely 96. The resulting smoothing function is

U(n) = (-7Un-,

+ 24Un-1 + 34Un + 24U,+1-

7Un+J/96 (4)

and the frequency-dependent transfer function is

Analogous equations can be developed for 7-, 9-, 11-,..., (2n + 1)-point smooths. Figure 2 shows plots of response functions computed with such equations. Comparing these data with those in Figure 1, it is noted that reduced oscillation is achieved at a cost of lower cutoff frequencies and more gradual roll-off with increasing frequency. Cutoff frequencies (3 db points) for the two sets of convolution functions are compared in Figure 3, 0 1984 American Chemical Society

2250

ANALYTICAL CHEMISTRY, VOL. 56,NO. 12, OCTOBER 1984

:::I

,

. 10

-9.00

,

,

.20

. 30

FREQUENCY RP

,

. 40 I IO

,

b

.50

Figure 1. Transfer functions vs. frequency ratio (ratio of frequency to sampling frequency) for unmodified functions for 5 (*), 7 (0),9 (+), and 11 (A) point smooth.

_.

LT

!L-

-'#. -. B 00

.20

.10

.30

FREQUENCY

.40

m 1 0

f-

.50

Figure 4. Comparison of responses of unmodified (A) and modified (B) functions to a step signal with unity amplitude.

N A

1

I

I

I

I

RATIO

Figure 2. Transfer functions vs. frequency ratio for modified functions

(as in Figure 1).

,4

I t

1

LL LL 0

0.01" 0

1

2

"

3

4

"

5

6

7

"

8

9

1

" " ' 101112131415

NLiMBER OF POINTS Figure 3. Comparison of cutoff frequencies (ratio of frequency to sampling frequency) for unmodified (*) and modified (0)functions.

showing that the differences are largest for the fewest number of points used and approach one another as the number of points increases. Reconsidering eq 3b, and noting that the cosine terms will all be +1 or -1, it can be shown that S-G function can be modified to satisy this criterion by replacing the first and last coefficients by the parameter +B, alternating signs on all other coefficients, and equating the sum to zero (3). For example, the modified five-point smooth can be obtained as R-12+17-12+B=O from which we obtain B = 3.5, which is the same value obtained with eq 3b.

LFNRrnIM'I Figure 5. First-derivative spectra for a mercury penlamp based on five-point smooth with unmodified (A) and modified ( 8 ) functions.

For derivative spectroscopy, as for many other applications, a critical feature of a smoothing function is its response to high-frequency noise components. Figure 4 compares the computed frequency response of the unmodified and modified S-G functions for a five-point convolution of a step impulse

2251

Anal. Chem. 1984, 56,2251-2253

Table I. Least-Squares Statistics for Fits of First-Derivative Signal vs. Concentration" of Nd(II1) smoothing function

slope i std

intercept

devb

h std devb

std err est

corr coeff

0.81 i 2.5 13.6 f 14 -2.2 h 2.1

3.3 18.6 2.8

0.9998 0.992 0.9999

6.04 h 0.07 none unmodified S-Gc 4.75 f 0.42

modified S-Gc

6.15 i 0.06

OFour samples: 0.6, 1.2, 2.4, and 6.3 mg mL-'. bRelativeunits. Five-point smooth.

with amplitude of 1.0. Whereas the modified function gives a smooth decrease on either side of the attenuated peak value, the unmodified function generates a response with significant character associated with it. It is this feature which caused problems with our attempts to use the smoothing functions for derivative spectroscopy because derivatives of the oscillatory response from "smoothed" noise pulses imposed significant amounts of distortion on derivative spectra. Figure 5 shows first-derivative spectra obtained for a mercury penlamp with the unmodified and modified smoothing functions. Differences are quite apparent, with data smoothed with the unmodified function showing overlapping peaks where single peaks are expected and observed with the modified function. The smoothing functions were evaluated with intensity (0 data obtained for Nd(II1) solutions monitored with an image-dissector based instrument constructed in this laboratory.

Table I presents least-squares statistics for first-derivative signals vs. concentration for solutions of Nd(II1) without any smoothing and with smoothing by each of the functions discussed above. All statistical parameters are degraded for the data smoothed by the unmodified function relative to data without smoothing or smoothed by the modified method. Whereas the unmodified S-G functions degrade the signal, the modified function introduces little or no distortion relative to the data without any smoothing. More complete studies are needed to fully understand the advantages and limitations of these modified Savitsky-Golay functions. However, preliminary results presented here suggest that these modified functions may offer real advantages in some situations. LITERATURE CITED (1) Savitzky, A,; Golay, M. J. E. Anal. Chern. 1964, 36, 1627. (2) Kuo, F. F.; Kaiser, J. F. "System Analysis by Digltal Computer"; Wiiey: 1966; pp 218-285. (3) Hamming, R. W. "Dlgltal Filters": Prentice-Hall: Englewood Cliffs, NJ, 1983; pp 34-45.

Timothy A. Nevius Harry L. Pardue* Department of Chemistry Purdue University West Lafayette, Indiana 47907 RECEIVED for review February 27, 1984. Accepted May 29, 1984. This work was supported by Contract DE-ACOZ79EV10240 from the Department of Energy.

Secondary Ion Mass Spectrometry of Pyrene: Enhancement of Molecular Ion Emission by Antimony Trichloride Sir: Mass spectra of positive ions produced by sputtering (i.e., FABMS, SIMS) from condensed phase organic analytes are generally characterized by abundant even electron ions ( I ) . Secondary positive ion emission is enhanced if the analyte is basic, or contains a basic moiety such as -NH2, or exists as an organic salt. Secondary ion emission is particularly enhanced when the analyte has first been dissolved in a polar, protic matrix, such as glycerol. In this case, pseudomolecular ions such as [M H+], [M + Na+], [M + K+], etc., or intact cations from organic salts are apparent in the SIMS spectrum. Relative intensity of these species in the SIMS spectrum has been related to their concentration in the condensed phase solution (2). Radical cations (i.e., molecular ions) would not be expected to exist in significant concentrations in a glycerol matrix; in fact, no enhancement of secondary emission of positive, molecular ions is observed from such a matrix. If secondary emission of molecular ions can be enhanced by a mechanism similar to that effected on organic bases by glycerol, it is reasonable to study matrices which enhance the concentration of the radical ions in solution. Molecular ions have been sputtered from polynuclear aromatic hydrocarbons (PAH) deposited on solid, metal supports ( 3 , 4 ) . Enhancement of secondary molecular ion emission has been observed when PAH's were deposited on carbon (5) or liquid metal substrates (6). In none of these experiments has the molecular species been dissolved into the support. More recently, however, secondary molecular ion emission has been reported for N,N-tetramethylbenzenediamine (TMPD) in glycerol and MezSO solutions (7). In these solutions, the TMPD exists in significant concentrations as part of a

+

0003-2700/84/0356-225 1$01.50/0

charge-transfer complex with quinone. Consistent with these results, we report enhanced secondary ion emission of pyrene molecular ions when pyrene is dissolved in a matrix of SbC13. Molten SbC13solutions are known to ionize many PAHs via a reversible, one-electron oxidation (eq 11,the resultant PAH+ being stable and dissolved in the melt (8). The system is an aprotic analogue to organic base/glycerol solutions in which the basic analyte can exist as a solvated, protonated ion prior to bombardment. 1/3SbC1, .t PAH

* 1/3Sb0+ C1- + PAH+

(1)

SbC13posesses properties which are desirable for an organic SIMS matrix. These include an acceptably low pressure in the mass spectrometer (vide infra), a low melting point, and the ability to conduct charge away from the bombarded surface (9). Significantly, PAHs are soluble in SbC13 (8,lO). Performance of SbC13 as a SIMS matrix was evaluated by comparison of the intensity of secondary emission of pyrene molecular ions from pyrene/SbCl, and pyrene/glycerol mixtures as well as the secondary emission of the same ions from a neat pyrene sample dispersed on a solid metal probe tip. Because the concentration of dissolved pyrene molecular ions in SbC1, is known to increase when the mixture is melted (8), secondary emission of pyrene molecular ions was measured as a function of temperature. EXPERIMENTAL SECTION The secondary ion mass spectrometer used in this study has been described previously (11) and has been modified by the addition of a source heater and a thermocouple. The 5-keV Ar+ 0 1984 Arnerlcan Chemical Society