Page 1

DOI:10.1007/s003400100751

Appl. Phys. B 74, 85–93 (2002)

Lasers and Optics

AppliedPhysicsB

d.p.leleux1,✉

r.claps1

w.chen1

f.k.tittel1

t.l.harman2

Applications of Kalman filtering to real-time

trace gas concentration measurements

1Rice Quantum Institute, Rice University, Houston, TX 77251-1892, USA

2Computer Engineering Department, University of Houston Clear Lake, Houston, TX 77058-1098, USA

Received: 13 July 2001/Revisedversion: 11 October 2001

Published online: 29 November 2001• © Springer-Verlag 2001

ABSTRACT A Kalman filtering technique is applied to the sim-

ultaneous detection of NH3and CO2with a diode-laser-based

sensoroperatingat1.53 µm.Thistechniqueisdevelopedforim-

proving the sensitivity and precision of trace gas concentration

levels based on direct overtone laser absorption spectroscopy in

thepresenceof various sensor noise sources. Filter performance

is demonstrated to beadaptive to real-timenoise and data statis-

tics. Additionally, filter operation is successfully performed

with dynamic ranges differing by three orders of magnitude.

Details of Kalman filter theory applied to the acquired spectro-

scopic data are discussed. The effectiveness of this technique is

evaluated by performing NH3and CO2concentration measure-

ments and utilizing it to monitor varying ammonia and carbon

dioxide levels in a bioreactor for water reprocessing, located at

the NASA–Johnson Space Center. Results indicate a sensitiv-

ity enhancement of six times, in terms of improved minimum

detectable absorption by the gas sensor.

PACS 42.68.Ca; 42.62.Fi; 95.75.-z

1Introduction

The primary focus of this work is the development

of an adaptive filtering technique, known as Kalman filtering,

to the sensitive, selective and real-time detection of NH3and

CO2usingatunablediode-laser-based tracegassensor[1–3].

The motivation for the application of this technique is the

fact that these trace gas sensors have inherent laser, electri-

calandopticalnoiseassociatedwiththemthatmanifestsitself

as short-term variations in gas concentration measurements.

Examplesofthesereal-timenoisesourcesincludethermalex-

pansionorcontractionofopticalcomponents,laserfrequency

drift and etalons. These fluctuations in concentration occur

with every measurement, compared to true gas concentration

variations thatresultfromchanges inthesampleenvironment

which evolve over the course of a series of measurements

as reported in Sect. 4. This noise defines the minimum de-

tection limit of the gas sensor, which can be characterized

by calculating an Allan variance for the specific optical sen-

sor configuration [4]. The Allan variance defines the optimal

✉ Fax: +1-713/348-5686, E-mail: leleux@rice.edu

averagingtimeforthegasanalyzer,whichminimizestheshot-

to-shot variability of concentration measurements. Once this

averaging time has been optimized, further detection sensi-

tivity improvements can be achieved through the use of the

Kalman filtering technique[5].

While numerous filtering techniques can be applied to

post-processing of gas concentration measurements, only

afewsuccessfultechniqueshavebeenidentifiedthatallowef-

ficient on-line filtering of concentration measurements. One

direct technique, which can be applied in real time, is simple

averaging of the previous n measurements. The advantages

of the Kalman filtering technique over simple averaging are

three-fold:

– theKalmanfilterincorporatesallavailablemeasurements,

regardless of their precision, and is not limited to a nar-

row window of n measurements to estimate the actual gas

concentration;

– the Kalman filter (although the equations are more com-

plex than an averaging technique) is computationally effi-

cient because it is recursive and only requires two sets of

information instead of n to be transferred from measure-

mentto measurementforfilter calculations; and

– the Kalman filter is adaptive and can adjust to changes in

signalstatistics anddynamic rangeduringoperation.

AcomparisonbetweenaKalmanfiltersolutionandamov-

ing average technique is presented in Sect. 4.3. A Kalman fil-

tercombinesallavailablemeasurementdata,pluspriorknow-

ledge about the system and measuring devices, to produce an

estimate of theactual concentration suchthattheerroris min-

imized statistically.Theuseofthisalgorithmenablesthefilter

to solve the Gauss’ least-squares technique in real time with

little or nodelay in processingtime.

The filtering algorithm was first developed in 1960 by

Kalman [5] and applied to aerospace navigation problems.

In 1993, Werle et al. employed adaptive filtering techniques

to tunable diode-laser absorption spectroscopy (TDLAS) in

the infrared molecular “fingerprint”region [6]. Subsequently,

Kalmanfilteringappliedtotunablediode-laser-basedgassen-

sors was studied by Riris et al. in 1994 [7] and 1996 [8]. This

paper describes the effective approach of applying Kalman

filtering to real-time trace gas concentration measurements

using diode-laser overtonespectroscopy.

Page 2

86Applied Physics B – Lasers and Optics

InSect. 2,thetheoretical considerationsofaKalmanfilter

willbedescribed.Sect.3willexplainsensorconfigurationand

discussdata acquisition and processing. In Sect. 4, the results

of the experiments will be analyzed and a comparison will be

made between the Kalman filter and a moving average tech-

nique.The resultswill besummarized in Sect. 5.

2

2.1

Theoretical considerations

Kalman filter model for trace gas concentration

measurements

In this section, we report on the application of

Kalmanfilteringtoaddresstheproblemofdetermininganop-

timal estimate of the true gas concentration, xk, of a sample

gas with a near-infrared diode-laser-based sensor in the pres-

ence of two sources of uncertainty (measurement noise in-

troduced by the sensor, vk, and true concentration variability,

wk). This scalar optimal estimation problem can be modeled

bythelinear stochastic differenceequation [9,10]:

xk+1= xk+wk,

withmeasurements fromthetracegassensor, zk,modeled as

(1)

zk= xk+νk,

where the expected value, E[wk] = E[vk] = 0, and wkand vk

are uncorrelated random variables with white noise variance

of σ2

valid for trace gas concentration measurements [9], since the

noise variances are not correlated in time, i.e. knowing the

noise variance at time x does not aid in predicting what its

valuewillbeatanyothertime.Thevarianceσ2

true concentration variability while σ2

urementnoiseintroduced by thesensor.

ˆ x−

for a step k, with knowledge of the gas concentration prior to

step k,and ˆ xkto be thea posterioriconcentration estimate for

step k after the measurement value zkis incorporated. Note

that a hat above a variable such as ˆ xkindicates an estimated

or predicted quantity, and a superscript negative sign above

avariable such as ˆ x−

orianda posterioriestimate errorscan bedefinedas:

(2)

wand σ2

v, respectively. The assumption of “whiteness” is

wrepresentsthe

vrepresents the meas-

kcanbedefinedtobetheaprioriconcentration estimate

kindicates an a prioriquantity. Thea pri-

e−

k≡ xk− ˆ x−

and

k,

(3)

ek≡ xk− ˆ xk.

The a priori estimate error variance is then given by the ex-

pected value

(4)

P−

k= E?e−

and the a posteriori estimate error variance is given by the

expected value

ke−

k

?,

(5)

Pk= E [ekek] .

InderivingtheKalman filterequations,theobjectiveistofind

an equation that computes an a posteriori concentration es-

timate ˆ xkas a linear combination of an a priori estimate ˆ x−

(6)

k

and a weighted difference between an actual concentration

measurement zkand a measurement prediction ˆ x−

below:

kas shown

ˆ xk= ˆ x−

The difference (zk− ˆ x−

residual. The residual reflects the discrepancy between the

predicted measurement ˆ x−

A residual of zero means that the predicted and actual meas-

urements are in complete agreement. The value of Kk in

(7) is called the Kalman gain and is chosen to minimize

the a posteriori error variance from (6). This minimiza-

tion procedure can be accomplished by substituting (7) into

(4), which defines ek. Next, this result is substituted in (6),

followed by performing the indicated expectations, taking

the derivative of the result with respect to Kk, and set-

ting this value equal to zero. Solving for Kk yields the

definition of the Kalman gain, which minimizes (6), given

by:

k+ Kk

?zk− ˆ x−

k

?.

(7)

k) in (7) is called the measurement

kand the actual measurement zk.

Kk= P−

k

?P−

k+σ2

v

?−1=

P−

k

k+σ2

?P−

v

? .

(8)

From (8), it can be seen that the gain Kkweights the residual

(zk− ˆ x−

approaches zero. In practical terms, this can be interpreted as

a sensor that is reliable and provides measurements with low

variability. Specifically, from(8),

k) more in (7) as the measurement error variance σ2

v

lim

σ2

v→0Kk= 1.

However,asthemeasurement errorvariance σ2

gain Kkweights the residual (zk− ˆ x−

tical terms, this can be interpreted as a sensor that provides

measurements with significant variability. In the limit, as σ2

approaches infinity, from(8),

vincreases,the

k) less. Again, in prac-

v

lim

σ2

v→∞Kk= 0.

Another way of interpreting the weighting by Kk is that

as the measurement error variance σ2

actual measurement zk is “trusted” more because the sen-

sor becomes more reliable and the predicted measurement

ˆ x−

ance σ2

because the sensor is considered less reliable in terms of

variability, while the predicted measurement ˆ x−

more.

By substituting (8) into (7) and using (3) through (6) to

solve for Pk, the solution provides the a posteriori estimate

error varianceas:

vapproaches zero, the

kis trusted less. However, as the measurement error vari-

vincreases, the actual measurement zkis trusted less

kis trusted

Pk= (1− Kk) P−

With (8) and (9), the complete a posteriori estimate and error

variance are defined as a function of the weighting factor Kk

that is conditioned based on both the previous uncertainty of

theestimate and theuncertainty ofthemeasuring device.

k.

(9)

Page 3

LELEUXet al. Applications of Kalman filtering to real-time trace gas concentration measurements87

2.2

The Kalman filteralgorithm

The Kalman filter estimates the gas concentration

by using a form of feedback control. The filter estimates the

concentrationatsomegiventimeandthenobtainsfeedbackin

the form of measurements possessing a noise component. As

such,theKalmanfilterequationsfallintotwogroups:timeup-

date equations and measurement update equations. The time

update equations are responsible for projecting forward in

timecurrentconcentration and error varianceestimates to ob-

tainaprioriestimatesforthenexttimestep.Table 1showsthe

equationsused inthetime updateportion ofthealgorithm.

If the gas concentration is determined by a process that

can be modeled directly or inferred (e.g. from temperature),

this information can be used to obtain a better predictive ca-

pability instead of assuming that the next concentration will

be equal to the previous concentration plus some noise, as in

(1). If a control input can be modeled by a variable, uk(e.g.

thegasconcentrationisdeterminedbythetemperatureinare-

action chamber at a chemical processing plant), then the time

update (10) can be modified to include this information, as

shownin (12).

Themeasurementupdateequationsareresponsibleforthe

feedback, i.e. for incorporating a new measurement into the

a priori concentration estimate to obtain an improved a pos-

terioriestimate, and aregivenin Table 2.

The time update equations act then as predictor equa-

tions, while the measurement update equations act as correc-

tor equations. The final estimation algorithm is a predictor–

corrector algorithm for solving the least-squares method in

realtimeas shownin Fig. 1.

The first step in the sequence involves selecting initial

a priori values for the concentration estimate, ˆ x−

error variance, P−

critical, since the filter will converge to an appropriate value.

However, they should be chosen to be within the dynamic

range of the expected gas concentrations and errors to speed

convergence. The next step involves taking a measurement

update from the sensor by first computing the Kalman gain,

Kk, using (13). Subsequently, the sensor performs a concen-

trationmeasurementtoobtainzk.Thisisfollowedbycalculat-

ing an a posteriori concentration estimate using (14), and the

final step is to obtain an a posteriori error variance estimate

from(15).

Once a posteriori estimates of the concentration and vari-

ance are obtained, a time update is processed using (10) and

(11), or (10) and (12) if a control input is modeled. This step

k, and the

k. The selection of these quantities is not

ˆ x−

P−

ˆ x−

TABLE 1

k+1= ˆ xk

k+1= Pk+σ2

k+1= ˆ xk+uk

(10)

(11)

(12)

w

Kalman filter time update equations

Kk= P−

ˆ xk= ˆ x−

Pk= (1−Kk)P−

TABLE 2

k(P−

k+Kk(zk− ˆ x−

k+σ2

v)−1

(13)

(14)

(15)

k)

k

Kalman filter measurement update equations

FIGURE 1

rent concentration estimate ahead in time. The measurement update adjusts

the projected concentration estimate by an actual measurement at that time.

Note: σ2

ware constants

Complete Kalman filter cycle. The time update projects the cur-

vand σ2

projects the concentration and variance estimates from time

step k to stepk+1.

After each time and measurement update pair, the pro-

cess is repeated with the previous a posteriori estimates used

to project or predict the new a priori estimates. This recur-

sive nature is one of the appealing features of the Kalman

filter, because it recursively conditions the current concentra-

tion estimate on all of the past measurements. Furthermore,

the selection of σ2

tuning the Kalman filter to provide the optimum sensor per-

formance, asdiscussedin Sect. 4.

wand σ2

vis one of the central features in

3

3.1

Experimental details

Diode-laser-based gas sensor

The diode-laser-based sensor shown in Fig. 2 for

gas detection and quantification using vibrational overtone

spectroscopy at 1.53µm was used to investigate the Kalman

FIGURE 2

NH3and CO2concentration measurements at 1.53 µm

Diode-laser-based trace gas sensor configuration for continuous

Page 4

88 Applied Physics B – Lasers and Optics

Linestrength Frequency

cm−1

Wavelength

nm

Ref.

cm−1/(molecule/cm2) cm−2atm−1(@ 296 K)

A

B

C

2.33×10−21

1.24×10−21

5.19×10−25

0.0578

0.0307

1.29×10−5

6528.76

6528.89

6528.895

1531.68

1531.65

1532.65

[11]

[11]

[12]

TABLE 3

sorption lines used in this work

NH3and CO2overtone ab-

filtering technique. This sensor has been described in detail

previously [1–3]. An ammonia (or any other gas) concentra-

tion measurement for narrow-linewidth radiation sources is

obtainedbyusingtheBeer–Lambertabsorptionlaw,whichre-

latestheintensityoflightenteringintoanabsorptionmedium,

I0,to thetransmitted intensity, I, asfollows:

I

I0

whereSνisthetemperature-dependentabsorptionlinestrength

for a specific transition denoted by ν[cm−2atm−1], φνis the

line shape function (cm), χjis the fractional concentration of

the species j, P is pressure (atm), and l is the optical path

length throughthemedium(cm).

Table 3 depicts the three NH3and CO2absorption lines

thatareusedinthiswork.LinesAandBarethetwoammonia

lines used: A is an isolated line useful for measuring ammo-

nia concentrations while line B overlaps with line C, which

isthe(00001)← (30011), R(36),overtonetransition ofCO2.

These three lines are accessible using a 1.53µm telecommu-

nications diode-laser.

The sensor consists of three main components: a single-

frequency, fiber pig-tailed, tunable, distributed feedback

(DFB) diode-laser (NTT-NEL Electronics), a multi-pass ab-

sorption cell and a dual-beam auto-balanced InGaAsdetector

(Nirvana 2017, New Focus, Inc). The laser diode is driven

by a compact current supply (MPL-250, Wavelength Elec-

tronics) with ripple noise < 1 µA, so that the frequency fluc-

tuations of the laser line due to current noise are negligible

(< 1 MHz). The current supply is scanned at 20Hz about an

averagecurrentof67mAwithasaw-toothrampfunction.The

laser temperature was controlled to within 0.003◦C, close to

32◦C,byacurrentmodule(HTC-1500,WavelengthElectron-

ics). The scan range of the laser under these conditions was

0.3cm−1, which allowed all the spectral lines of interest to be

accessedon everyscan.

The fiber-pigtailed DFB laser diode delivers 15mW at

1531.7nm with a specified linewidth of < 10MHz. The fiber

was fusion-spliced to a 70/30% directional coupler with an

insertion loss of less than 2%. The 70% power arm of the di-

rectional coupler was sent to the multi-pass cell, using a lens

( f = 7mm, 0.5NA) mounted in a precision holder with 5

degrees of freedom (Optics For Research) to set the beam

waist at the midpoint of the multi-pass cell. The 30% power

arm was used as the reference beam for the balancing detec-

tor. Such an integrated laser and optical fiber configuration

delivers 10mW of laser light at the input of the multi-pass

cell. The output power of the beam obtained from the cell

after 182 passes was 200µW, resulting in a throughput ef-

ficiency of 2.0% (a factor of 10 better than for the cell de-

scribed in [1]). The output beam from the cell is focused on

the signal and reference photodiodes of the dual beam de-

tector by a gold-coated, parabolic mirror of 2.54cm diam-

= exp?−SνφνPχjl?

(16)

eter ( f-number= 2)and alens ( f = 7mm, 0.5NA)mounted

on a precision holder, respectively. Since the reference beam

power (Pref) was much greater than the power of the sig-

nal beam coming from the cell (Psignal), it was attenuated

using a variable fiber attenuator. For optimum performance

of the auto-balanced detector, the reference power was set as

Pref= 2.2× Psignal, at the center frequency of the laser scan.

This in turn reduces the attenuation level required at the ref-

erence input of the detector to ∼ 3dB, a range where the

operation ofthefiberattenuator isreliableandfreeoffringing

effects.

All elements, except the input and output of the multi-

pass cell, are coupled to optical fibers in order to make the

system suitable for field applications. A two-stage, micro-

mechanical diaphragm pump mounted next to the multi-pass

cell provides a continuous flow of sample gas at a rate that

is controlled by two needle valves at the input and output

of the multi-pass cell, which has a volume of 0.3liters. For

these experiments, an optimal flow rate of about 100sccm

allows for a fast response of the instrument to true con-

centration changes, while keeping the concentration rates

of the gas sample stable. The multi-pass cell was heated to

a temperature of 40◦C to minimize ammonia adsorption on

its glass walls. All the measurements presented here were

obtained with the sample gas inside the multi-pass cell at

a fixed pressure of 100Torr. For the measurements, a cylin-

der containing certified 99.99% pure CO2(Scott Specialty

Gases, Inc.) was connected in parallel with an ammonia gas-

dilution system [1]. The ammonia sample was obtained by

diluting a certified, 100ppm NH3 mixture in N2 (Mathe-

son), with a pure N2 sample. The fraction of NH3 intro-

duced in the mixture was controlled to within ±0.2ppm

by using a mass flow controller [MKS Instruments, Inc.],

whereas the CO2 concentration was regulated to within

±1000ppm by adjusting the outlet pressure of the cylinder

regulator.

Other modifications were introduced in order to improve

the operation of the instrument that was reported in [1–3]:

A pure ammonia cell (1 Torr) was used for real-time fre-

quency calibration. This cell was attached to a motorized

translational stage (New Focus, Model No. 8892) that inserts

the reference cell periodically into the optical path of the sig-

nal beam. This is accomplished using a software-generated

TTLpulsefromthedataacquisition routine.Toautomatically

account for operational fluctuations in the gas handling sys-

tem, pressure and temperature are measured in real time and

their values are updated in the data analysis routine for each

concentration measurement. By implementing these modifi-

cations, the system is now a stand-alone instrument that can

be used for on-line remote operation over extended periods

of time, monitoring the concentration of trace gases such as

NH3 and CO2. This is particularly useful for demonstrat-

ing the capabilities of the Kalman filtering technique, which

Page 5

LELEUXet al. Applications of Kalman filtering to real-time trace gas concentration measurements 89

provides an optimal estimate of the true gas concentration

continuously.

3.2

Data processing: acquisition and analysis

A laptop PC running LabView 5.0 software was

usedfordataacquisitionandprocessing.Withthephotodetec-

tor operating in auto-balance mode, 500 spectral scans were

averaged for each single concentration measurement. The

total data collection time, averaging and processing to obtain

a single concentration measurement was less than 30s. For

convenience,thesensorwasconfiguredtotakemeasurements

every minute in order to correlate ammonia measurements to

external daily events. The capability to remotely monitor the

sensor performance and concentration data was implemented

byusing“PCAnywhere”software.

Thereal-time fitting routine implemented in LabView has

been reported elsewhere [13], and only minor software mod-

ifications were required for this work. Initially a direct trans-

mission spectrum from the logarithmic output of the Nirvana

detector,operatinginauto-balancemode,isobtainedanda3rd

order polynomial is fitted to the baseline of the absorption

scan. If a voltage, V∗(ν), is assigned to the baseline values,

and the logarithmic signal values are assigned a voltage V(ν),

then the corresponding optical transmission for the given fre-

quencyvalue, T(ν),in percent, is givenby [14]:

T(ν) = 100e−A

TV∗(ν)+1

e−A

TV(ν)+1

(17)

where T is the temperature of the photodetector (taken to be

300K), and A is a constant determined by the gain in the

amplifier circuit of the detector (A = 273K/V). This proced-

ure provides a balanced transmission spectrum and simultan-

eously corrects for the baseline of the absorption signal. To

thisspectrum(afterdividingby100andtakingthenaturallog-

arithm), an absorption line-shape function is fitted to obtain

thegas concentration as described below. Theconvenience of

this procedure is that only one detection channel is needed in

this configuration to accountfor both thesignal and reference

outputsin thephoto-detector.

The fit employs a non-linear, least-squares Levenberg–

Marquardtalgorithm and uses a given absorption profileto fit

thedata.Sincethepressureregimeofoperation(100 Torr)lies

between the predominantly Doppler and pressure-broadened

regimes, a triple Voigt profile with fixed pressure broadening

and Doppler width was used. Typical absorption spectra ob-

tained were fitted to a third-order polynomial and three Voigt

profiles [15,16], with a linewidth of 0.027cm−1and a pres-

sure broadening contribution of 0.020cm−1. Small pressure

fluctuations in thesystemof±1Torrareaccounted forin real

time by the data collection software. Therefore, the linewidth

of the ammonia and carbon dioxide absorption peaks was ex-

pected to fluctuate by less than ±0.001cm−1[17–19]. This

introduces an error for the ammonia and carbon dioxide con-

centration measurements in the fitting routine of 2%. The

residual of the Voigt fit in typical 2.8ppm NH3spectra (peak

absorption of 0.14%) yields an uncertainty level for a single

measurement (with 500 averages) of ±0.01% – absorption

– (note that 100×ln(I/I0) is equivalent to % absorption for

small absorptions). The rms uncertainty level is then 0.014%

absorption and a peak absorption and corresponds to 2.8ppm

of NH3. This is the minimum concentration that can be meas-

ured reliably with the reported gassensor design, withoutany

further datafiltering. Opticalfringesfrominterference effects

introduced by the multi-pass cell limit the sensitivity and are

the primary source of uncertainty in the ammonia and carbon

dioxide concentration values reported.

4

4.1

Experimental results and discussion

Kalman filter parameters and tuning

The development of a Kalman filter for real-time

measurements that may vary by an order of magnitude re-

quires the selection of appropriate values for σ2

centration variability) and σ2

by the sensor). Both of these variances represent the concen-

tration variability from one measurement to the next. For in-

stance, σ2

be expected to vary from one measurement to the next, and

σ2

introduceinto themeasured concentration fromonemeasure-

ment tothenext.

The σ2

sor at a constant gas concentration to determine the variance

of the measured concentrations. This value may then be used

as a constant in a real-time filter operation. However, such

a calculation is not valid over all dynamic ranges, since the

concentration variability changes in direct proportion to the

concentration range. This is shown in Fig. 3, where the vari-

w(true con-

v(measurement noise introduced

wrepresents how much the true concentration would

vrepresents how much noise the sensor may be expected to

v, value may be measured while operating the sen-

a

b

FIGURE 3

ments for a16-hperiod. Kalman filter results are indicated by athick bold line

while raw data measurements appear as thin lines depicting system noise

Simultaneous NH3 (a) and CO2 (b) concentration measure-

Page 6

90Applied Physics B – Lasers and Optics

ability of the ammonia is 0.1ppm for values of ∼ 4ppm, but

the variability of the carbon dioxide is about 158ppm for

valuesof∼ 2000ppm.Underanygivenexperimentalcircum-

stances, once the measurement system has reached equilib-

rium,then:

lim

t→∞

σ2

σ2

v

w

= ?,

(18)

where t is the time the system has been operating and ? is

a constant. Therefore, if the true concentration changes by

orders of magnitude, the variance will also change by orders

ofmagnitude. Themeasurementuncertainty may alsochange

as a result of different operating conditions resulting from

temperatureorhumidityvariationsaswellasagingofthesen-

sor. These effects can be particularly obvious in the case of

field experiments where controlling the environmental con-

ditions for the sensor is difficult. Recalculation of the vari-

ance of a set of measurements periodically during the oper-

ation of the sensor and using that variance to recalculate the

valuesofσ2

valuesforfilteroperationcanmitigatetheeffectoflargerange

changes.

Sincevariability scalesroughlylinearly astrueconcentra-

tionchanges,thisobservationcanbeusedtodevelopascheme

for automating the selection of σ2

volvesfirstapplyingasmallwindow(e.g.theprevious10raw

measurements) to calculate the sample concentration vari-

ance. This value is then used as the choice for σ2

the measurement variability (σ2

centration changes (σ2

musthold trueaccording to (18):

vandσ2

wwhilesubsequentlyusingtherecalculated

vand σ2

w. This method in-

v. Since

v) scales linearly as true con-

w), the following steady-state condition

σ2

σ2

v

w

= ?,

(19)

where ? is a constant. σ2

ingσ2

to control how rapidly the filter will respond to measurement

changes in calculating the Kalman filter output. The larger

the ratio, the longer it will take for radical changes in meas-

ured concentrations to be incorporated into the filter output.

The smaller the ratio, the more susceptible the filter will be

to accept large changes in measured concentrations. In other

words, the higher frequency components will have less af-

fect on the filter output as ? is increased. This method was

used for filter calculations reported in this work. The selec-

tion of a value for ? was made empirically as described in

Sect. 4.2. The use of the variance ratio technique allows for

a completely automated selection process for σ2

sumingaconstantvaluefor?.Notethatthevalueof?depends

on the specific circumstances of the concentration measure-

ment, which includes both the sensor and the system that is

beingmeasured.Therefore?isnotanintrinsicpropertyofthe

gassensor.

wcan then be calculated by divid-

vby?.Thevalue?canthenbeusedasatuningparameter

vand σ2

was-

4.2

Kalman filter resultsand sensor performance

The Kalman filter using the variance ratio tech-

niquewasapplied during theoperation of thetrace gas sensor

for a period of approximately 16h. For this period, 1000 sim-

ultaneous concentration measurements of NH3and CO2were

acquired. The results of such a test are shown in Fig. 3. Am-

moniaandcarbondioxideconcentrationsareshowninFig.3a

and 3b, respectively. A thin line indicates raw data meas-

urements, while Kalman filter calculations are designated by

thick lines. As expected, the raw data is significantly nois-

ier than the filtered data. The detection sensitivity for the

NH3was 0.12ppm without Kalman filtering. After applying

Kalmanfiltering,thedatavariabilitywasreducedtoaconcen-

tration uncertainty of 0.02ppm. By dividing the uncertainty

before the Kalman filter was applied by the uncertainty after

employing the Kalman filter, a detection sensitivity improve-

ment by a factor of six was indicated. Detection sensitivity

improvementisequaltotheratioofthemeasurementstandard

deviation(σ)withoutaKalmanfiltertothemeasurementstan-

a

b

c

FIGURE 4

lection run indicating good filter performance for a factor of 4 change in the

CO2dynamic range (a and b); a typical 1-h zoom-in of the NH3concentra-

tion data with ? set to 50 is depicted in c

NH3and CO2concentration measurements for a 39-h data col-

Page 7

LELEUXet al. Applications of Kalman filtering to real-time trace gas concentration measurements91

darddeviationwithaKalmanfilter.Animprovementbyafac-

tor of two was observed for CO2measurements. The Kalman

filter output clearly follows true concentration changes mod-

eled in terms of σ2

sensornoiseandmodeled byσ2

Inafurtherevaluationtest,theperformanceoftheKalman

filter was investigated over a significant dynamic range by

allowing the CO2 concentration to change by a factor of

4, from 8000ppm to 2000ppm. The NH3 concentration

was held constant at 4 ppm. This test was allowed to run

for approximately 39h. During this time, 2500 concentra-

tion measurements were obtained. The result of this experi-

ment is shown in Fig. 4. As in the previous test, ammonia

and carbon dioxide concentrations are shown in Fig. 4a

and 4b. The detection sensitivity for the NH3measurement

was 0.12ppm without the Kalman filtering. After apply-

ing the Kalman filtering, the data variability was reduced

to a concentration uncertainty of 0.02ppm. This indicates

a detection sensitivity improvement by a factor of six. Sim-

ilarly, an improvement by a factor of 2.5 was observed for

CO2 measurements. Again, the Kalman filter output fol-

lowed true concentration changes over a large dynamic range

and the variability caused by sensor noise is minimized. As

previously, a value of 50was used for ?. Figure 4c, a 1-h

zoom-in on Fig. 4a data, clearly illustrates the effective-

ness of applying the Kalman filter to improve the detection

sensitivity.

A subsequent experiment involved performing several

data collection runs for different values of ? in order to as-

certain the effects of varying this parameter. A result of this

experiment, shown in Fig. 5, indicates that as ? increases, the

filter solution lags behind thetrueconcentration changes. A ?

valueof250wasusedinFig. 5.Thiseffectisoneofthelimita-

tionsofthevarianceratiotechnique.If?ismadetoolarge,the

filter solution will lag behind true changes in concentration.

As?isincreased, thiseffect becomesmorepronounced. Data

collection wasperformedusingfivevaluesfor?including50,

100, 150, 200, and 250. The best overall sensor performance

was observed with a value of 50, although reasonable filter

performancewasobservedwithall ofthesevalues.

AfieldtestofthesensorwasperformedattheNASAJohn-

son Space Center in Houston, TX as described in [1–3]. The

measurement involved the monitoring of a packed-bed bio-

logical water processor (BWP) that is part of a NASA water

recovery system (WRS). This system produces potable wa-

ter from waste water using aerobic and anaerobic microbial

processes. Two of the byproducts of the chemical reaction in

the bioreactor are ammonia and carbon dioxide. During one

datacollectionrun,theKalmanfilterwasoperatedinrealtime

as data was being collected. Figure 6 shows an excerpt of the

CO2data collected together with the corresponding Kalman

filterresults processedafter therun.

In a subsequent laboratory and field test on the same

BWP system described above, a pulsed, thermoelectrically

cooled, single-frequency quantum cascade laser was used

to access two NH3absorption lines of the fundamental ν2

band at 10microns [20]. Comparable results to the over-

tone data were obtained by measuring changes in ammo-

nia concentration over a 15-h time period. The NH3 con-

centration was varied from 10ppm to 40ppm. The detec-

wwhile ignoring the variability caused by

v.Avalueof50wasusedfor?.

a

b

FIGURE 5

time series with ? set to 250, indicating a filter delay in accepting large

changes to the measured data

NH3(a) and CO2(b) concentration measurements for a 9-h

FIGURE 6

from a biological water processor located at the NASA Johnson Space

Center, Houston, TX. The Kalman filter data depicted was applied to the

concentration measurements after its acquisition

CO2 concentration measurements and Kalman filter results

tion sensitivity was 0.3ppm without Kalman filtering and

improved the precision to 0.04ppm after applying Kalman

filtering to the NH3concentration data. This indicates an en-

hancement of the minimum detection sensitivity by a factor

of 7.5.

4.3

Comparison of Kalman filterresults to a moving

average

As discussed in the introduction, there are a num-

ber of advantages of the Kalman filter over the moving

average technique. Using the raw CO2measurement data in

Page 8

92Applied Physics B – Lasers and Optics

a

b

c

FIGURE 7

tween a Kalman filter solution and two moving average solutions. Inset

a shows a Kalman filter solution versus a 10-point moving average while

inset b displays the same Kalman filter solution against a 20-point moving

average. The final inset c displays the raw data used in both the Kalman filter

as well as the moving average solutions

Time series of CO2measurements showing a comparison be-

Fig. 7c, a Kalman filter solution was calculated as well as

a 10- and 20-point moving average. These results are shown

in Figs. 7a and 7b respectively. The results show similar be-

havior between the Kalman filter and the moving average;

however, the advantages of the Kalman filter show up in two

keyways.

The first place the Kalman filter shows superiority to

the moving average is when abnormally large spikes are

generated by the sensor. For instance at 3/3/01 5 : 52 in

Fig. 7c, a spike of 5500ppm was generated. Observing sur-

rounding data, a “real” concentration of 5500ppm seems

highly unlikely. The Kalman filter is conditioned on all pre-

vious data, so it is unaffected by this spike. The moving

average technique, however, is significantly impacted by the

spike and takes several measurements before it returns to

normal.

One way of dealing with these spikes is to increase the

number of points in the moving average. The 20-point mov-

ing average shows a diminished impact of the spike; how-

ever, its overall performance is degraded. If the number of

points in the moving average window is made too large, a

“lagging” effect will be observed causing key features to be

missed, e.g. at 3/3/01 0 : 39. This feature is similar to the

behavior of an un-tuned Kalman filter. However, once ? is

optimized, both of the problems identified above are solved,

as described in Sect. 4.1. This is one of the key advantages

of the Kalman filter, which is its adaptivity to changing data

statistics.

5 Conclusions and outlook

In summary, an automated trace gas sensor that re-

quired no operator intervention during data collection was

demonstrated. The use of a Kalman filter significantly im-

proved the detection sensitivity of the diode-laser-based gas

sensor by a factor of two to six when using 1.5µm overtone

absorption lines and by a factor of 7.5 when performing

ammonia concentration measurements at 10µm with funda-

mental absorption lines, by determining on-line an optimum

estimate of the true concentration to reduce the variability.

Both thetheory andimplementation ofapracticalKalman fil-

ter were discussed and limitations of certain aspects of this

technique were analyzed. The operation of the Kalman filter

with two different dynamic ranges corresponding to the two

gases used was successfully demonstrated. Detection sensi-

tivity factor improvements of six and two were observed at

concentration levels of 4 and 1500ppm for NH3and CO2,

respectively.

Potential applications of the Kalman filter technique in-

clude its usein environmental, medical and industrialprocess

control. For example, identification and modeling of gas con-

centrations in chemical manufacturing processeswillprovide

measurable indicators or indirect control of the gas concen-

trations. This could be modeled in terms of a control input

ukas discussed in Sect. 2.2. This modeling can improve the

predictive capability and accuracy of the filter. This modeling

was not included in the experiments presented in this paper,

since no measurable indicators were available for improving

thepredictive capability of thefilter.

One limitation of the Kalman filtering technique as pre-

sented in this work is the fact that it must operate on concen-

tration values after a data processing algorithm has reduced

them. A potentially more accurate method would be to oper-

ate the filter directly on the absorption profile output of the

detector prior to the non-linear least-squares fitting routine as

discussed in [1]. Significant variations in absorption profiles

often cause problems with applied non-linear least-squares

routines even after averaging, which can add additional noise

to the sensor output above the hardware noise due to white

noisevarianceof σ2

v.

ACKNOWLEDGEMENTS Funding for this project was pro-

vided by the National Aeronautics and Space Administration (NASA), the

Institute for Space Systems Operations (ISSO), the Texas Advanced Technol-

ogy Program, and the Welch Foundation. D. Leleux would like to acknowl-

edge support by the NASA-JSC Graduate Student Researcher’s Program

(GSRP).

Page 9

LELEUX et al. Applications of Kalman filtering to real-time trace gas concentration measurements93

REFERENCES

1 R. Claps, F.V. Englich, D. Leleux, D. Richter, F.K. Tittel, R.F. Curl:

Appl. Opt. 40, 4387 (2001)

2 M.E. Webber, R. Claps, F.V. Englich, F.K. Tittel, J.B. Jeffries, R.K. Han-

son: Appl. Opt. 40, 4395 (2001)

3 R. Claps, D. Leleux, F.V. Englich, F.K. Tittel, M.E. Webber, J. Jeffries,

R.K. Hanson, J.C. Graf, L.M. Vega: Infrared overtone spectroscopy

measurements ofammonia and carbon dioxide in the effluent ofa biolog-

ical water processor. In: Proc. 31st Int. Conf. on Environmental Systems

(ICES), Society of Automotive Engineers, Inc., Orlando, FL July 9–12,

2001

4 P. Werle, R. Mücke, F. Slemr: Appl. Phys. B 57, 131 (1993)

5 R.E. Kalman: Trans. ASME, J. Basic Eng. 82, 35 (1960)

6 P. Werle, B. Scheumann, J. Schandl: Optical Engineering 33, 3093

(1993)

7 H. Riris, C.B. Carlisle, R.E. Warren: Appl. Opt. 33, 5506 (1994)

8 H. Riris, C.B. Carlisle, R.E. Warren, D.E. Cooper, R.U. Martinelli,

R.J. Menna, P.K. York, D.Z. Garbuzov, H. Lee, J.H. Abeles, N. Morris,

J.C. Connolly, S.Y. Narayan: Spectrochimica Acta A 52, 843 (1996)

9 C.W. Helstrom: Probability and Stochastic Processes for Engineers, 2nd

edn. (Macmillan, New York 1991)

10 P. Maybeck: Stochastic Models, Estimation, and Control, Vol. 1 (Aca-

demic Press, New York 1979)

11 M.E. Webber, D.S. Baer, R. Hanson: Appl. Opt. 40, 2031 (2001)

12 L.S. Rothmann, C.P. Rinsland, A. Goldman, S.T. Massie, D.P. Edwards,

J.Y. Mandin, J. Schroeder, A. McCann, R.R. Gamache, R.B. Wattsin,

K. Yoshino, K.V. Chance, K.W. Juck, L.R. Brown, V. Nemtchechin,

P. Varanasi: J. Quant Spectrosc. Radiat. Transfer 60, 665 (1998)

13 D.G. Lancaster, D. Richter, R.F. Curl, F.K. Tittel: Appl. Phys. B 67, 339

(1998)

14 K.L. Haller, P.C.D. Hobbs: Proc. SPIE 1435, 298 (1991)

15 E.E. Whiting: J. Quant. Spectrosc. Radiat. Transfer, 8, 1379 (1968)

16 D.J. Brassington: Tunable diode laser absorption spectroscopy for the

measurement of atmospheric species. In: Spectroscopy in Environmen-

tal Science, ed. by R.J.H. Clark, R.E. Hester (Wiley, New York 1995)

pp. 85–147

17 G. Modugno, C. Corsi: Infrared Phys. Technol. 40, 93 (1999)

18 L. Lundsberg-Nielsen, F. Hegelund, F.M. Nicolaisen: J. Molec. Spec-

trosc. 162, 230 (1993)

19 C.H. Townes, A.L. Schawlow: Microwave Spectroscopy (McGraw-Hill,

New York 1955) p. 364, Table 13.4

20 A. Kosterev, R.F. Curl, F.K. Tittel, R. Köhler, C. Gmachl, F. Capasso,

D. Sivco, A. Cho: Appl. Opt., to appear January 20, 2002