Use and abuse of digital signal processors - Analytical Chemistry

Use and abuse of digital signal processors ... Rapid chemiluminescence measurements by digital processing of signals and smoothing by fourier transfor...
1 downloads 0 Views 511KB Size
583

Anal, Chem. 1984. 56,583-586

mericially available instruments, one of which was evaluated by using NaCl standards, NH3/NH4HC03standards, and retort waters. While the NaCl standards yielded reasonable results, no meaningful numbers could be obtained with the other samples. In retrospect, this result is reasonable since the proportionality between dew point depression and solute content can only be expected for nonvolatile solutes (3). Hence, dew point depression (and boiling point elevation) are inappropriate methods for measuring solute content of retort wastewaters. Freezing point depression also has been evaluated by using both artificial standards and actual retort waters and has proven to be the best method of those tested. Table I illustrates the application of this technique to real and simulated retort waters. In this table ideal osmolality refers to the number of moles of solute added, counting each ion separately. Measured osmolality is the freezing point depression in OC divided by 1.86 “C, the freezing point depression per mole at infiiite dilution. The measured and ideal osmolality will agree to the extent that the sample behaves like an ideal (i.e., infinitely dilute) solution. The measured osmolality is sufficiently close to the actual molal strength for most field applications. The final column in the table shows the concentration of NaCl which gives the same freezing point depression as the solution under test. Comparing the data in columns 2 and 4 in this table suggests that the “NaC1 equivalent molarity” is a slighlty better indication of total solute content than is the measured osmolality. The data for the artificial samples in Table I suggest that the total solute content could be measured to an accuracy of 7% (relative) at concentrations up to 3 mol/L. At higher concentrations, solution nonideality would likely become increasingly important, and the freezing point method is therefore not recommended for such samples. The accuracy of most devices for measuring freezing point depression is typically *0.001 mol/L, which constitutes the lower limit of this technique. Of course, experience with retort waters which have been completely analyzed by reliable techniques for all major and minor components is necessary in order to best assess the accuracy of this method. Unfortunately, such samples were not available at the time of this investigation. However, the one retort water sample shown in the bottom of Table I has subsequently (2 years later) been analyzed for most inorganic species using methods developed in the author’s laboratory ( 4 ) with a resulting total solute content of 0.57 mol/L. For the purpose of checking the total of the individual analyses, the data in Table I suggest that the “NaC1equivalent

molarity” should be compared to the sum of the individual species. Since most species are determined in units of mg/L, they can be easily converted to mol/L and compared directly to the “NaC1 equivalent”. This approach may prove to be difficult with waters containing high levels of total organic carbon (TOC) which are not analyzed for individual organic species. In this case the TOC measurement could not be related directly to molarity. In any case, a high molar organic content suggests that at least the major organic species should be determined. Repeatability of the freezing point method was determined by analyzing a variety of retort waters with the commericially available instrument listed in the experimental section of this report. Most results could be repeated to within *0.001 osmols, indicating that adequate precision is available from commerically available instruments. With such instruments, the freezing point measurement can be made in a matter of minutes with a minimum of equipment. The freezing point depression thus appears to be a method which could easily be performed in field laboratories in support of water pollution control tests. However, this author has not yet applied this test under field conditions nor to a large number of samples and therefore cannot yet attest to its ruggedness and reliability under such conditions. ACKNOWLEDGMENT Freezing point depression measurements from the Knaure cryoscope were obtained by Huffman Laboratories (Wheat Ridge, CO). Registry No. Water, 7732-18-5. LITERATURE CITED (1) EPA, Methods for Chemical Analysis of Water and Wastes, US EPA600/4-79-020, 1979. (2) APHA Standard Methods, American Public Health Association, WashIngton, DC, 1976. (3) Lewis, G. N.; Randall, M. “Thermodynamics”; Revised by K. S.Pitzer and Leo Brewer; McGraw-Hili: New York, 1961. (4) Wallace, John R.; Alden, Linda; Bonomo, Francis S.;Nichols, John; Sexton, Elizabeth Methods of Chemical Analysis for Oil Shale Wastes; Report Prepared under USEAP Contract No. 68-03-2791 by Denver Research Institute, 1982.

J o h n R. Wallace* Francis S. Bonomo Denver Research Institute University of Denver Denver, Colorado 80208

RECEIVEDfor review February 28, 1983. Resubmitted November 14,1983. Accepted November 14,1983. This work was supported by U.S. EPA Contract No. 68-03-2791.

AIDS FOR ANALYTICAL CHEMISTS Use and Abuse of Digital Signal Processors Mark R. Thompson a n d Raymond E. Dessy* Chemistry Department, Virginia Polytechnic Institute and State University, Blacksburg, Virginia 24061 The use of digital signal conditioning is increasing in popularity as the cost of the required hardware decreases. Many signal processing tab that have traditionally been performed by analog circuits can now be performed by digital circuits which have many advantages over their analog counterparts. 0003-2700/84/0356-0583$01.50/0

The digital devices are not as susceptible to drift and can implement time constants not available with analog filters. They also allow filter functions which are symmetrical. Recently read-only-memory-baseddigital signal processors have been introduced which are designed so that the average 0 1984 American Chemical Society

584

ANALYTICAL CHEMISTRY, VOL. 56, NO. 3, MARCH 1984

m N

I’B

1

2

3

4

5

e

7

B

e

_---

_ - - - -_ _ - - - - -

I0

m

50

0

h

u3

100

PERCENT INSTRUMENT SIGNAL Figure 2. ADC

‘t

resolution with voltage range.

N

1

2

3

4

5

8

7

B

Q

10

TlHE (%a)

Flgure 1. (A) Signal. (B) Signal overfiltered. (C) Signal with

quanti-

zation noise. experimenter can have access to many functions. A typical processor consists of an analog-to-digital converter (ADC), a digital processor, and a digital-to-analog converter (DAC). These devices have the advantage of being easy to install and use but the operator who does not understand their operating principles may encounter some interesting and surprising results. While it is common knowledge that improperly used instruments will output invalid data, few people seem to understand that improperly used digital signal processing will also yield erroneous and misleading data. A commercially available signal processor was used to demonstrate three of the difficulties commonly observed in digital signal handling: over-filtering, amplitude quantization error, and aliasing. An instrument simulator ( I ) was used as a signal source. The simulator output a gas-chromatographic-like signal (Signal); and random noise (Noise) could be added to Signal. In order to add fixed frequency noise (Sine) an external sine wave generator was connected so that its output was summed with Signal and Noise. The instrument simulator was set to output a single scan in 10 s with a range of 0 to 5 V and a peak-to-peak Noise value of 2 V. The imposed Sine had a frequency of 1.14 kHz and a peak-to-peak amplitude of 2 V. A Moseley Autograf X-T recorder was used to plot the output. The recorder had no external damping adjustment. Experiments showed that the recorder responded to frequencies below 60 Hz,between 60 and 120 Hz,and between 120 and 180 Hz. At 60 Hz,120 Hz,180 Hz,and above 180 Hz signals were completely attenuated. This allowed the recorder to filter out line frequencies and higher harmonics in addition to other high frequency noise. Figure 1A shows the output which resulted when the instrument simulator output, Signal, was connected directly to the recorder. When the digital signal processor was inserted between the simulator and the recorder and an inappropriate filter function was selected, the trace shown in Figure 1B resulted. Although the problem was obviously over-filtering, many chemists seem surprised when a digital filter causes this problem. Digital filters have time constants just as analog filters do and an incorrect choice of the time constant will result in a distorted output. Because it is not always obvious from the documentation what the time constant of a digital filter is, the best approach to use in determining the correct filter is an empirical one.

By checking signal both before and after the signal processor, a chemist can easily determine if a filter is causing distortion. When the digital filter was properly adjusted, the filter’s output and input appeared to be almost identical. The result of another common mistake in the use of digital signal processors is amplitude quantization error. By use of a recorder with a fixed sensitivity of 0 to 10 mV full scale in conjunction with the digital signal processor, an initial scan went “off-scale” on the recorder. The sensitivity of the instrument was reduced by a factor of 10 and a weak signal was observed. To increase the amplitude of the recording, the output gain of the signal processor was increased and the signal with quantization error shown in Figure 1C was generated. The original reduction of the instrumental sensitivity by a factor of 10 reduced the maximum instrumental output from 5 V to 0.5 V. The span of instrument output for both cases is shown in Figure 2, referenced to the left vertical axis. When a ten-bit ADC set for a range of 0 V to 5 V was used, the reduction in instrument sensitivity effectively reduced the number of bits of ADC resolution from ten to seven (as shown on the right vertical axis). The increase in the gain of the processor output made the digitized nature of the signal obvious. To avoid this pitfall the sensitivity of the instrument should have been left unchanged, so that both the instrument and the ADC were operated between 0 V and 5 V. The intensity of the off-scale signal should have been reduced by decreasing the gain of the processor output. In order to demonstrate the effects of random and fixed frequency noise the output of the instrument simulator was input directly to the chart recorder. The traces drawn by the recorder for Signal, Signal + Noise, and Signal + Sine all appeared very similar to Figure 1A. As expected the recorder filtered out both the high-frequency random noise and the high-frequency sine wave (1.14 kHz). In an attempt to improve the signal before it reached the recorder the output of the simulator was then reconnected to the signal processor and the output of the processor to the recorder. This did not change the output for Signal but Figure 3 shows the traces drawn by the recorder for the inputs Signal Noise and Signal Sine. Comparing Figure 3A to Figure 1A digital processing of the signal appears to have introduced noise into the signal instead of filtering it out. Even more interesting is the comparison of Figure 3B to Figure 1A. Processing of data with a sine wave superimposed on the signal has led to a very distorted signal. While the chemist experienced with sampled systems would immediately recognize these symptoms, the average chemist might be more apt to blame the signal processor for corrupting “his data” or, even

+

+

ANALYTICAL CHEMISTRY, VOL. 56, NO. 3, MARCH 1984 1

A

1

585 B

m q 1 N 8 -

rif

1

3

2

5

4

8

7

6

Q

10

D

*N ’

+

m -

‘i

N

1

2

3

5

4

8

7

e

9

10

Signal

+

processed.

TIME (5.0)

Flgure 3.

Flgure 6. (A) Oscilloscope trace of Signal Noise, processed. (B) Power spectrum of Signal 4- Noise, processed. (C) Oscillascope trace of Signal Sine, processed. (D) Power spectrum of Signal f Sine,

+ Noise, processed. (B) Signal 4- Sine, processed.

1

m

0

\ I I 100, ,

200

300

FREOUENCY

Flgure 4.

400

SEE

(Hd

11

,



1100

1200

I

C

Figure 7. (A) Oscilloscope trace of

Signal 4- Noise, filtered. (E) Power spectrum of Signal Noise, filtered. (C) Oscilloscope trace of Signal + Sine, filtered. (D) Power spectrum of Signal Sine, filtered.

+

Power spectrum of Signal.

D

D

+

1

a

1

r

1

B

D

I

+

Noise. (B) Power Figure 5. (A) Oscilloscope trace of Signal spectrum of Signal Nolse. (C) Oscllloscope trace of Signal + Sine. (D) Power spectrum of Signal + Sine.

+

worse, assume the output was correct. In order to understand the reasons why the digital signal processor has altered the signals it is necessary to use equipment not necessarily available in the analytical lab. An oscilloscope can show both the slowly changing signals (low frequency) to which the recorder responds and the rapidly changing signals (high frequency) which the recorder damps out. To show more clearly the operation of the processor a frequency spectrum analyzer is essential. The output of the spectrum analyzer shows component frequencies in a plot of frequency vs. intensity. Figure 4 shows the power spectrum of Signal shown in Figure 1A. (In order to simplify the figures the numbering and labels shown on Figures 1A and 4 have been omitted from all subsequent figures.) Note that the components of Signal are of very low frequency. There is also a peak which indicates the presence of 60 Hz noise. Figure 5A,B shows the trace and power spectrum of Signal + Noise. Figure 5C,D shows the trace and power spectrum of Signal + Sine. When the signal processor is included between source and recorder, the traces shown in Figure 6 are generated. Figure 6A,B shows evidence of noise frequencies which have been shifted to lower frequencies, i.e., aliased, by the digital signal processor (2). Figure 6C,D shows that Sine has been aliased

Flgure 8. (A) Oscilloscope trace of Signal + Noise, filtered 4- processed. (B) Power spectrum of Signal + Noise, filtered + processed. (C) Oscilloscope trace of Signal Sine, filtered + processed. (D) Power spectrum of Signal + She, filtered + processed.

+

to frequencies between 0 and 60 Hz to which the recorder responds. Aliasing is a problem in all sampled systems that do not insert a low-pass filter in front of the sampling component. In order to avoid aliasing it is necessary to filter out the frequency components in the instrument output which are more than half the sampling frequency. Active and passive filter design is simple with today’s modular packages. Theory (3) and practice (4-6) are well-documented. The effects of a low-pass filter set at 300 Hz are shown in Figure 7. These power spectra should be compared to the power spectra in Figure 5. Notice that the low frequenciesare not changed but that the high frequencies have been attenuated. Figure 8 shows the signals and the power spectra which result from the digital processing of the filtered signal. In all three cases, Signal, Signal + Noise, and Signal + Sine, the use of both a low-pass analog filter and a digital filter produces results which are equal or superior to the digital filter alone. Packaged digital signal processors of both the hardware and software type are of definite use to the analytical chemist. The average chemist should not waste time writing complex programs available from other sources or wiring circuits. It is, however, imperative that all users of these processors have

586

Anal. Chem. 1984, 56,586-589

a t least a basic understanding of how they work. This understanding prevents misuse of the equipment and as a consequence generates the best possible analytical results. ACKNOWLEDGMENT The authors thank the Chemistry Department Electronics Shop for assistance and the use of equipment. LITERATURE CITED (1) Wohltjen, H.; bessy, R. J . Chem. Educ. 1070, 56, 153-156. (2) Binkley, D.; Dessy, R. J. Chem. Educ. 1070, 56, 148-153.

(3) Malmstadt, H. V.; Enke, C. G.; Horllck, G. “Electronic Measurements for Scientists”; W. A. Benjamin: New York, 1974; pp 767-773, 762-763. (4) Graeme, J. G.; Tobey, G. E.; Huelsman, L. P. “Operational Amplifiers-Deslgn and Applications”; McGraw-Hill: New York, 1971; pp 282-316. (5) Shelngold, D. H., Ed. “Transducer Interfacing Handbook”; Analog Devices, Inc.: Norwood, MA, 1980; pp 35-37, 54-65, 127, 137, 147, 181, 195-198, 212, 213, 220-225, 229. (6) Hillburn, J. L.; Johnson, D. E. “Manual of Active Fllter Design”; McGraw-Hill: New York 1973.

RECEIVED for review March 25, 1982. Resubmitted and accepted November 14, 1983.

Computer-Controlled Weight Titrator Based on a Force-Compensation Balance Byron Kratochvil* and J.

E. Nolan

Department of Chemistry, University of Alberta, Edmonton, Alberta, Canada T6G 2G2 Cost effective chemical analysis requires accurate and efficient collection and processing of analytical data. The introduction of microprocessors is producing a major impact on these two areas. These devices allow not only the rapid and automatic control of analytical instrumentation but also the routine use of such powerful but mathematically tedious methods of data handling as nonlinear least-squares analysis and simplex optimization. As a result, the ways in which analytical problems can be approached are changing radically (1).

An earlier publication from this laboratory described a computer-controlled gravimetric titrator that was developed primarily to collect data on solutions suitable for the determination of formation Constants (2). This paper reports major changes in the original titrator that provide greater simplicity and flexibility. Titrimetric methods, although not so rapid or easily automated as high-pressure liquid chromatography or various flow-injection techniques, have the advantage of greater precision. This makes them important in some analytical applications. An example is the determination of uranium in procedures for nuclear safeguarding, where a precision of a few parts in 10000 is the norm and where automated titrimetry (3-5) is one of the few satisfactory techniques available. Another exqmple is analysis of standard or certified reference materials. Pungor and co-workers have recently reviewed the field of automated titrimetric analysis (6). A second area where titrations continue to find application is the collection of data for the study of complex equilibria in solutions. Many computer programs have been developed for the deduction of stability constants from titration data (7-10). A computer-controlled titrator can readily collect data of greater precision and more uniform distribution than those obtained manually. Of these advantages, greater precision is the more significant since the amount of information that can be successfully extracted from a titration curve of a complicated system is often limited by the quality of data (9). Our original titrator incorporated a gravimetric approach to titrant delivery. The superiority of metering titrant by weight rather than volume, particularly with respect to precision and accuracy, has been recognized for many years (11). Past attempts to employ this approach in a computer-controlled titrator, however, required complex schemes to mechanically isolate the titrant reservoir (4)or the entire titrant delivery system (2). The advent of stationary-pan digital electronic balances made possible a much simpler design. The principle appears to have been first applied by Moran (3);the

concept was later discussed by Luft (12). We describe here an improved computer-controlled weight titrator that incorporates a stationary-pan balance (Figure 1). Additional features include (1)absorbance-monitoring capabilities, (2) programs for the control of the titrator in three functional modes-potentiometric, photometric, or both, and (3) a new predictor algorithm for potentiometric titrations that efficiently calculates appropriate titrant dosages based on previously observed potential changes. EXPERIMENTAL SECTION Gravimetric Titrant Delivery System. The system (Figure 1)consista of a Mettler PL200 balance (Mettler Instrument Corp., Princeton, NJ), having a range of 160 g and a sensitivity of 1mg, and a 250-mL tubulated plastic bottle connected by 0.0625 in. i.d. Tygon tubing and standard Teflon chromatography fittings to a 12-V dc latching solenoid valve (General Valve Corp., Hanover, NJ, P/N 2-26-900). Another length of Tygon tubing connects the valve to a delivery tip fashioned from a short length of 0.3 mm i.d. Teflon tubing, which has been flared slightly at one end to fit snugly inside the Qgon tubing. The tip is immersed directly in the solution to be titrated. The balance pan and titrant reservoir are enclosed in a Plexiglas balance case constructed locally. The delivery valve is opened and closed by 12-Vdc, 700-mA pulses of opposing polarity (duration -15 ms). The pulses are generated by a power supply designed by the departmental electronicsshop. The valve can be operated either by manual means or under remote (computer) control. Computer Hardware and Monitoring Instrumentation. The computer and its related hardware remain essentially unchanged from the previous design (2). Briefly, a PDP 11/03 minicomputer (Digital Equipment Corp., Maynard, MA) is interfaced to the various BCD instrument outputs by a four-channel multiplexer (Figure 2) to a DRVll 16-bit digital 1 / 0 port. Instrumentation connected to the multiplexer includes the balance, a Fisher Accumet 520 pH meter (Fisher Scientific), and a Cary 118C spectrophotometer(Varian Associates, Palo Alto, CA). The BCD outputs of the spectrophotometer digital readout were connected to previously unused multiplexer inputs, and minor wiring changes were made to accommodate the new balance. Absorbances during titrations were monitored by circulating solution from the titration vessel with a Rainin Rabbit peristaltic pump (Rainin Instrument Co., Woburn, MA) through a 1-cm 10-pL flow cell (Hellma Cells Corp., Jamaica, NY) inserted into a thermostated cell compartment in the spectrophotometer. Titrator Control Software. Programs for the PDP-11/03 were written in RT-11 FORTRAN supplemented by high-level 1/0 subroutines from the DECLAB-03 FORTRAN Extensions Package. All programs run under Version 02C of DEC’s RT-11 SJ operating system. Table I outlines the three programs that control various instrument configurations for different experi-

0 1984 American Chemical Society 0003-2700/84/03513-0586$01.50/0