Data Convolution and Peak Location, Peak Area, and Peak Energy Measurements in Scintillation Spectrometry HERBERT P. YULE General Atomic DivisionlGeneral Dynamics Corp., San Diego, California
b Data convolution techniques largely eliminate statistical scatter in scintillation spectra. A computer program applying these techniques to the problems of locating peaks, determining their areas, and estimating their energies with reasonable accuracy is described. The program appears to work very well, and should be considerable aid in gamma-ray spectrum analysis.
D
CONVOLUTION promises to become an invaluable aid in the interpretation, analysis, and understanding of scintillation spectrometer data. This technique has been applied to problems in analytical chemistry by Savitzky and Golay ( 5 ) , and subsequently introduced to the field of scintillation spectrometry by Blackburn ( I ) . The technique largely eliminates statistical scatter in the data, producing a very smooth spectrum. Once the data have been convoluted, location of peaks may be accomplished by finding a sign change in the first derivative, for example, or by looking for minima in the second derivative, and then applying simple tests to get rid of those “peaks” which are either Compton shoulders or not statistically valid. Calculation of peak areas is much less dependent on statistical fluctuations in the points used to determine the area underneath the peak. It is apparent from these remarks that this technique will have numerous applications in the field of scintillation spectrometry. This paper describes the application of data convolution to location of peaks in scintillation spectrometry data, calculation of peak and base areas, and peak energies. The calculations employed in data convolution are quite simple, although time consuming, and for this reason the computer is ideally suited for this task. The computerized interpretation of scintillation spectrometry data has been intensively studied, and a peak locating program was used for a while by Wainerdi and coworkers (3, 4) in activation analysis studies, but has been replaced by more sophisticated and highly specialized mathematical treatment. Peak location routines can still be very useful in activation analysis studies, however, because they can supply needed answers quickly and ATA
easily without resorting to elaborate calculations. Peak area calculation, using the computer, has been described by Choy and Schmitt ( 2 ) , who supply approximate peak location to their program. Using the present method, the peaks are located by the program and then areas are calculated. An example of the utility of the present routine is the identification of isotopes contributing to observed spectra. The routine supplies the information usually needed for this purpose: peak energies, peak areas, and, from different spectra, time dependence of peak areas. A routine (as computer programs are often called) which provides this information either to the analyst or to a peak identification routine provides a good start in complete qualitative spectrum analysis. Another example of the utility is the application to quantitative analysis. Many reactor neutron activation analysis gamma-ray spectra are quite simple, for either the peak of interest is present or absent. If present and free of interference, a concentration value may be calculated from the peak area by a simple extension of the routine. If no peak is present a t the proper energy, the routine may calculate an upper limit. To show the power of data convolution, consider the points shown in Figure 1. The raw data (the circles) are the counts per channel in the 0.220m.e.v. peak in a spectrum of Bal3I and Ba135m. After data convolution, the points in the spectrum are represented by the triangles, and can be connected by a smooth Gaussian curve. The peak is not symmetrical because of the 0.268-m.e.v. Ba135mpeak. Note that peak area and height have not changed, but the peak shape is much improved, and peak position is now readily apparent. The equation used to produce the smoothed spectrum points is taken from reference (5):
Here Ci is the number of observed counts in channel i and Di is the number of counts in channel i in the smoothed spectrum. Using different sets of
coefficients produces the first or second derivative. Strictly speaking, convolutions are derived for application to polynomials, and it has been assumed in this work (5) that the region of the spectrum (5 points in the present work) used in calculating the smoothed spectrum can be represented by a second or third degree polynomial. The smoothed spectrum is the same for either second or third degree polynomials, but the first derivative is not. Trials of first derivatives formed using convolution functions for both second and third degree polynomials showed slight differences in the channel a t which the sign changed. The second degree polynomial was used in subsequent routines because it located peak tops somewhat more accurately. EXPERIMENTAL
Samples were irradiated in the General Atomic TRIGA Mark I reactor and spectra were determined with a 3-inch by 3-inch solid XaI(T1) detector and a 400-channel analyzer. For further experimental details see reference (6). Tests of the computer program were run on gamma-ray spectra which had been collected into a catalog of reactor thermal-neutron product scintillation counter spectra (6). Thirty-five spectra of isotopes from 0 ’ 9 through Brsz tested. OUTLINE OF THE COMPUTER ROUTINE
The first step is the convolution of the data, generating both the smoothed spectrum and the smoothed first derivative. The second derivative was also tried a t first, but it was more difficult to interpret than the first derivative and discontinued. -4 five-point convolution was found superior to sevenor nine-point convolutions. This is because seven- and nine-point convolutions tend t o flatten peaks, and best results are obtained when the number of points used does not exceed peak full width a t half maximum. The second step locates possible peaks, Compton shoulders, and meaningless wiggles. Subsequent tests will eliminate shoulders and wiggles. In essence, the computer looks for groups of channels such that the first derivatlve, E,, fulfills the following criteria:
E,O;
E,-2>0
VOL. 38, NO. 1, JANUARY 1966
103
That is, the computer searches for any place where the derivative changes from positive to negative as it does a t a peak top. The restriction on channel i - 2 assures that a peak will have a t least two points on the left side. The third step checks the number of consecutive negative E values on the right of the peak; if it finds less than four consecutive negative E values, the peak is discarded. This test is a bit stringent, but is necessary to eliminate minor peaks of no value in spectrum interpretation or analysis. Sodium-24 a t moderate counting rates, for example, displays peaks a t 0.51-, 0.68-, 1.37-, 1.75-, 1.9-, 2.24-, and 2.75m.e.v. The 0.68-m.e.v. peak is a coincidence of one annihilation gammaray and (quite probably) the backscatter gamma-ray from the other gamma-ray produced in the same annihilation, The 1.9-m.e.v. peak is a coincidence of an annihilation and 1.37m.e.v. gamma-rays. This test eliminates the unwanted 0.68- and 1.9m.e.v. coincidence peaks. The fourth step checks for shoulders in several sequential parts. (The Compton shoulder is also called the Compton edge.) First, it checks the energy of the peak. If it is a shoulder, the peak must exceed 500 k.e.v. for If the reasons explained below. energy of the peak is lower than 500 k.e.v., the rest of the test is bypassed. Second, a shoulder can exist only if there is a large peak to the right of the shoulder. Liberal limits place the peak 180 to 450 k.e.v. to the right and at least a factor of 2.5 higher than the top of the shoulder. If no peak is found that meets these conditions, the rest of the test is skipped. This test assumes that no peak lies off scale to the right. The third test locates the minimum D,on the left of the shoulder. The test covers as many channels on the left of the shoulder top as there are channels between the shoulder top and the minimum between the shoulder and the peak to its right. The slope (per channel) between the minimum on the left and the shoulder top is calculated and expressed as a percentage of the value of the minimum on the left. Slopes over 3y0 indicate peaks; those under 3Y0, shoulders. Criteria for all three parts of this test were obtained by studying the catalog of reactor thermalneutron product gamma-ray spectra for about 125 isotopes from 0 1 9 through Pb207". Compton shoulders are not observed below 500 k.e.v. because of the high counting geometry used in this work, 30%. The peak boundaries are decided next. The left boundary is fixed where the first derivative changes signLe., in the valley below the peak. The right boundary is fixed where the derivative changes sign on the right. 104
ANALYTICAL CHEMISTRY
CHANNEL NUMBER
Figure 1. Comparison of data points in photopeak before and after convolution.
0 Raw data A Smoothed points
This sometimes results in the right boundary being too far out, so the routine tests a tangent to the left minimum and different positions along the right side of the peak. The test begins near the right top of the peak on the right. The slope of this line will be considerably larger than the E value a t that point. As the test continues down the right side of the peak, the test slope becomes smaller until it is less than the E value a t some point near the bottom. If this channel number is less than that of the previously fixed right boundary, the boundary is considered to be the new, lower channel number. The peak area and base area are calculated next. Base area
=
+ DR)X
0.5X (DL
(R - L R-1
Peak area =
Di
- 1)
(2)
- base area
(3)
LS1
The peak is considered to lie between, but not include, channels L (left) and R (right) and the number of channels included in the peak is ( R - L - 1). Next, the peak is tested for statistical validity (3, 4). To be a valid peak, it must obey the following criterion: Peak area > 3 (base area) lI2 (4) While this criterion may seem to be stringent, it has never discarded a real peak. At this point in the calculation, real peaks have been identified, discarding shoulders, some coincidence peaks, statistically invalid peaks, and meaningless wiggles a t low counting rates. One more calculation is needed: peak energy. Assuming that the highest point in a peak best approximates the peak position and hence energy, the program checks the immediate area of
the peak top in the smoothed spectrum, D,, to find the channel with the largest number of counts. The exact peak position has not been identified until this point in the calculation, for only the approximate peak position has been located, a t the first channel where the derivative is less than zero. Depending on the location of the data points relative to the top of the peak, the derivative can change sign either just to the right or left of the peak top (or at the peak top). Peak energy is obtained by multiplying the gain factor, usually precalibrated to 15 k.e.v. per channel, times the peak channel number. RESULTS AND DISCUSSION
In the test of the program on the 35 spectra of reactor thermal-neutron products, 0 ' 9 through Bra2,no significant peaks were missed; there are over 150 peaks in these spectra. Only four very small peaks were missed: 0.199-m.e.v. in Ge75, 0.367-m.e.v. in Ge77, 1.62m.e.v. in W 5 , and 0.62- and 0.70m.e.v. in BrE2. These four peaks have very few points in them, and the smoothing process tends to eliminate them. A number of peaks were recognized by the program which were not noted in manual examination of the spectrum either in digital form or in analog form, either as oscilloscope display or plots produced by an electromechanical point plotter. A manual plot of the data, followed by careful inspection of the plot, finds a few peaks that the computer missed, Manual plots are time consuming and tedious, however, and often require the plotter to decide whether a low count rate bump is a real peak. Peak area calculations agree well, in almost all cases, with manual cal-
culations. The computer frequently selected the right boundary as being somewhat closer to the peak top than the author did in manually choosing the boundaries on the raw (not smoothed) data. The computer had the advantage of working with smoothed data and of making decisions consistently while the author’s decisions, made a t different times, were probably not so consistent. I n many cases, however, right boundary choices were identical, and left boundary choices were usually identical. Choy and Schmitt (W), in their peak area calculation program, calculate peak areas by determining the number of counts above a base line tangent to the spectrum at either side of the peak. Elaborate measures mere often needed to obtain the right peak boundary. ITsing convoluted data makes tangent fitting and area calculation simple. I n a few cases peak areas did not agree a t all with previously calculated areas. This occurred whenever two peaks were close together and appeared as a double hump. The manually chosen peak boundaries included both peaks, as one area, but the computer found two peaks and calculated two areas, or one area if the left peak was relatively small. This difference is not serious, since neither method is a satisfactory measure of peak area. The computer found several peaks which are not normally considered
peaks. It found backscatter peaks, for example. The backscatter peaks are very similar in shape t o ordinary full-energy peaks. Several attempts were made to eliminate backscatter peaks, but there appears to be no gross feature which will allow their elimination without either eliminating peaks (non-backscatter type) in the same energy range and/or a n occasional peak a t other energies. The backscatter peak is a real peak and should be overlooked in later data analysis rather than eliminated by the peak location routine. The routine also found peaks a t either end of the random sum spectrum of Sc46m. While the program could be modified t o eliminate these trivial peaks, it was felt that a loss in generality would result from inclusion of details on individual spectra. There are almost 200 reactor thermal- and fast-neutron produced isotopes, so a loss in generality could be unduly restrictive as well as making the prcgram very long and complex. The shoulders of sum peaks (e.g. 2.5-m.e.v. from Cow) are not eliminated by the shoulder test (fourth step in the calculation) because the shoulders are not much smaller than the peaks themselves. As a result, the shoulder may be considered as a real peak. Perhaps this problem could be resolved by putting the height requirement aside if other real peaks in the spectrum
summed to an energy such that the shoulder could be a shoulder rather than a peak. Peak energy calculations generally gave good agreement with known energies. They did not agree well if the analyzer calibration was incorrect, either in gain or base line adjustment. Agreement was also poor if the peak was a small one sitting on a steeply sloping background. I n Figure 1, the curve has a peak in channel 57.0 or 57.1; a least squares fit of a Gaussian to the top of the peak gives 57.7 for the peak, The raw data appear to favor the former value; evaluations of which method best locates the peak are in progress. LITERATURE CITED
(1) Blackburn, J. A., ANAL.CHEY.37,
1000 (1965). (2) Choy, S. C., Schmitt, R. A,, Nature, 205. No. 4973. 758 (1965). (3) Dkew, D. D., Fite, L.’E., Wainerdi, R. E., NAS-NS 3107, p. 237, October, 1962. (4) Kuykendall, W. E., Wainerdi, R. W., “An Investigation of Automated Acti-
vation Analysis,” presented at the International Atomic Energy Agency Conference on “The Uses of Radioisotopes in the Physical Sciences and Industry,” Copenhagen, Denmark, Sept. 6-17, 1960. (5) Savitzky, A,, Golay, 11.E. J., ANAL. CHEY.36, 1627 (1964). (6) Yule, H. P., Rept. GA-6209, General Atomic Division/General Dynamics Corp., San Diego, Calif. RECEIVED for review September 7, 1965. Accepted Sovember 5 , 1965.
Galvanic Analysis of Aqueous Alkali and Ammonia Vapor CARLOS J. SAMBUCElTIl Beckman Instruments, Inc., Fullerton, Calif. The galvanic-coulometric determination of hydroxyl ion is possible with an aluminum anode of sufficient surface area exposed to this ion. The anode is coupled with a cathode of activated carbon in a neutral unbuffered electrolyte. For the determination of a limited quantity of aqueous alkali, the sample is added to a cell with electrolyte recirculating over the anode. The integrated pulse of galvanic current represents the quantity sought. The method is suitable for monitoring traces of ammonia vapor in a gas stream. The current signal obtained measures the concentration of ammonia. In either case, Faraday’s law applies. Indirectly, acidic constituents may b e determined in a gas stream b y using a cell with recirculating electrolyte and generating alkali electrolytica Ily within the cell. The level of alkali left over after reaction with the sampled acid
is monitored galvanically. The aluminum tends to passivate in time but can b e rejuvenated.
A
years ago a systematic investigation was carried out on the voltammetric properties of aluminum (11). Current-potential electrodes curves showed the tendency of the electrode to remain polarized over a wide potential range, although several ionic species behave as depolarizers under given conditions. Amperometric and potentiometric measurements with aluminum as indicator electrodes have been reported by several authors (1, 8, 9, 14). The fact that strong alkalies produced a current proportional to the hydroxyl ion concentration prompted examples of amperometric acid-base titrations (12). I n the examples cited above only a fraction of the total reactant was afFEW
fected by the electrode reaction, because of the nature of voltamnietric methods with microelectrodes. .i new approach is presented here for the batchwise or continuous measurement of alkalies. The method is coulometric, and the sample is completely converted into signal, the controlling factor being the rate of sample supply. The present technique represents another application of the methods of galvanic analysis described by Hersch and coworkers (3). Aluminum is used as the anode in a galvanic system of the kind: (anode)
1
neutral electrolyte unbuffered 1 active carbon I (cathode)
Present address, Advanced Systems
& Development Division, IBM, Yorktown Heights, N. Y. VOL. 38, NO. 1, JANUARY 1966
105