Fast Exponential Fitting Algorithm For Real-Time Instrumental Use
Fast Exponential Fitting Algorithm For Real-Time Instrumental Use
Daniel Halmer, Golo von Basum, Peter Hering, and Manfred Mürtz
Efficient Exponential Fitting Algorithm with Two Fitting Parameters for Oscillation Problems
AIP Conf. Proc. 1389, 1594 (2011); 10.1063/1.3637936
The Correction in Viscometry When Using Capillary Tubes Which Have TrumpetShaped Openings
J. Rheol. 1, 418 (1930); 10.1122/1.2116332
This article is copyrighted as indicated in the article. Reuse of AIP content is subject to the terms at: http://scitationnew.aip.org/termsconditions. Downloaded to IP:
130.216.129.208 On: Sat, 06 Dec 2014 21:39:07
REVIEW OF SCIENTIFIC INSTRUMENTS VOLUME 75, NUMBER 6 JUNE 2004
I. INTRODUCTION decay time. In this article it will be shown that this deviation
can be easily corrected. The method described in this article
Many processes in chemistry, biology, and physics can introduces a very fast algorithm for exact fitting of exponen-
be described by exponential functions. Determining the time tial decay.
constants and the amplitudes from experimental data is a
common task in many sciences. Several methods for the de-
termination of these values are described and compared in a
review article by Istratov and Vyvenko.1 In the majority of A. Method of successive integration
applications there is enough time to use standard least- The basic principle of this method lies in the fact that
squares fitting procedures such as a nonlinear Levenberg– integration of an exponential function is again an exponential
Marquardt algorithm.2– 4 However, sometimes the signal pro- function and additionally that the original function can be
cessing has to be faster and another fitting routine is needed. found again in integral form. Therefore it is possible to ex-
One example of these measurements is cavity-leak-out spec- press Y (t) with its own integral:
troscopy 共CALOS兲, a continuous wave 共cw兲 variation of cav-
ity ring-down spectroscopy,5 which is used in our laboratory.
CALOS is a very sensitive method for the detection of
trace gases in concentrations at the sub-ppb level 共parts per
billion兲, i.e., absorption coefficients in the range of
10⫺9 cm⫺1 . We made measurements of ethane in human
breath with a sensitivity better than 1 ppb using sample bags
earlier.6 – 8 But for online breath analysis a time resolution
better than 1 s is needed. To ensure this we need a signal This leads to a linear two-dimensional equation,
generation rate of about 1– 4 kHz. For each signal a single
exponential fit of the form Y 共 X,t 兲 ⫽A⫹BX⫹Ct, 共1兲
a兲
Corresponding author; electronic mail: muertz@uni-duesseldorf.de This leads to the following equation system:12
FIG. 1. Illustration of the systematic error using trapezoidal integration. FIG. 2. Correction term CT vs .
冉 SY
N
t
SY
SY .SY
t.SY
t
t.SY
t.t
冊冉冊冉 冊 A Y
⫻ B ⫽ Y .SY .
C Y .t
共2兲
there is a way to compensate for this systematic integration
error. This is achieved by
兺 冕t
N
ti
SY ⫽ Y 共 t 兲 dt,
i⫽0 0
Y⫽ 兺 Y 共 ti兲,
i⫽0
共3兲
兺 t i 冕t
N
ti
t.SY ⫽ Y 共 t 兲 dt,
i⫽0 0 This means trapezoidal integration can be corrected if k and
b are known. Often the reciprocal value of k is more inter-
and likewise for all entries.
esting than the value of k itself. ⫽1/k is called the decay
In the case of an equidistant time scale 共with distance 1兲
time and in the following this notation is used. In Fig. 2 we
the sums t and t.t can be evaluated by
can see the correction term 共CT兲 vs which represents the
N 共 N⫹1 兲 N 共 N⫹1 兲共 2N⫹1 兲 number of data points recorded until the signal decays to 1/e.
t⫽ and t.t⫽ . As expected it approximates to 1 as the time resolution ap-
2 6
proaches infinity. For example, a decay signal with a 1/e
So the calculation of the equation system, Eq. 共2兲, consists of time of 3 s which is sampled with 10 MHz has a decay rate
six sums of N addends that can be programmed by a simple of 30.
summation loop.
A. Fitting routine
Originally the method of successive integration was an
II. IMPROVEMENT OF THE INTEGRATION METHOD analytical fitting procedure and it only needed one step with-
out an initial guess for the coefficients. As soon as correction
The fitting procedure mentioned above can only be as 共3兲 is applied for the values of the integral, an initial guess
good as the calculation of integral SY . Matheson pointed out for the coefficients is needed. An iterative approach could be
that the trapezoidal numerical integration, used. This process converges very fast and requires only a
Parameter SI CSI关LV/共C⫹⫹兲兴 LM
TABLE I. Values of the mean value of the residuals , the standard devia-
tion , and Durbin–Watson factor DW for successive integration 共SI and
CSI兲 and Levenberg–Marquardt 共LM兲 fitting algorithms.
This article is copyrighted as indicated in the article. Reuse of AIP content is subject to the terms at: http://scitationnew.aip.org/termsconditions. Downloaded to IP:
130.216.129.208 On: Sat, 06 Dec 2014 21:39:07