Smoothing and Differentiation of Data by Simplified Least Squares ...

4 downloads 0 Views 1MB Size Report
Accepted March 13, 1964. Smoothing and Differentiation ... mostly in the mathematical literature. (4, 6, 8, 9). The objective ... VOL. 36, NO. 8, JULY 1964. ·. 1627 ...
Interferences. Methylene chloride or chloroform-soluble carboxylic acids (acetylsalicylic acid, salicylic acid, etc.) which inhibited 4 - , U P response were readily extracted from these phases using 0.ln’ sodium hydroxide. Span-type excipients, which gave a slight response to the 4-AAP reagent, were eliminated by virtue of their insolubility in 10% aqueous sodium chloride; while interfering Tween-type excipients were precipitated (3) using the Tween reagent. Propylene glycol, when formulated a t a level of 5.25%, contributed ca. 2 to 370 to the observed absorbance. This was minimized by a more favorable distribution of the interference within the aqueous phases used in the procedure. Placebo analyses indicated that no

interference was obtained with such common excipients as stearic acid, stearyl alcohol, cetyl alcohol, petrolatum, methyl or propyl-p-hydroxybenzoates, sesame oil, or thimerosal. Lipotropic agents (betaine or choline), all the common vitamins, and neomycin sulfate failed to interfere. Scope of Reaction. I n addition t o the other types of steroids reported to react with the 4-AAP reagent, t h e following steroids reacted a t elevated temperature (boiling point of methanol) and a t increased concentration (2.0 mg. per 10.0 ml. of reagent): 2a-hydroxymethyl - 17p - hydroxy - 17a - methyl5a-androst-%one (306 mp) ; and 2ahydroxymethyl - 17p - hydroxy - 501androst-3-one (306 mp). Steroids without a keto group failed to give any

response. The quantitative aspects of the above responses to the 4-AAP reagent were not investigated. Correlations of Chromophore Wavelength with Structure. The additive

effect of various ring A and B substituents on the chromophore of the parent saturated-3-keto steroid is presented in Table 11. LITERATURE CITED

(1) Cohen, H., Bates, R. W., J . Am.

Pharm. Assoc., Sci. E d . 40, 35 (1951). (2) Hiittenrauch, R., Z. Physiol. Chem. 326,166 (1961). (3) Pitter, P., Chem. & Ind. 42, 1832 (1962).

RECEIVED for review September 4, 1963.’ Accepted March 13, 1964.

Smoothing and Differentiation of Data by Simplified Least Squares Pro,cedures ABRAHAM SAVITZKY and MARCEL J. E. GOLAY The Perkin-Elmer Corp., Norwalk, Conn.

b In attempting to analyze, on digita I computers, data f rom basica IIy continuous physical experiments, numerical methods of performing familiar operations must be developed. The operations of differentiation and filtering are especially important both as an end in themselves, and as a prelude to further treatment of the data. Numerical counterparts of analog devices that perform these operations, such as RC filters, are often considered. However, the method of least squares may b e used without additional computational complexity and with considerable improvement in the informotion obtained. The least squares calculations may b e carried out in the computer by convolution of the data points with properly chosen sets of integers. These sets of integers and their normalizing factors are described and their use is illustrated in spectroscopic applications. The computer programs required are relatively simple. Two examples are presented as subroutines in the FORTRAN language. H E PRIMARY OUTPUT of any experiTment in which quantitative information is to be extracted is information which measures the phenomenon under observation. Superimposed upon and indistinguishable from this information are random errors which, regardless of their source, are characteristically described as noise. Of fundamental importance to the esperimenter is the

removal of as much of this noise as possible without, at the same time, unduly degrading the underlying information. I n much experimental work, the information may be obtained in the form of a two-column table of numbers, A us. B. Such a table is typically the result of digitizing a spectrum or digitizing other kinds of results obtained during the course of an experiment. If plotted, this table of numbers would give the familiar graphs of TOTus. wavelength, pH us. volume of titrant, polarographic current us. applied voltage, S M R or ESR spectrum, or chromatographic elution curve, etc. This paper is concerned with computational methods for the removal of the random noise from such information, and with the simple evaluation of the first few derivatives of the information with respect to the graph abscissa. The bases for the methods to be discussed have been reported previously, mostly in the mathematical literature (4, 6, 8 , 9). The objective here is to present specific methods for handling current problems in the processing of such tables of analytical data. The methods apply as well to the desk calculator, or to simple paper and pencil operations for small amounts of data, as they do to the digital computer for large amounts of data, since their major utility is to simplify and speed up the processing of data. There are two important restrictions on the way in which the points in the

table may be obtained. First, the points must be a t a fixed, uniform interval in the chosen abscissa. If the independent variable is time, as in chromatography or NMR spectra with linear time sweep, each data point must be obtained a t the same time interval from each preceding point. If it is a spectrum, the intervals may be every drum division or every 0.1 wavenumber, etc. Second, the curves formed by graphing the points must be continuous and more or less smooth-as in the various examples listed above. ALTERNATIVE METHODS

One of the simplest ways to smooth fluctuating data is by a moving average. I n this procedure one takes a fised number of points, adds their ordinates together, and divides by the number of points to obtain the average ordinate a t the center abscissa of the group. S e s t , the point a t one end of the group is dropped, the next point a t the other end added, and the process is repeated. Figure 1 illustrates how the moving average might be obtained. While there is a much simpler way to compute the moving average than the particular one described, the following description is correct and can be extended to more sophisticated methods as will be seen shortly. This description is based on the concept of a convolute and of a convolution function. The set of numbers a t the right are the data or ordinate values, those a t the left, the abscissa information. The outlined VOL. 36, NO. 8, JULY 1964

1627

For the moving average, each C, is equal to one and N is the number of convoluting integers. However, for 1799.6 717 many types of data the set of all l’s, which yields the average, is not 1799.4 718 particularly useful. For example, on 1799.2 721 going through a sharp peak, the average 1799.0 ----be a minimum oT-er the interval being considered.

Minimizing with respect to brio, we have

+ ( b d - y.1'1

=

'2

(bna

2

t =

-m

IIIa

+ b,,i + + b,,,i"

-

=

0

and with respect to b,,,, we have

APPENDIX I

The general problem is formulated as follows : A set of 2m 1 consecutive values are to be used in the determination of

+

J

+ b,,P

23-m

- y,) i = 0

IIIb

and with respect to the general b,,, we obtain

i- - m

and IIIc or i=m I=

k=n

C bnkik+

C

=

-m k = O

yiir

Iya

i- -?n

Where r is the index representing the equation number which runs from 0 to n (there are n 1 equations). The summation indeses on the left side may be interchanged-i.e.,

+

a=m

k=n

k=n

b,kik" -m k = O

+

+

Sobso S4ho

b,kik" k = O 2--m

IT'b

+

SIbw

2-m

=

$3

Note that S r + k = 0 for odd values of k . Sine e ST+kexists for even k only, the set of n 1 values of r equations can 1- )e separated into two sets, one for even v: dues of k and one for odd values. Thus , for a 5th degree polynomial, where n = 5

r

i-m

+

and finally, since

b,k

+ S4b54 + &bj4

S4bb2

+ SA4

S~bsz

=

Fo

=

F2

=

Fa

VIa

which can b e used to solve for baa, b62, and bS4, whi le:

Snbal f is independent of i,

+ S4b33 S4b31 + S6b33

+

)12b52 j

b60, b42 = b j 2 , arid b41 = bj4 while the set VIb has the same form for n=6, so that bS1 = bel, bS3 = b63, and bss = be6. I n other words, b,, = b,+l,, for n and s both even or for n and s both odd. For example, t o determine the third derivative for the best fit to a curve of third (or fourth) order, we would have:

S4b53

+ Sob56

F1

+ Ssb5j Fa Ssba 4 - Ssbs3 + S ~ O ~=SF5S

S4bs1 -t . S6bj3

VIb

Szb31

=

Fi

=

F3

SzF3 - S4Fi SZSS - S42

from which b33=

When, for instance, rn = 4 (2m points), we have from Vc that

Sz

=

60, 84

=

708, 86

=

+1

=

9

9780

and

F3 - 7F1 -~ 6OF3 - 708F1 ___ 60 (9780) - (708)2 7128

b33

which reduces to:

Va or which cai 1 be used to solve for b51, bas, and bss. ' The set of equations in VIa has the same form for n = 4, so that b40 =

where

The coefficients of yl. constitute the convoluting integers (Table T'III) for the third derivative of a cubic poly~

TABLE

POINTS

25

11 12

-253 -138 -33 62 147 222 287 322 387 422 447 462 46 7 462 447 422 387 32 2 287 222 147 62 -33 -138 -253

NORM

5175

-12 -11

-10 -09 -08 -07 -06 -05 -04 -03 -02 -0 1 00

01 02 03 04 05 06 07 08 09 10

I CUBIC

QUADRATIC

SMOOTHING

CONV OL UT E S

ZL

23

19

~~

17

A20

15

13

A30

11

9

7

5

-21 14 39 54 59 54 39 14 -21

-2 3 6 7 6 3 -2

231

21 3 5

-42

-2 1

-171 -76

I

-136

15

C)

-51

-22

30

8'B 14 9 20 4 24 9 2e i4

24

-6

89

7 18

-78 -1 3 42

-1 1

27

87

9

9

34 39

1.22 147 162 167 162 147 122 87 42 -13 -78

16 21 24 25 24 21 16 9 0 -11

44 69 84 89 84 69 44 9 -36

1105

143

-2 43 54 63

70 75 78 79 78 75 70 63 54 43

30 15 -2 -2 1 -42

8059

3c ) 9 32 ! 4 3; ! 9 3;! 4 31 39 2 84 2 49 2.04 1.49 a4 9 -76 171

-

:3059

144

189 224 249 264 269 264 249 224 189, 144 89 24 -51 -136

2261

42 43 42 39

34 27 18 7 -6 -2 1

323

0

-3 6

429

VOL. 36, NO. 8, JULY 1964

-3 12 17 12 -3

1631

-~ TABLE CONVOLUTES

Q U A R T IC

SMOOTHING

25

23

21

-12 -1 1 -10 09 -08 -07 -06 -0 5 -04 -03 -02 -01 00 01 02 03 04 05 06 07 08 09 10 11 12

1265 -345 -1122 -1255 -915 -255 590 1503 2385 3155 3750 4125 4253 4125 3750 3155 2385 1503 590 -255 -915 -1255 -1122 -345 1265

285 -114 -285 -285 165 30 26 1 495 705 8 70 975 1011 975 8 70 705 495 261 30 -165 -285 -285 -1 1 4 285

11628 -b460 13005 -1 1 2 2 0 -3940 6378 17655 28190 36660 42120 44003 42120 36660 28190 17655 6378 3940 -11220 -13005 -6460 11628

NORM

30015

6555

260015

POINTS

-

-

-

-

POINTS -12 -11 -10 -09 -08 -0 7 -06 -0 5 -04 -03 -02 -0 1 00 01 02 03 04 05 06 07 08 09 10 11 12 NORM

1632

-12 -1 1 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0

1 2 3 4 5

23

21

15

A40

13

A50

11

9

7

5

340 -255 -420 -290 18 405 790 1110 1320 1393 1320 1110 790 40 5 18 -290 -420 -255 340

I \95 -1 9 5 -2 60 -1 1 7 1 35 4 , 15 61 $0 82 ’ 5 88 3 82 5 661 0 41! 5 135 i -117 ’ -260 -195 195

2145 -2860 -2937 -165 3755 7500 10125 11053 10125 7500 3755 -165 -2937 -2860 2145

7429

4199

461891

19

110 -1 9 8 - 160 110 390 600 677 600 390

18 -45 -10 60 120 143 120

60

110 -160 -198 110

-10 -45 18

2431

429

15 -55 5 30 - 3 0 135 75 173 131 1 3 5 75 30 - 3 0 -55 5 15

429 2 3 1

111 A21

15

13

11

-7 -6 -5 -4

-7 -6 --5 -4

-6 -5 -4

-5 -4

-3

-3

-3

-3

-2

-2 -1

-2 -1

-2 -1

17

9

7

5

-11 -10

-10

-9 -8 -7 -6 -5 -4

-9 -8 -7 -6 -5 -4

-3

-3

-2 -1 0 1 2 3

-2

-1 0

1 2

5

3 4 5

6

6

6

7 8

7

9

9

10 11 12

10 11

7 8 9 10

1300

17

QUADRATI C

1ST D E R I V A T I V E

25

QUINTIC

19

TABLE

CONVOLUTES

1’1

4

8

1012

ANALYTICAL CHEMISTRY

770

-9 -8 -7 -6

-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8

-8

-1 0

0

1 .2 3

1 2 3

4

4

5 6 7

5 6 7

0 1 2 3 4 5 6

0 1 .2 3 4 5

-4 -3 -2 -1 0 1 2 3

-3 - 2 -2 - 1 -1 0 0 1 1 2 2 3

4

8

9

570

408

28t3

182

110

60

2 8 10

IV

TABLE

25

23

22

19

30866 8602 -8525 -20982 -29236 -33754 -35003 -33450 -29562 -23806 16649 -8558 0 8558 16649 23806 29562 33450 35003 33754 29236 20982 8525 -8602 -30866

3938 815 -1518 -3140 -4130 -4567 -4530 -4098 -3350 -2365 -1222 0 1222 2365 3350 4098 4530 4567 4130 3140 1518 -815 -3938

84075 10032 -43284 -78176 -96947 1 0 1900 -95338 -79564 -56881 -29592 0 29592 56881 79504 95338 101900 96947 78 176 43284 -10032 84075

6936 68 -4648 -7481 -8700 -8574 -8 1 7 9 -5363 -2816 0 2816 5363 8179 8574 8700 748 1 4648 -68 -6936

1776060

197340

3634092

255816

POINTS -12 -11 -10 -09 -08 -07 -06 -05 -04 -03 -02 -0 1 00 01 02 03 04 05 06 07 08 09 10 11 12

-

NORM

CUBIC

1ST D E R I V A T I V E

CONVOLUTES

-

QUART

POINTS -12 -1 1 10 -09 -08 -07 -0 6 -05 -04 -03 -02 -0 1 00 01 02 03 04 05 06 07 08 09 10 11 12

-

NORM

13

-98 -643 - 9 30 -1002 -902 -673 -358 0 358 673 902 1002 9 30 643 98 -748

12922 -4121 -14150 -18334 -17842 -13843 -7506 0 7506 13843 17842 18334 14150 4121 -12922

1133 -660 -1578 -1796 -1489 -832 0 832 1489 1796 1578 660 -1133

23256

334152

24024

25

23

21

19

-6356625 -11820675 -15593141 -17062146 -1589651 1 -12139321 -6301491 544668 6671883 9604353 6024183 -8322182 0 8322182 -60241 83 -9604353 -6671883 -544668 6301491 12139321 15896511 17062146 15593141 1 18 2 0 6 7 5 63 5662 5

-357045 -654687 -840937 -878634 -752859 -478349 -106911 265164 489687 359157 -400653 0 400653 -359157 -489687 -265164 106911 478349 752859 878634 840937 654687 357045

-15977364 -28754154 -35613829 -34807914 -26040033 -10949942 6402438 19052988 16649358 -15033066 0 15033066 -16649358 -19052988 -6402438 10949942 26040033 34807914 35613829 28754154 15977364

-332684 -583549 -686099 -604484 -348823 9473 322378 349928 -255102 0 255102 -349928 -322378 -9473 348823 604484 686099 583549 332684

7153575

312455

5311735

81719

A41

11

9

7

5

748 300 -294 -532 -503 -296 0 296 503 532 294 -300

86 22 -142 -193 -67 1 - 1 2 6 - 5 8 -8 0 0 0 123 58 8 1 9 3 6 7 -1 142 - 2 2 -86

5148

1188 252 1 2

v

QU I N T I C

1 S T DERIVATIVE

A31

15

17

TABLE CONVOLUTES

IC

SEXlC

A51

17

15

-23945 -40483 -43973 -32306 -8671 16679 24661 -14404

-175125 -279975 -266401 -130506 65229 169819 -78351

0

0

14404 78351 -24661 -169819 -16679 -65229 8671 130506 32306 266401 43973 279975 40483 175125 23945

41990

20995

13

-31380 -45741 -33511 -12 27093 -14647 0 14647 -27093 12 33511 45741 31380

2431

A61

11

9

7

5

-3084 -3776 -5758 -1244 -4538 -90 2166 2762 18 -573 -505 -2 0 0 0 573 508 2 -2166 -2762 -18 1244 4538 90 3776 5758 3084

143

143

VOL. 36, NO. 8, JULY 1964

1 1633

TABLE CONVOLUTES POINTS

-

92 69 48 29 12 -3 -16 -27 -36 -43 -48 -5 1 -52 -51 -48 -43 -36 -27 -16

12 -1 1 -10 -09 -08 -07 -06 -05 -04 -03 -02 -01 00 01 02 03 04 05 06 07 08 09 10 11 12 NORM

QUADRATIC

2ND D E R I V A T I V E

25

-3 12 29 48 69 92 26910

23 77 56 37 20

5 -8 -19 -28 -35 -40 -43 -44 -43 -40 35 -28 -19 -8 5 20 37 56 77

-

17710

21

19

190 133 82 37 -2 -35 -62 -8 3 -98 -107 -110 -107 -98 -83 -62 -35 -2 37 82 133 190

51 34 19 6 -5 -14 -2 1 -26 -29 -30 -29 -2 6 -2 1 -14 -5 6 19 34 51

33 649

6783 TABLE

POINTS

25

23

-04 -03 -02 -0 1 00 01 02 03 04 05 06 07 08 09 10 11 12

-429594 31119 298155 413409 414786 336201 207579 54855 -100026 -239109 -348429 -41801 1 -441870 -418011 -348429 -739109 -100026 54855 207579 336201 414786 413409 298155 31119 429594

-346731 61845 281979 358530 331635 236709 104445 -39186 -172935 -280275 -349401 -373230 -349401 -280275 -172935 -39186 104445 236709 331635 358530 281979 61845 -346731

NOKM

4292145 2812095

-12 -11 10 -09 -08 -07 -06 -05

-

1634

ANALYTICAL CHEMISTRY

CUBIC 17

21

19

A22

15

13

A32

It.

9

7

25 12 1 -8 15 -20 -23 -24 -23 -20 -15

-

-8 1 12 25 40

3876

91 52 19 -8 -29 -48 -53 -56 -53 -48 -29 -8 19 52 9L

6168

22 11 2 -5 -10 -13 -14 -13 10

-

-5 2 11 22

1001

15 6 -1 -6 -9 -10 -9

-6 -1 6 15

42 9

28 7 -8 -17 -20 -17 -8 7 28

5 0

2

-3

-L

-4 -2 - 3 -1 0 -2 5

462

42

7.

9

7

5

VI1 QUINTIC 17

15.

A42

13

A52

11

-37791 11628 -96084 45084-121524 35802 105444 82251 -93093 41412 88803 -72963 109071 153387 34353 76830 137085 133485 98010-10530 19734 95568 115532 20358 -4158 26376 71592 1878 19737 53262 17082 12243-117 -27846 -11799 -15678 117 4 9 8 3 6 0 3 -59253 -32043 -74601 -88749 -30183 -39.672 - 1 0 5 8 6 4 - 1 4 1 8 7 3 - 1 1 6 5 7 7 - 9 9 5 2 8 - 1 5 9 1 2 - 6 7 6 3 - 1 7 1 -42966 -116820-160740 -137340-124740-22230-12210-630-90 1 0 5 8 6 4 - 14 18 7 3 - 1 1 6 5 7 7 - 9 9 5 2 8 - 1 5 9 1 2 - 6 9 6 3 - 1 7 1 -39672 -59253 -32043 117 4 9 8 3 6 0 3 -74601 -88749 -30183 19737 53262 17082 12243-117 -27846 -11799 -15678 95568 115632 20358 -4158 26376 71592 1878 133485 98010-10530 76830 137085 19734 88803 -72963 109071 153387 34353 105444 82251 -93093 41412 45084 121524 38802 11628 -96084 -37791

-

245157

5

40

QUARTIC

2ND DERIVATIVE

CONVOLUTES

VI

490314 478686

277134 160446 16731

4719

99

-3 48 48 -3

3

VCf.1

TABLE CONVOLUTES POINTS -12 -11

3R0 D E R I V A T I V E 25

-506 -253 -55 93 196 2 59 287 285 258 211 145 77 0 -77 -149 -211 -258 -285 -287 -259 -196 -93 55 253 506

-10 -09 -08 -07 -06 -0 5 -04 -0 3 -02 -0 1

00 01

02 03 04 05 06 07 08 09 10 11 12 NORM

296010

21

23 -77 -35 -3 20 35 43 45 42 35 25 13 0 13 -25

-

-35 -42 -45 -43 -35

lt

19

-114 12 98 149 170 166 142 103 54 0 -54 -103 -142 -166 -170 -149 -98

-12 114

3 35 77

-204 -68 28 89 120 126 112 83 44 0 -44 -83 -112 -126 -120 -89 -26 68 204

23

12

118745 2 17640 27910L 290076 2443 11 144616 5131 146408 -266403 -293128 14446 3 284372 0 -284372 144463 293 128 266403 146408 -5131 1 4 4 6 16 -2443 I 1 -290076 -2 7910 1 -217640 -118745

NORM

5722860

-12 -11 -10 -09 -08 -07 -06 -05 -04 -03

-02 -0 L 00

01 02 03 04 05 06 07 08 09 10 11

-

-

-

11

9

-14 7 13 9 0 -9 -13 -7

7

5

-7

-91

7 15 18 17 13 7 0

-13 35 58 61 49 27 -49

-7

-61

-8

-58

-6

-3 0 6 22 23 14 0 -14 -23 -2 2 -6

0

30

0 -27

7 13 17 18 15

-1 1

-35

7

13

-7 28

91

3876

7956

0 6 8 7 4 0

-4

-1 1 -1 1 2

0 ,-1 -2 -1 1

t

14

11

285

86526

42636

SEXIC

A53

19

17

23699 42704 52959 51684 38013 1 3 6 32 - 16583 -43928 -55233 -32224 49115 0 - 4 9 1 15 32224 552 33 43928 16583 - 13632 -38013 -51684 -52959 -42704 -23699

425412 749372 317655 887137 1113240 787382 1231500 448909 932760 -62644 259740 -598094 -589080 -908004-1220520 -625974-1007760 748068 948600 0 0 -748068 -948600 625974 1007760 908004 1220520 598094 589080 62644 -259740 -448909 -932760 -787382-1231500 -887137-1113240 -749372 -317655 -425412

4915 8020 7975 4380 -1755 -7540 -7735 5720 0 -5720 7735 7540 1755 -4380 -7975 -8020 -4915

749892

4249388 4247012

16796 2144809

2L

572

858

198

6 2

IX

Q U I N T IC

3K0 D E R I V A T I V E

25

POINTS

13

A43

-28

TABLE CONVOLUTES

15

A33

-285

-20

32890

QUART IC

CUBIC

15

13

A63 11

9

7

5

93135 141320 11260 113065 15250 1580 3800 8165 1700 2295 -150665 -6870 -55 1280 6 5 -260680 -16335 -2010 -2285 -40 -169295 7150 645 500 5 0 0 0 0 0 -169295 -7150 -645 -500 -5 260680 16335 2010 2285 40 150665 6870 55 - 1 2 8 0 - 6 5 -3800 -8165 -1700 -2295 -113065 -15250 -1580 -141320 -11260 -93135

9724

572

286

VOL. 36, NO. 8, JULY 1964

2 1635

TABLE

4T" DER1VAtIVE

CONVOLUTES

POINTS

25

-12

858 803 643 393 78 -267 -597 -857 -982 -897 -517

-11 -10 -09 -08 -07 -06 -05 -04 -03 -02 -01 00 01 02 03 04 05 06 07 08

253 1518 253 -517 -897 -982 -857 -597 -267 78 393 643 803 858

09 10 11 12

NORM

1430715

21

858 793 605

594

-747 -955 -950 -62 7 133 1463 133 -627 -950 -955 -747 -417 -42 315 605 793 858 937365

POINTS -12 -11 -10 -09 -08 -07 -06 -05 -04 -03 -02 -0 1

-275 -500 -631 -636 -501 -236 119 488 753 7 48 253 -1012 0 1012 -253 -748 -753 -488 -119 236 501 636 63 1

00 01 02 03 04 05 06 07

08 09 10 11 12

500

62 1 251 -249

84 64

9

7

4 -1 -6

16 9 -11

6

-6 6 -6

-21 14 -21 -11

11

352 227 42 -168 -354 -453 -388 -68 612 -6 8 -388 -453 -354 -168 42 227 352 396

1300650

e

408595

163438

31 17

-3 -24 -39 -39

21

-65 -1 1 6 -141 -132 -87 -12 77 152 171 76 -209 0 2 09 -76 -171 -152 -77 12 87 132 141 116 65

-- 21404 444 -2819 -2354 -1063 788 2618 3468 1938 -3876 0 3876 -1938 -3468 -2618 -788 1063 2354 2819 2444 1404

-74 -79 -54 -3 58 98 68 -102 0 102 -68 -98 -58 3 54 79 74

170430

1 9 3 15 4 0

29716

-704 -869 -429 1001 -429 -869 -704 -249 251 62 1 756

-13 52 -13 -39 -39 -24 -3

17 31 36

11 -5 4 -9 6 -66 99 -66 -96 -54

11 64

6

-6

-1 4 6

1 -7

-3 -7

1

9 18

6

9

7

84

XI

QUINTIC

23

ANALYTlCP4 CHEMISTRY

s

36

SEXIC

17

A55

1s

13

-88 -83 36 39 104 91 -104 0 104 -91 -1 0 4 -39 36 83 88 55

-675 -1000 -751 44 979 1144 -1001 0 1001 -1144 -979 -44 751 1000

-20 -26 -11 18 33 -2 2 0 22 -33 -18 11 26

16796

83980

19

A65

11

-44 -55

-

-4 -4 1 6 -3 0 3 -6 -1 4

-9 -4 11 -4

-3 4 -1

0

0

4 -11 4 9

1

-4 5

4

20

675

44

275

NORM

1636

25

13

A54

396

540 385 150 -130 -406 -615 -680 -510 0 96 9 0 -510 -680 -615 -406 -130 150 385 540 594

5TH D E R I V A T I V E

A44



I7

19

TABLE CONVOLUTES

QUINTIC

QUARTIC

23

315 -42 -417

X

884

52

26

2

5

PROGRAM’

*

SUBROUTINE SMOOTH -9

c

1 1 2 3

POINT

SUBROUTINE SMOOTH ( N t N D A T A t M t M D A T A l

4

C C C C C C C C C C C

INPUTS N NDATA OUTPUTS M MDATA

5 NUMBER OF R A W DATA P O I N T S ARRAY 3F N RAW DATA P O I N T S S T O R E D I N M A I N PROGRAM DUMMY D I M E N S I O N

6

NUMBER OF SMOOTHED DATA P O I N T S = N-8 ARRAY 3 F M SMOOTHED P O I N T S STORED I N M A I N PROGRAM MAY BE SAME R E G I O N I N M A I N PROGRAM AS NDATA DUMMY D I M E N S I O N

10

7 8 9

11 12 13 14 15 16

DIMENSIOY Y D A T A ~ 1 0 0 0 ~ ~ M D A T A ~ l O O O ~ ~ N P [ 9 ~

C C C

10

I N I T I A L I Z A T I O N SEGMENT

17 18

M=N-8 DO 10 1 ~ 2 ~ 9 J=I-1 N P ( I ) = NDATA(J1

19 20

21

C C C

SMOOTHING

Loop

DO 2 0 0 1 r l . M J= I +8 DO 11 K = l t 8 KA = K + 1 Tf N P ( K ) = N P ( K A ) N P ( 9 ) = VDATA(J) NSUM=59*NP(5)+54*(YP14)+NP(6)~t39*(NP(3)tNP(7))tl4*(NP(2)+NP(8))~ 121*(NP(l)+NP(9) 1 MDATA(1) = NSUM/23L 200 C O N T I N U E

C 9999 RETURN

C

*

END

nomial determined from a least squares fit to 9 points. Since the value of a33 , denominator in the above is 3 ! b Z 3 the expression must be divided by 6 to get the normalizer of 198 found in Table 111. I n all of the above derivations, it has been assumed that the sampling interval is the same as the absolute abscissa interval-Le., Ax=1. If not, the value of Ax must be included in the normalization procedure. Hence, to evaluate the sth derivative at the central point of a set of m values, based on an a t h degree polynomial fit, we must evaluate

data has been smoothed. Thus, if we convolute using p points the first time, and m points t h e second,

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

Equation XI shows that one need not go through the convolution procedure twice, but can do a single convolution, using 2 ( m + p ) + l points, and a table of new integers formed by combining the c’s .

i-m

i-n

i-m

i-n

i=m

For the case where a cubic smooth is to be followed by obtaining the quadratic first derivative using m = 2 and p=2:

C, = -2, -1, 0, 1, 2, N , = 10 C’, = -3, 12, 17, 12, -3, N, = 35 d-4 = C-zC’-z = 6 d - 3 = c-2C‘-1 C-,C’-2 =

+ -36 + 3 = -33 = C-2C‘O + COC’2 + C-iC’-i = -34 - 12 = -46 = C-2C‘l + C1C’-2 + c-IC‘O + COC’-l -24 - 3 - 17 = -44 do = C-2C12 + C2CI-2 + ClC‘4 c-IC’l + COC’O = 0

d-2

d-1

=

Note that since A x o = l , the interval is of no concern in the case of smoothing. Repeated Convolution. T h e process of convolutian can be repeated if desired. For example, one might wish to further smooth a set of previously smoothed points, or t o obtain the derivative only after the raw

where

h

=

i

+j

dl = d2 = d3 = da= n’h

By symmetry 46 33 -6 = 350Ax

=

44

VOL. 36, NO, 8, JULY 1964

1637

PROGRAM 2 SUBROUTINE CENTEQ

u.

L3RENZ

C

2 SUBROUTINE C E N T E ~ ( N P O I V T I X ~ Y ~ T Q A N S * D E N S )

C C C C

3 4

C O M P U T A T I O Y OF P R E C I S E PEAK P O S I T I O N AND I N T E N S I T Y U S I N G 9 P O I N T S I N ORDER T O TO A Q U A D R A T I C * Y = A 2 0 + A 2 1 X + A 2 2 X S Q * X = ( - A 2 1 / 2 A 2 2 ) o A P P R O X I M A T E A L O R E N T Z C O N T n U R t V A L U E S ARE C O Y V E R T E D T O ABSORBAVCE AND THE R E C I P H O C 4 L S ARE USED I N D E T E R M I N I N G THE C O E F F I C I E N T S B Y ORTHOGONAL P O L Y N O M I A L S

C C

5 6

7 8 9 10

C DIMENSION N P O I N T ( 2 5 I * D Y S ( 9 ) 6 0 DO 6 1 Is199 IP=I+8 61 D N S ( I ) = ~ , / A L O G ~ O F ( ~ ~ O O ~ / N P O I N T ( I P ) ) P4=ONS(l)+ONS(9) P3=DNS(2l+DNS(8) P2=DNS(3)+DNS17) Pl=DNS(4)+DNS(6)

11 12 13 14 15 16 17

18

A20=(-21e*P4)+(14o.P3)t(39o~P~)+~54etPl)t(59e*DNS(5)) A20=A20/231o

A21=14o*(DNS(91-DNSIl)I)t(3o*(DNS(8)-DNS(2)))t(2.~(DNS~7)-DNS(3)) l+IDNS(6)-DYSf4)) A21=A21/600

A22=(28..P4)+(7o*P3)-(8o~P2)-(17oPl200~D~S(S)~ A22=A22/924. X=(-A21/(2oO*A22)) Y=A20+X*(A21+X*A22) DENS=loO/Y

TRANS=lOOOo/(lOoO**DENS)

*

1000 RETURN END

APPENDIX I1

The following eleven tables contain the convoluting integers for smoothing (zeroth derivative) through the fifth derivative for polynomials of degree two through five. They are in the form of tables of A , , , where i is the degree of the polynomial and j is the order of the derivative. Thus, to obtain the third derivative over 17 points, assuming a fourth degree polynomial ( A d 3 ) ,one would use the integers in the column headed 17 of Table VIII. APPENDIX

111.

COMPUTER

PROGRAMS

The programming of today’s high speed digital computers is still an art rather than a science. Different programmers presented with the same problem will, in general, write quite different programs to satisfactorily accomplish the calculation. Two programs are presented here as esamples of the techniques discussed in this paper. They are written in the F O R T R A S language, since this is one of the most widespread of the computer programming languages. Programmers using other languages should be able to follow the logic quite readily and make the appropriate translations. Each is 1638

ANALYTICAL CHEMISTRY

written as a subroutine for incorporation into a larger program as required. Program 1 is a 9-point least squares smooth of spectroscopic data. The raw data has previously been stored by the main program in the region NDXTA. Lines 1 through 25 are evplanatoryand housekeeping to set up the initial conditions. The 9-point array N P contains the current set of data points to be smoothed. The main loop consists of lines26through 35. Theinner loop, lines 28 through 30, moves the previous set of points up one position. The next point is added by line 31. I n lines 32 and 33 the convoluting integers are multiplied by the corresponding data, and the products wmmed. I n line 34, the sum is divided by the normalizing constant and the resulting smoothed point is stored. Program 2 computes the precise peak position and intensity of a set of points which is known to contain a spectroscopic peak. In order to approsimate a Lorentz contour ( 5 ) , values are converted to absorbance and the reciprocals are used in determining the coefficients of a polynomial (6) having the form:

Y

= am

+ u21z+a22z2

19 20 21 22 23 24 25 26 27 28 29 30 31

The center is a t the point where z

=

-a21/2a22.

The data points to be used are points 9 through l7stored inthearray S P O I K T and may have any value from 30 through 999. I n the loop lines 12through 14, each of these points is converted to absorbance, the reciprocal taken, and the result stored in the array DNS. Since for azo and u22, the convolute function is symmetric about the origin, forming the sums P 4 through P1 in lines 15 through 18 shortens the computation. The first constant, azois found in line 19, using the values of the 9-point convolute from Table I, and normalized in line 20. The value of uZ1is computed in lines 21-22 using the convolute from Table I11 (first derivative-quadratic). Xote that this is an antisymmetric function. Table VI furnished the constants for the computation of in line 24. Kote that the normalizing factor of 924 is 2! times the value given in the table. X is computed in line 26 and the corresponding value of y is computed in line 27 by substituting the appropriate values into the polynomial. The absorbance or optical density (DEXS) is, of course, the reciprocal of y (line 28).

LITERATURE CITED

(1)Allen, L. c . , Johnson, L. F . ~ J. A m . Chem. SOC.85, 2668 (1963). ( 2 ) Anderson, R. L., Houseman, E. F., “Tables of Orthogonal Polynominal Values Extended to K = 104,” Agricultural

Experiment Station, Iowa State College of Agriculture and Mechanical Arts, Ames, Iowa, 1942. (3) Cole, LaMont C., Science 125, 874 (1957).

(4) Guest, P. G.,“Numerical Methods of Curve Fitting,” p. 349 ff., University Press, Cambridge, England, 1961, (5) Jones, R. N., Seshadri, K. S., Hopkins, J’ w.J Can’ Jour’ Chem. 40, 334 (lg6’). (6) Kerawala, S. M., Indian J . Phys. 15, 241 (lg41). ( 7 ) SavitzkY, A., A N A L . 33, 25.4 (Dec. 1961). (8) Whitaker, S., Pigford, R. L., Ind. Eng. Chem. 52, 185 (1960).

(9) Whittaker, E.,Robinson, G., “The Calculus of Observations,” p. 291 ff.,

Blackie and Son, Ltd., London & Glasgow, 1948.

RECEIVED for review February 10, 1964. Accepted April 17, 1964. Presented in part at the 15th Annual Summer Symposium on Analytical Chemistry, University of Maryland, College Park, Md., June 14, 1962.

Controlled -Potential Cou Iometric Ana lysis of N-Substituted Phenothiazine Derivatives F. HENRY MERKLE and CLARENCE A. DISCHER College o f Pharmacy, Rutgers-The

State University, Newark 4, N . 1.

b Controlled-potential electrolysis is suitable for the coulometric determination of several pharmaceutically important N-substituted phenothiazines. The concentration of sulfuric acid, used as the supporting electrolyte, has a differentiating effect on the half-wave potentials of the compounds studied. Polarographic measurements obtained with a rotating platinum microelectrode established current-voltage curves. The compounds could b e quantitatively oxidized to a free radical or to a sulfoxide by selection of suitable acid concentrations and applied potentials. Electroreduction of the free radicals occurs at approximately +0.25 volt vs. S.C.E. on a platinum electrode. In the case of the sulfoxides, a single 2-electron reduction step occurred at ca. -0.95 volt vs. S.C.E. on a mercury pool cathode. The determinations showed good reproducibility and an accuracy of ca. 1% was obtained with sample concentrations of 1 0-3 M or greater.

T

establishment of an oxidation mechanism for the various N amino-substituted phenothiazines is a subject of considerable biological significance ( 2 ) . The character of this oxidation has been investigated by using a variety of analytical methods (1, 4 , 7 , 8). However, because of the transient nature of a free radical intermediate, relatively little has been done to demonstrate the quantitative aspects of this reaction. The application of controlledpotential electrolysis to the analysis of phenothiazine derivatives is an extension of previous work by the authors on the electro-oxidation of chlorpromazine (6). Since these compounds are electrolytically active a t moderate applied potentials, controlled-potential coulometry offers a rapid and absolute approach for their HE

quantitative determination. Moreover, this technique makes possible the direct determination of the individual species involved in the oxidation sequence. The oxidation reactions for phenothiazine derivatives are, in general, represented by:

R:

+ .

R.

+ e-

(1)

and

R.

+ HzO

+

S

+ 2H+ + e -

(2)

in 12N sulfuric acid, and

R: and 2R.

+ H20

+ .

R.

+ e-

--

spontaneous

R:

(3)

+ S + 2H+ (4)

in 1 N sulfuric acid ( 2 , 6 ) , where R: represents the initial reduced form of the compound, R . represents the free radical obtained upon 1-electron oxidation, and S represents the corresponding sulfoxide. EXPERIMENTAL

Instrumentation. Polarograms were obtained on a Sargent Model XXI recording polarograph. An H-type cell was used, with a sintered-glass disk of medium porosity separating t h e two electrode compartments. A rotating platinum microelectrode served as the working electrode us. S.C.E. as reference. T o obtain well defined reproducible S-shaped curves it was necessary to pretreat the microelectrode by anodic polarization for 10 minutes in 1N or 12N sulfuric acid at f1.0 volt vs. S.C.E., followed immediately by a brief 2- to 3minute electrolysis with the platinum microelectrode as the cathode. The controlled-potential electrolyses were performed with an electronic controlled-potential coulometric titrator, Model Q-2005 ORNL ( 5 ) . Readout voltages were measured with a ?JonLinear Systems Model 484 A digital voltmeter.

Electrolysis Cells and Electrodes. Two closed cells with operating capacities of 100 and 20 ml., respectively, were used for oxidations. They were constructed to accommodate large cylindrical, wire mesh, rotating platin u m electrodes, 2.5 cm. in diameter a n d 5 cm. in height for the large cell, and 1 cm. in diameter and 3 cm. in height for the small cell. The reference electrode (S.C.E.) and auxiliary platinum cathode were isolated from the sample compartment by sintered-glass diaphragms and agar plugs. The sample compartment of the reduction cell consisted of a 125-m1. wide-mouthed Erlenmeyer flask with a standard-taper neck and fitted. cover. Approximately 30 ml. of mercury was used as the cathode pool. A glass propeller-type stirrer served to agitate the mercury pool. The reference electrode (S.C.E.) and auxiliary electrode (platinum anode) chambers mere separated from the cathode compartment by glass side-arms fitted with sintered-glass diaphragms and agar plugs. The three cells were constructed so that nitrogen gas could be bubbled through the solution before and during electrolysis. The platinum gauze electrodes and the glass stirrer were rotated a t 600 r.p.m. using a Sargent Synchronous Rotator. Materials. REAGENTS.T h e acid solutions were prepared using sulfuric acid, Baker analyzed reagent, distilled water, and ethanol U.S.P. grade. PHENOTHIAZINE DhRIVATIVES. The compounds studied were provided in powdered form by the suppliers indicated: chlorpromazine hydrochloride, chlorpromazine sulfoxide hydrochloride, prochlorperazine ethanedisulfonate, and trifluoperazine dihydrochloride, Smith, Kline & French Laboratories; promethazine hydrochloride and promazine hydrochloride, Wyeth Laboratories; triflupromazine hydrochloride, E. R . Squibb Laboratories; thioridazine hydrochloride, SandDz Laboratories. The structural formulas and generic names of the compounds used in this work are shown in Figure 1. VOL. 36, NO. 8, JULY 1964

1639