An Improved WMS-2f/1f Spectral Fitting Method Using Orthogonal Test in Initial Parameters Selection

This paper proposes an improved wavelength modulation spectroscopy with the 2nd harmonics normalized by the 1st harmonics (WMS-2f/1f) spectral fitting method using the orthogonal test in selection of the initial parameters. The method is implemented and validated experimentally in measurement of the temperature of diluted H2O in air (1 atm, 291K, 0.7%) by the WMS-2f/1f technique. The transition center wavelength targets near 1344 nm. Results demonstrate that the sum-square-error (SSE) between the calculated and measured WMS-2f/1f spectral profiles decreases significantly within given updating times when the optimized initial parameters are used. Compared to the conventional method, the optimized initial parameters can make the fitting routine converge more efficiently. The temperature of the vapor inferred from the proposed spectral fitting method are in good agreement with the true values.


Introduction
The tunable diode laser absorption spectroscopy (TDLAS) has drawn considerable attention in the last few decades. Due its high sensitivity, accuracy and non-intrusive characteristics, it has been applied in various fields [1][2][3][4][5][6][7][8][9][10][11][12][13]. The TDLAS techniques can be categorized into direct absorption spectroscopy (DAS) and wavelength modulation spectroscopy (WMS). The former is relatively straight forward but susceptible to the harsh environment. The latter is complicated in the theory and data process but it can achieve improved noise-rejection ability and sensitivity [14]. In WMS, the laser is scanned by a low-frequency waveform f s and a high-frequency sinusoidal waveform f m simultaneously. Therefore, the absorption information is conveyed to the high frequency harmonics. In order to decouple the absorption information from harmonics, several strategies have been developed [15][16][17][18][19][20][21][22]. Among them, the scanned-WMS-nf/1f fitting method proposed by Sun et al. [19] and developed by Goldenstein et al. [14] is effective for all kinds of situations and avoids the complex analytic expression [16,18], which makes it prevail in the WMS data process. In this scheme, the absorption information is retrieved from harmonics by fitting the simulated WMS-nf/1f spectral profile to the measured one proceeded with the same digital lock-in amplifier. Specifically, the spectral parameters, such as the integrated absorbance area, A, the transition center frequency, v 0 and the lineshape width, ∆ν, are used as the free values in the fitting routine. If the sum-square-errors (SSE) between the simulated WMS-nf/1f profile and the measured one reach to the predetermined value, the outputs of the routine are employed to infer the gas properties. Nevertheless, it may take a long time to obtain the satisfied results when the initial parameters are chosen inappropriately, for the efficiency of the fitting routine is heavily dependent on the values of initial parameters. However, the investigation of the initial parameter optimization in the WMS-nf/1f fitting is rather limited.
The orthogonal test method (OTM) is based on the orthogonal table to analyze the experiment results scientifically [23]. It has been applied widely in optimizing the experimental scheme, which can reduce testing numbers, shorten test time and minimize cost [24][25][26][27][28]. In this study, the WMS-nf/1f fitting performance is dependent on the initial parameters, namely the integrated absorbance area, A, the transition center frequency, and v 0 , the lineshape width, ∆ν, which is similar to the multifactor and multilevel problem in the orthogonal test method. Therefore, it is possible to optimize the initial parameters with the orthogonal test method to enhance the fitting efficiency.
In this paper, the optimization of initial parameters was performed based on the orthogonal test method. The optimized initial parameters were used to match the measured WMS-2f/1f spectral to infer the gas properties, which decreased the SSE between the calculated WMS-2f/1f spectral profile and the measured one within the given updating times and shortened the fitting period, accordingly, enhancing the fitting routine efficiency.

Wavelength Modulation Spectroscopy
The basic principle of WMS has been described in detail in large quantities of other literature [29][30][31][32]. Here, a brief review is presented. All the absorption spectroscopy techniques are governed by the Beer-Lambert law that relates the transmitted and the incident light at frequency, v, as described in Equation (1) where I t,v and I 0,v are transmitted and incident light intensity at frequency, v, respectively. α v is the spectral absorption at frequency v. S(T) (cm −2 atm −1 ) is the linestrength, which is dependent on temperature only. P (atm) is the total pressure of the absorbing species and X abs is the mole fraction of the absorbing species. φ v represents the line shape function and L (cm) is the optical length. WMS is an advanced TDLAS technique based on direct absorption spectroscopy (DAS), which has a higher signal noise ratio (SNR) and is more suitable for the hostile environment compared to DAS. When the current is injected into the DFB laser with a low frequency and a high frequency sinusoidal waveform, the intensity of the laser, I 0 (t), and the frequency of the laser, ν(t), can be modeled using Equations (2) and (3), [14] respectively. I 0 (t) = I 0 (1 + i 1,s sin(2π f s t + ϕ 1,s ) + i 2,s sin(4π f s t + ϕ 2,s ) +i 1,m sin(2π f m t + ϕ 1,m ) + i 2,m sin(4π f m t + ϕ 2,m )) (2) v(t) = v 0 + a 1,s sin(2π f s t + ∅ 1,s ) + a 2,s sin(4π f s t + ∅ 2,s ) Here, the subscripts s and m represent the characteristic changes of intensity or frequency due to the scan and modulation, respectively. I 0 is the mean intensity; i 1 and i 2 are the first-and second-order mean-normalized intensity amplitude, respectively; f [Hz] is the user-specified frequency; ϕ 1 and ϕ 2 are the absolute phase shift of the first-and second-order intensity; similarly, ∅ 1 and ∅ 2 are the absolute phase shift of the first-and second-order frequency; v 0 (cm −1 ) is the center optical frequency of the laser. a 1 and a 2 [cm −1 ] are the first-and second-order scan or modulation depth.
The low frequency current scans the majority of absorption lineshape, while the high frequency modulation current transfers the absorption information to the harmonics. In order to acquire absorption information from harmonics, the most widely used method is the 2nd harmonics normalized by 1st harmonics, namely WMS-2f/1f. In this study, the harmonics were obtained using the approach presented by Goldenstein et al. [14]. The transmitted light signal is multiplied by a reference cosine and sine wave at 2f m , respectively, which are then passed through the low-pass filter to obtain the corresponding X 2f (t) and Y 2f (t) components. The X 1f (t) and Y 1f (t) can be obtained in a similar way, where the frequency of the reference signal is changed to 1f m . The WMS-2f/1f signal intensity can be calculated by eq.4, which is a function of the integrated absorbance area, lineshape function and laser characteristics [14].
In this scheme, the transition center frequency (v 0 ), the integrated absorbance area (A) and the lineshape width (∆ν) are employed as free parameters to fit the simulated WMSnf/1f spectral profile to the measured one. The iteration fitting routine is shown in Figure 1. When the minimum sum-of-squared errors (SSE) between the simulation and measured WMS-2f/1f meet the user-specified requirement, the best fitting parameters are employed to determine the gas property. An intelligent guess for initial parameters would reduce the update times dramatically. However, it is difficult to obtain the intelligent guesses for the fitting routine when under an unknown circumstance. The less you know about the measurement situation, the harder you acquire appropriate guesses. One should note that the lineshape width should be dependent on both the collisional width and Doppler width. Nevertheless, in order to reduce the fitting complexity, only the collisional width is floated and the Doppler width is fixed at a given temperature. If the inferred gas temperature deviates far away from the given temperature, an iteration between Doppler width and fitting procedure may be needed. harmonics were obtained using the approach presented by Goldenstein et al. [14]. The transmitted light signal is multiplied by a reference cosine and sine wave at 2fm, respectively, which are then passed through the low-pass filter to obtain the corresponding X2f(t) and Y2f(t) components. The X1f(t) and Y1f(t) can be obtained in a similar way, where the frequency of the reference signal is changed to 1fm. The WMS-2f/1f signal intensity can be calculated by eq.4, which is a function of the integrated absorbance area, lineshape function and laser characteristics [14].
In this scheme, the transition center frequency ( ), the integrated absorbance area (A) and the lineshape width (Δν) are employed as free parameters to fit the simulated WMS-nf/1f spectral profile to the measured one. The iteration fitting routine is shown in Figure 1. When the minimum sum-of-squared errors (SSE) between the simulation and measured WMS-2f/1f meet the user-specified requirement, the best fitting parameters are employed to determine the gas property. An intelligent guess for initial parameters would reduce the update times dramatically. However, it is difficult to obtain the intelligent guesses for the fitting routine when under an unknown circumstance. The less you know about the measurement situation, the harder you acquire appropriate guesses. One should note that the lineshape width should be dependent on both the collisional width and Doppler width. Nevertheless, in order to reduce the fitting complexity, only the collisional width is floated and the Doppler width is fixed at a given temperature. If the inferred gas temperature deviates far away from the given temperature, an iteration between Doppler width and fitting procedure may be needed. The guess values of initial parameters are firstly employed in the iteration. If the SSE is smaller than the predetermined value when the iteration converges, the outputs of the iteration are used to infer gas properties. Otherwise, the initial parameters have to be updated and repeat the iteration.

Orthogonal Test Method
Orthogonal test method (OTM) is used to study several factors and levels. Based on the appropriate orthogonal table, it can conduct tests with optimum parameters to reduce test times and curtail the test period. The factors are referred to the parameters which The guess values of initial parameters are firstly employed in the iteration. If the SSE is smaller than the predetermined value when the iteration converges, the outputs of the iteration are used to infer gas properties. Otherwise, the initial parameters have to be updated and repeat the iteration.

Orthogonal Test Method
Orthogonal test method (OTM) is used to study several factors and levels. Based on the appropriate orthogonal table, it can conduct tests with optimum parameters to reduce test times and curtail the test period. The factors are referred to the parameters which influence the final result in a specified experiment, while the levels are equal to the maximum number of the values that any single factor can be set as [26].
In this study, the WMS-2f/1f spectral profile is affected by the initial values, namely the integrated absorbance area (A), center frequency (v 0 ) and collisional width (∆ν c ). If the initial values are chosen inappropriately, the final value of SSE may not satisfy the requirement of the predetermined SSE after a certain amount of iteration, even though the iteration converges. Sequentially the initial values have to be updated and the iteration process is repeated to meet the requirement. Normally, the farther the initial parameters deviate from the true gas properties, the more times they need updated, which is timeconsuming and puts challenge to the hardware device. On the contrary, when the improved initial values are employed, it can decrease the initial-parameters-updating times and consequently curtail the period of the fitting routine.
Therefore, the A, v 0 and ∆ν c are set as three factors in an orthogonal experiment to determine the optimal initial values. The levels of each parameter are selectively some typical values of parameters according to specific conditions. In this study, the three levels of  Table 1.

Experimental Validation
The schematic of the experimental setup is shown in Figure 2. To validate the performance of the optimized initial parameters determined by OTM, a DFB tunable diode laser (NEL) near 1343 nm was used to probe the vapor temperature based on scanned-WMS-2f/1f at room temperature (291K, 1 atm). The H 2 O mole fraction was 0.7% measured by a hygrometer. A function generator (RIGOL 4102) controlled by the LabVIEW was used to produce a slow sinusoidal waveform (f s = 100 Hz) and a fast one (f m = 10 kHz). The combined waveform was then delivered to a laser controller (Arroyo 6305), which can change the output intensity and wavelength of a DFB laser via temperature and current. The light from the laser passed through the test region, whose optical length (L) was 137 cm and was directed upon the detector (Thorlabs, PDA20CS2). The transmitted signal was recorded by a USB DAQ (NI 9223) with a 1 Msa/s sampling rate. The raw signal was then processed in a computer to obtain the measured harmonics' signals. It must have been mentioned that the frequency characteristics (v(t)) of this laser has been conducted prior to the experiment.
influence the final result in a specified experiment, while the levels are equal to the maximum number of the values that any single factor can be set as [26].
In this study, the WMS-2f/1f spectral profile is affected by the initial values, namely the integrated absorbance area (A), center frequency (v 0 ) and collisional width (Δν ). If the initial values are chosen inappropriately, the final value of SSE may not satisfy the requirement of the predetermined SSE after a certain amount of iteration, even though the iteration converges. Sequentially the initial values have to be updated and the iteration process is repeated to meet the requirement. Normally, the farther the initial parameters deviate from the true gas properties, the more times they need updated, which is timeconsuming and puts challenge to the hardware device. On the contrary, when the improved initial values are employed, it can decrease the initial-parameters-updating times and consequently curtail the period of the fitting routine.
Therefore, the A, v 0 and Δν are set as three factors in an orthogonal experiment to determine the optimal initial values. The levels of each parameter are selectively some typical values of parameters according to specific conditions. In this study, the three levels of  Table 1.

Experimental Validation
The schematic of the experimental setup is shown in Figure 2. To validate the performance of the optimized initial parameters determined by OTM, a DFB tunable diode laser (NEL) near 1343 nm was used to probe the vapor temperature based on scanned-WMS-2f/1f at room temperature (291K, 1 atm). The H2O mole fraction was 0.7% measured by a hygrometer. A function generator (RIGOL 4102) controlled by the LabVIEW was used to produce a slow sinusoidal waveform (fs = 100 Hz) and a fast one (fm = 10 kHz). The combined waveform was then delivered to a laser controller (Arroyo 6305), which can change the output intensity and wavelength of a DFB laser via temperature and current. The light from the laser passed through the test region, whose optical length (L) was 137 cm and was directed upon the detector (Thorlabs, PDA20CS2). The transmitted signal was recorded by a USB DAQ (NI 9223) with a 1 Msa/s sampling rate. The raw signal was then processed in a computer to obtain the measured harmonics' signals. It must have been mentioned that the frequency characteristics (v(t)) of this laser has been conducted prior to the experiment.

Optimized Initial Parameters Obtained by OTM
The partially raw signal and two typical sets of WMS-2f/1f spectral profiles are shown in Figure 3. Although the absorption of H 2 O is very weak in the room condition, the vapor

Optimized Initial Parameters Obtained by OTM
The partially raw signal and two typical sets of WMS-2f/1f spectral profiles are sh in Figure 3. Although the absorption of H2O is very weak in the room condition, the va properties can also be inferred from the WMS-2f/1f profile with the strategy introduce Section 2.1. To gain the optimized initial parameters and shorten the fitting routine period, a rameter-optimization procedure based on OTM using orthogonal table L9 (3 4 ) was formed. Since the goodness of fitting between the simulated and measured WMSprofile is indicated by the SSE, it is appropriate to employ the value of SSE to evaluate fitting performance of different initial parameters after the given updating times. The ferent combinations of three factors with three levels (in Table 1) based on the orthog table were used as the initial parameters to fit the measured WMS-2f/1f profile, and minimal SSE was calculated after the initial parameters updated 50 times, as show Table 2. In the fitting routine, the Levenberg-Marquardt algorithm was employed. obvious that the values of SSE vary dramatically with different initial parameters. bigger the value is, the worse is the fitting performance. Moreover, it is necessary to date the initial parameters with more times to obtain satisfactory results. Take the te for example; the value of SSE is as high as 0.9561091, which indicates the fitting effe not satisfying. Therefore, the initial parameters of test 8 have to be updated with m times to improve the fitting performance. It necessitates further analysis of the orthogonal test results to locate the optimal tial parameters via range analysis. Range analysis is a statistical method to determine To gain the optimized initial parameters and shorten the fitting routine period, a parameter-optimization procedure based on OTM using orthogonal table L 9 (3 4 ) was performed. Since the goodness of fitting between the simulated and measured WMS-2f/1f profile is indicated by the SSE, it is appropriate to employ the value of SSE to evaluate the fitting performance of different initial parameters after the given updating times. The different combinations of three factors with three levels (in Table 1) based on the orthogonal table were used as the initial parameters to fit the measured WMS-2f/1f profile, and the minimal SSE was calculated after the initial parameters updated 50 times, as shown in Table 2. In the fitting routine, the Levenberg-Marquardt algorithm was employed. It is obvious that the values of SSE vary dramatically with different initial parameters. The bigger the value is, the worse is the fitting performance. Moreover, it is necessary to update the initial parameters with more times to obtain satisfactory results. Take the test 8 for example; the value of SSE is as high as 0.9561091, which indicates the fitting effect is not satisfying. Therefore, the initial parameters of test 8 have to be updated with more times to improve the fitting performance. It necessitates further analysis of the orthogonal test results to locate the optimal initial parameters via range analysis. Range analysis is a statistical method to determine the factors' sensitivity to the experimental result according to the orthogonal experiment. Range is defined as the distance between the extreme values of the data. The greater the range is, the more sensitive is the factor [33]. The summation of SSE from i-level for a specific x-factor,K x i , the average of K x i , k x i , and the range, R x , is calculated by Equations (5)-(7) [28], respectively. The results are listed in Table 3.  According to the value of R in Table 3, it can be concluded that the SSE, namely, the performance of fitting, is primarily affected by the initial value of the integrated absorbance area among the three factors. However, it is reminded that the effects of the other two factors cannot be ignored. From the data in Table 3, it can be found that This result implies that the optimal initial parameters are the combination of the integrated absorbance area, A, with Level 1, center frequency, v 0 , with Level 1 and collisional width, ∆ν c , with Level 3, namely, 0.001, 7444.35 and 0.08 cm −1 , respectively.

Fitting Performance of the Optimized Initial Parameters
With the optimized initial parameters obtained above, the fitting routine can meet the SSE requirement within less initial parameter-updating times and improve the fitting efficiency. To illustrate this benefit, 20 sets of random values around the optimized initial parameters and 20 sets of random initial parameters in the range from 0.001 to 0.003 for A, 7444.35 to 7444.37 cm −1 for v 0 and 0.02 to 0.08 cm −1 for ∆ν c were used to match the same measured WMS-2f/1f spectral profile. All the initial parameters were allowed to be updated no more than 50 times, and their respective minimal SSE were calculated. The final results are shown in Figure 4.
In this figure, the blue diamond indicates the minimal SSE of the fitting by the optimized initial parameters obtained with OTM, while the red ones represent the minimal SSE of the fitting by random initial parameters. In Figure 4a, it is apparent that all the minimal SSEs from the optimized parameters are buried in the gray layer. By contrast, the majority of the minimal SSEs from random initial parameters are outside the gray region. This characteristic implies that the optimized initial parameters obtained from the OTM can reach a smaller SSE in given updating times compared with the random ones. Furthermore, if the user-specified SSE is 0.0025, all the SSEs from optimized initial parameters can meet the requirement. However, only three sets of random initial parameters' SSEs are smaller than the required SSE, as shown in Figure 4b. It means that those initial parameters, which do not satisfy the requirement, need more times to update their values.
Furthermore, if the user-specified SSE is 0.0025, all the SSEs from optimized initial pa eters can meet the requirement. However, only three sets of random initial parame SSEs are smaller than the required SSE, as shown in Figure 4b. It means that those i parameters, which do not satisfy the requirement, need more times to update their va Theoretically, as long as the initial parameters are updated frequently enough, eventually can meet the SSE requirement to converge the fitting routine, no matter w values the initial parameters takes. However, it is rather time-consuming. To illustrat characteristic visually, 100 sets of initial parameters were selected randomly aroun optimized values obtained by OTM and from the same range as above, respectively, which were applied to match the same measured WMS-2f/1f spectral profile. As the F 5 shows, the blue bar represents the distribution of time the near optimized initial pa eters took, and the red is the distribution of time cost by the unimproved initial par ters. It is obvious that the majority of the optimized parameters took less than 20 s to verge the fitting routine, accounting for near 80%. More specifically, many of them even less than 5 s and no one was found beyond 60 s. Nevertheless, when fitting wit parameters without optimization, nearly 90% of the sets cost more than 50 s to obtai same results. In addition, the sets of parameters costing below 20 s accounted for less one fifth. The averagely consumed time with the optimized initial parameters was 1 while it was 49.5 s for the parameters without optimization, near 5 times longer tha former. Therefore, the optimized initial parameters can effectively curtail the perio fitting routine and accelerate gas property inference from the WMS-2f/1f spectral pr which is helpful, especially when faced with a large amount of fitting data. Theoretically, as long as the initial parameters are updated frequently enough, they eventually can meet the SSE requirement to converge the fitting routine, no matter which values the initial parameters takes. However, it is rather time-consuming. To illustrate this characteristic visually, 100 sets of initial parameters were selected randomly around the optimized values obtained by OTM and from the same range as above, respectively, all of which were applied to match the same measured WMS-2f/1f spectral profile. As the Figure 5 shows, the blue bar represents the distribution of time the near optimized initial parameters took, and the red is the distribution of time cost by the unimproved initial parameters. It is obvious that the majority of the optimized parameters took less than 20 s to converge the fitting routine, accounting for near 80%. More specifically, many of them took even less than 5 s and no one was found beyond 60 s. Nevertheless, when fitting with the parameters without optimization, nearly 90% of the sets cost more than 50 s to obtain the same results. In addition, the sets of parameters costing below 20 s accounted for less than one fifth. The averagely consumed time with the optimized initial parameters was 10.3 s, while it was 49.5 s for the parameters without optimization, near 5 times longer than the former. Therefore, the optimized initial parameters can effectively curtail the period of fitting routine and accelerate gas property inference from the WMS-2f/1f spectral profile, which is helpful, especially when faced with a large amount of fitting data.

Temperature from the WMS-2f/1f
Figure 6a presents a single-scan measured WMS-2f/1f spectral profile of the H2O transition near 7444.35 cm −1 and the corresponding best-fit with the optimized initial parameters. In all fitting routines, Δν was fixed at the value given by the known temperature and A, v 0 and Δν were free parameters obtained by OTM. The simulated WMS-2f/1f

Temperature from the WMS-2f/1f
Figure 6a presents a single-scan measured WMS-2f/1f spectral profile of the H 2 O transition near 7444.35 cm −1 and the corresponding best-fit with the optimized initial parameters. In all fitting routines, ∆ν D was fixed at the value given by the known temperature and A, v 0 and ∆ν c were free parameters obtained by OTM. The simulated WMS-2f/1f spectral agrees well with the whole measurement. However, there exists a visible difference in the region of the left lobe, which may be caused by the low absorbance as stated in Section 4.1. However, this deviation does not influence the final gas property inference too much. spectral agrees well with the whole measurement. However, there exists a visible ence in the region of the left lobe, which may be caused by the low absorbance as in Section 4.1. However, this deviation does not influence the final gas property inf too much.
The integrated absorbance area from the scanned-WMS-2f/1f spectral fitting r was used to deduce the vapor temperature with the known H2O mole fraction, measured by a hygrometer. Figure 6b shows the inferred temperature during 10 cycles of the laser, namely 0.1 s. The WMS-2f/1f measured temperature was in good ment with the value measured by K type thermocouple (291K). The slight variation WMS-2f/1f measured temperature was reasonable. The measurement uncertainty nates primarily from the fitting residual (<0.25% from Figure 6a),the hygrometer and the reference linestrength (~2%) [34]. Therefore, the measured temperature tainty was about 2.25%. Note that the laser was scanned by a sinusoidal waveform 100 Hz, so there existed absorption when scanned up or down in one cycle. Therefo measurement temporal resolution was increased to 200 Hz.  The integrated absorbance area from the scanned-WMS-2f/1f spectral fitting routine was used to deduce the vapor temperature with the known H 2 O mole fraction, 0.7%, measured by a hygrometer. Figure 6b shows the inferred temperature during 10 scancycles of the laser, namely 0.1 s. The WMS-2f/1f measured temperature was in good agreement with the value measured by K type thermocouple (291K). The slight variation of the WMS-2f/1f measured temperature was reasonable. The measurement uncertainty originates primarily from the fitting residual (<0.25% from Figure 6a),the hygrometer (~1%) and the reference linestrength (~2%) [34]. Therefore, the measured temperature uncertainty was about 2.25%. Note that the laser was scanned by a sinusoidal waveform with 100 Hz, so there existed absorption when scanned up or down in one cycle. Therefore, the measurement temporal resolution was increased to 200 Hz.

Conclusions
A strategy based on the orthogonal test method is proposed to optimize the initial parameters of the scanned-WMS-2f/1f spectral fitting routine. With the optimized initial parameters, the sum-of-squared errors (SSE) between the simulated and measured WMS-2f/1f profile can be greatly reduced in the given initial-parameters-updated times. Consequently, the fitting routine converges more efficiently. As stated before, on average, it took about 10 s to make the fitting routine converge with the optimized initial parameters. Meanwhile it needed 50 s to obtain the same results using the conventional method. When faced with a large amount of fitting data, it can save roughly 80% calculating time using this novel method. The measurement of gas temperature was performed by WMS in the controlled condition (T = 291K, X abs = 0.7%, P = 1 atm). Moreover the inferred temperature with the optimized initial parameters was consistent with the controlled value.