Effect of Peak Tracking Methods on FBG Calibration Derived by Factorial Design of Experiment

We present a calibration procedure for a humidity sensor made of a fiber Bragg grating covered by a polyimide layer. FBGs being intrinsically sensitive to temperature and strain, the calibration should tackle three variables, and, therefore, consists of a three-variable, two-level factorial design tailored to assess the three main sensitivities, as well as the five cross-sensitivities. FBG sensing information is encoded in the reflection spectrum from which the Bragg wavelength should be extracted. We tested six classical peak tracking methods on the results of the factorial design of the experiment applied to a homemade FBG humidity sensor. We used Python programming to compute, from the raw spectral data with six typical peak search algorithms, the temperature, strain and humidity sensitivities, as well as the cross-sensitivities, and showed that results are consistent for all algorithms, provided that the points selected to make the computation are correctly chosen. The best results for this particular sensor are obtained with a 3 dB threshold, whatever the peak search method used, and allow to compute the effective humidity sensitivity taking into account the combined effect of temperature and strain. The calibration procedure presented here is nevertheless generic and can thus be adapted to other sensors.


Introduction
Fiber Bragg grating (FBG) is a periodic and permanent modulation of the refractive index of the optical fiber core, which is achieved by exposing the optical fiber core to the interference pattern of ultraviolet light [1][2][3][4][5].
When light propagates through an FBG, a specific wavelength, referred to as the Bragg wavelength λ B , is reflected in phase by each grating plane, whereas the remaining wavelengths pass through it. The Bragg wavelength depends on the effective refractive index of the core and the grating period. Both parameters are inherently temperature and axial strain-dependent. Therefore, any modification in temperature or strain causes the Bragg wavelength to change, and this property is the basis for an FBG sensor: by monitoring the Bragg wavelength, strain or temperature can be monitored. This is achieved by an FBG interrogator system that exists in various types, such as scanning filter setup [6,7], tunable laser setup [8,9] and spectroscopic setup [10]. Whatever the detection system used, the output is the FBG spectrum versus the wavelength from which the Bragg peak is extracted by standard algorithms (carried out in MATLAB or LabVIEW programming languages in most commercial equipment). If a sensitive layer to external stimuli (such as humidity) is added around the FBG, this stimuli can be measured by following the related peak shift and by calibrating the active layer. FBG-based sensors can therefore be adapted to sense various physical quantities and have numerous properties. FBG-based sensors are lightweight, small-sized, and passive. They are immune to electromagnetic interference as well. The FBGs are resistant to corrosion and highly sensitive. They respond fast and are capable of remote operation. In addition, FBGs have the potential for quasi-distributed sensing. They have been used to monitor temperature, humidity, strain, external refractive index, and bending [11][12][13][14][15][16][17][18][19]. Moreover, FBG-based sensors can be operated in harsh environments with severe physical/chemical conditions such as very high temperature, and high pressure [20][21][22][23][24][25][26].
From the grating physical principle, it is clear that any FBG is always sensitive to temperature and strain. If a polyimide sensitive layer is added to transform the FBG into a humidity sensor, the resulting sensor is sensitive to three parameters (temperature, strain and humidity). Therefore, calibration against the three parameters should be carried out, such that humidity can be retrieved as soon as temperature and strain are known. These two quantities can be measured by other types of sensors, as well as by FBGs without sensitive layer, one being packaged to be strain-independent.
The classical experimental approach to measure the effect of multi-factors (variables) on the output of a sensor is to study each variable separately. This approach is time consuming and does not allow to estimate the interactions between the factors [27,28]. For example, to study the effect of three factors on a phenomenon, if each factor, for instance, has seven levels (points of experiment or runs), the experimenter would have to carry out 7 3 = 343 experiments or trials, which consumes time and is prone to error. The only way to reduce the experimental time is to decrease the number of levels per factor.
In contrast, a design of experiment (DoE) is a better strategy and more efficient for experimenting with multiple factors. In particular, a factorial design (FD) consists of modifying all the variables in each trial so that (1) the total number of experiments is reduced, and (2) the interactions between factors can be detected [27][28][29]. The simplest factorial design is a two-level design for which each factor is tested at only two levels: the low level (minimum value of the variable, or −1) and the high level (maximum value of the variable, or +1) in the interest range of the measurement.
In 2019 [12], we reported a two-level FD for three factors (temperature, strain and humidity) for FBGs sensors. With only eight trials, i.e., 2 3 , the number of combinations of two levels for three variables, the three main sensitivities and five cross-interactions of 2 × 2 and 3 × 3 were computed from the Bragg wavelength shifts measured by an FBG interrogator system that assumes that the Bragg wavelength is the maximal value of the FBG reflection spectrum. In any measurement system, an algorithm is used to transform the spectrum data into the peak wavelength of the Bragg grating. It is clear that this algorithm influences the output of the measurement system; therefore, comparing the different peak detection algorithms is worthwhile, especially for multiparameter sensing applying DoE.
This work explains the calibration procedure of an FBG humidity sensor and shows the effect of the peak algorithm used on the sensitivity and cross-sensitivity estimations of a DoE of three parameters (temperature, strain and humidity) using a polyimide-coated FBG as a humidity sensor. In particular, six classical peak search algorithms have been analyzed and compared: maximum, centroid, X-dB bandwidth, Gaussian fit, polynomial quadratic fit, and cubic-spline fit.

Sensor Fabrication
To fabricate the humidity sensor, we used single-mode standard optical Draka Bendbright fiber, and prior to the grating inscription, the optical fiber was hydrogenated. The Bragg grating is inscribed using an interferometric setup that contains a Lloyd mirror as a wavefront splitter and a ten-fold beam expander. In addition, an adjustable diaphragm was used to fabricate a 4 mm grating length. The laser system that was used in this inscription setup consists of a fiber laser from Azur Light System with an external cavity frequency doubler from Sirah that emits at 244 nm. The grating was annealed for one day at 100°C to remove the residual hydrogen in the fiber and stabilize the grating's properties.
Bare FBGs are not sensitive to humidity; therefore, for humidity sensing, we coated the FBG with an additional layer of polyimide (PI2525), which is known to be a hygroscopic material [30]. Figure 1 shows the PI layer coated on a bare FBG deposited by hand at the lab and leading to a polyimide thickness around 25 µm. PI possesses the water absorption property. When the coated grating with PI is in contact with humidity, the PI induces strain by swelling due to the absorption of the water molecules. There is a linear relation between the humidity and the volume expansion of this material [13]. This, in turn, induces strain that changes the grating period Λ and, consequently, the Bragg shift [13,31] is linearly proportional to humidity. It is well-known from FBG theory [2] that the Bragg wavelength λ B for a first order diffraction grating is given by: where n eff is the effective refractive index of the guided mode in the optical fiber core, and Λ is the grating period, both temperature and strain-dependent [2]. Variations of temperature (T), strain (ε) and humidity (H) will therefore affect the Bragg wavelength of the PI-coated FBG, according to the generic expression: The goal of the calibration is to estimate the function f from a number of measurements carefully chosen in the experimental space of the three variables T, ε and H.

Factorial Design
The most general surface response for a three-variable system is: where f is the unknown function to be estimated from calibration measurements. However, this equation is too general to be manageable. One way to tackle this problem is to make a Taylor series expansion: where y is the response, x i represents the level of factor i, a 0 (1 coefficient), a i (3 coefficients), a ij (9 coefficients of which 6 are independent) and a ijk (27 coefficients of which 10 are independent) are the coefficients of the polynomial representing the surface response: In this study dedicated to humidity sensing with FBG, the ranges of temperature and strain (see Section 4) are small enough to consider a first-order model with interaction, i.e., we neglect all terms with powers higher than 1 in any variables x i . Therefore, Equation (4) becomes: (6) and from the symmetry of the partial derivatives versus the subscripts, a ij = a ji , so that (6) becomes: With a first-order model with interaction, (1) if we fix two variables out of three, y varies linearly with the third variable, and (2) the slope for x i depends on x j and x k . In terms of sensing, it means that the effective humidity sensitivity depends on the temperature and the strain.
In DoE, it is useful to normalize the variables between −1 and +1, with −1 the minimum level and +1 the maximum level. For a two-level, three-variable system x 1 = X t , x 2 = X h and x 3 = X ε for temperature, humidity and strain, respectively, the trials are placed at eight vertexes (y 1 to y 8 ) of a cube, as shown in Figure 2. Moreover, a control point (y c ) is placed at the center of the cube and is used to validate the first-order model with interaction. Figure 2. Two-level factorial design for three variables of temperature, humidity, and strain as X t , X h , and X ε , respectively. The red points (vertices of cube) are the measurement points.
With these normalized variables, Equation (7) simply becomes: (8) or in denormalized form: where the coefficients A µ are linked to the coefficients S ν by simple relationships [27].
In summary, relation (8) is the key equation to calibrate the sensor, and from calibration measurements, the eight coefficients A µ are estimated, and then the eight coefficients S ν are computed. Physically, S 0 = λ 0 is the Bragg wavelength of the center of cube, S t , S h , and S ε are the temperature, humidity, and strain sensitivities, respectively. The cross-sensitivities between two variables are expressed by S th , S tε , and S hε , while the cross-sensitivity between all variables is S thε . With the eight coefficients, the response for any point located inside the cube is easily computed by relation (9) and compared with measurement to check the validity of the first-order model with interaction. Then if the validity is correct, the model can predict all the values inside the cube; this is a kind of interpolation. Even if relation (9) gives values for points outside the cube, this kind of extrapolation should not be used because there is no guarantee that the first-order model with interaction is also valid in this extended range. The only way to extend the range is to make eight new measurements in a bigger cube and test the model with control points.
In Equation (8), there are 8 unknowns, i.e., the 8 coefficients A µ of the two-level factorial design (FD), that should be computed from at least 8 independent measurements. With the choice of the trials (y 1 to y 8 ) depicted by Figure 2, Equation (8) always has a solution that is: where X is the design matrix, T the transpose operation, A the column vector of the coefficients, and λ Bi the column vector of the Bragg wavelengths measured at the vertexes of the cube [27][28][29].
It is worth noting that, based on literature results, we assume a linear behavior with temperature, strain, and humidity [1,2,4,13] for the ranges of variables encountered in normal environmental conditions. This assumption is correct for small temperature and strain ranges, but should always be checked experimentally. This is the goal of the control point (y c ) located at the center of the cube. If the measurement of this point matches with the first-order model with interaction computed from the eight experimental points (y 1 to y 8 ), then this model is sufficient. If it is not the case, a second-order model with interaction should be tested. That would be the case for the temperature, as it is known that the relation between the Bragg wavelength and the temperature becomes quadratic [32] in an extended temperature range. In that case, it is easy to extend the first-order model with interaction to a second-order model with interaction by including at least the quadratic term A tt X 2 t in relation (8) and even the other quadratic term A εε X 2 ε and A hh X 2 h if necessary. Of course, in that case, more than eight experimental points should be measured to estimate the supplementary coefficients a ii . Then the optimal experimental design is no longer a cube but can be a composite design, a Box-Behnken design, or a Doehlert design [27].

Experimental Setup and Results
The experimental setup is the same as the one used in [12]. We need to control three variables: temperature, humidity, and strain. Therefore, the experiment was performed in a climate chamber from WEISS TECHNIK-SB22 300 that is used to control temperature and humidity, and two different calibrated weights were used to apply the strain on the grating according to: where m is the mass of the calibrated weights, g is the gravity acceleration (9.81 m/s 2 ), E silica (72 GPa, [33]) and E PI (2.5 GPa, [34]) are the Young's modulus of the silica and polyimide, respectively, and finally, A silica and A PI are the cross-sections of the fiber with an outer diameter of 125 µm and the polyimide with a thickness around 25 µm, respectively. Then E PI A PI E silica A silica , so that the values of ε are computed for the silica only. The levels of the variables were set according to Table 1, for testing the humidity sensor in the usual conditions. A Bragg-meter from FiberSensing (FS22) was used to extract the eight spectra corresponding to the eight vertexes y 1 to y 8 . Then, a Python program was used to extract the eight Bragg wavelengths λ Bi with a chosen peak search algorithm, from which the sensitivities A µ and S ν were computed. The level of the factor y c for the control point is shown in Table 1 as well. As it can be seen, the control point is not exactly at the center of the cube, but corresponds to ∆T = −0.8°C and ∆ =−1.018 µ . Moreover, the control point was measured 10 times to estimate the dispersion of the interrogator. For all the peak search methods used, the variation was always less than 1 pm.
A typical example of raw data from the interrogator FS22 is presented in Figure 3. It is worth noting that the FS22 outputs points every 5 pm and can span the wavelength range 1500 nm to 1600 nm with a dynamic range better than 25 dB. The reflection spectra of the PI-coated FBG for the eight measuring points are presented in Figure 4 where labeling is as follows: low-level (−1) is M, and high-level (+1) is P. Therefore, label 5-MMP, for instance, corresponds to X t = −1, X h = −1 and X ε = +1 (point y 5 of Figure 2). The reflection spectra clearly exhibit side-lobes, and the main question is how to cope with these side-lobes inside the peak search algorithms that need to work on a selected area around the maximum. To make a fair comparison between the algorithms, we isolated the main lobe in the spectral range of 1560 to 1562 nm, and we selected the data points with the following procedure: we first search for the maximum R max , then we use a threshold of X-dB to select the points in the main lobe between R max and R th = R max − X. This procedure is displayed in Figure 5 for three thresholds and shows that min(λ th ) and max(λ th ) are always the intersections with the main lobe and the threshold.

Peak-Detection Algorithms
There are many ways to find the Bragg wavelength in a reflection spectrum, and these methods were fully described in the review paper of Tosi [35], where the methods are divided into (1) direct, (2) curve fitting, (3) correlation, (4) transform, and (5) optimization. In the spirit of the design of the experiment approach, we will limit our analysis to the first two categories, as the other ones either require a reference spectrum or need more extensive calculation. It is nevertheless important to note that the calibration method using the factorial design presented here is generic and is thus also perfectly suited for any peak search algorithm.

Maximum
The most common and straightforward method of FBG peak tracking is to detect the maximum value of the reflection spectrum, R max , and then find the corresponding wavelength λ max that is assigned to the Bragg wavelength λ B . When the interrogator is configured in this mode, the interrogator outputs a file with a series of couples (R max , λ max ) corresponding to the successive peaks in the spectrum.
From this file, or by applying a maximum search on the raw data, the S ν coefficients are computed from Equation (8), and the results are presented in Table 2. Table 2. Factorial design experiment results; main sensitivities: S t , S h , S ε , and cross interaction coefficients: S th , S tε , S hε , and S thε of PI-coated FBG with maximum reflection detection method.

Coeff.
Coeff It is important to test if the first-order model with interaction is a good assumption. Therefore, Table 2 also gives the value of λ cp calculated from the model (S ν coefficients), and the experimental value λ meas measured for y c by using the same peak search algorithm. We clearly see that the agreement is within 1 pm, and there is thus no need to try a second-order model with interaction.
The temperature, humidity and strain sensitivities of PI-coated FBGs are therefore equal to 11.28 pm/°C, 3.66 pm/%RH and 1.16 pm/µ , respectively, whereas cross-sensitivities are quite small. It is interesting to note that the temperature and strain sensitivities matcg well with the values found in the literature for silica-based FBG [2,3]. Moreover, the humidity sensitivity also matches with the results of ([13], Figure 2) for a polyimide thickness around 25 to 30 µm.

X-dB Bandwidth
The principle is depicted in Figure 5. It consists of (1) searching for R max , (2) finding the two intersections min(λ th ) and max(λ th ) of the line R th = R max − X with the main lobe of spectrum trace, and (3) estimating λ B by the midway point between these two intersections: The results of this procedure for X = 1, 3, 6 and 10 dB are presented in Table 3. The coefficient units are identical to the units in Table 2. The main fact is the change of sign of the S tε coefficient for 6 and 10 dB bandwidths. The control point also confirms the choice of the first-order model with interaction.

Centroid Method or Center of Mass
The centroid algorithm finds the center of the data points as described in relation (13): where R i are converted into a linear scale. To apply this method in a reproducible way, we limit the number of points to the ones found by the X-dB procedure depicted in Figure 5.
The results with X = 1, 3, 6 and 10 dB thresholds are presented in Table 4. Again, the sign and magnitude of the S tε coefficient have changed for 6 and 10 dB bandwidths.

Polynomial Fit
A second-order polynomial function is used to fit in the main lobe, around R max , the measured FBG reflection spectrum in linear scale ( Figure 6), according to relation (14): where a 1 and a 2 are the coefficients from which the Bragg wavelength is determined as: Figure 6. A second-order polynomial fit for linear scaled data points in 3 and 10 dB thresholds. Table 5 displays the results for this fit when the number of points is selected by the X-dB procedure.

Gaussian Fit
The reflection spectrum (in linear scale) around R max in the main lobe is interpolated with a Gaussian function: where A is a multiplicative constant, λ 0 the mean, and σ the standard deviation of the data used in the fitting procedure, as shown in Figure 7. As for the previous case, the number of points used is selected by the X-dB procedure whose results are presented in Table 6.
Here, all the thresholds give similar results; there is no sign change, but S tε is decreasing with the threshold increase.

Cubic-Spline Fit
The cubic-spline is an interpolation method that uses piece-wise third-order polynomials with continuity up to the second derivative at the measuring points. It is extensively used in many practical applications, and detailed information can be found in [36]. Figure 8 gives an example of such computation, and the Bragg wavelength is computed from the maximum of the spline polynomial around the maximum experimental value of the spectrum. It is clear that the Bragg wavelength will be threshold-independent. The coefficients of the first order model with interaction calculated from the cubicspline are displayed in Table 7. The Bragg wavelength of the control point (λ cp ) and measured point (λ meas ) are again in very good agreement with this peak detection method. Table 7. Main and interaction sensitivities of PI-coated FBG, calculated using factorial design using cubic-spline fit.

Discussion
From the peak detection algorithms of the previous sections, we have calculated the sensitivity coefficients S i , as well as the cross-sensitivity coefficients S ij and S ijk , as shown in Tables 2-7. In this section, we summarize all the results and compare these algorithms together. Figures 9 and 10 present the main and the cross-interaction sensitivities calculated by the six methods for (a) 3 and (b) 10 dB thresholds, respectively.  Rapid inspection of the figures reveals that the main sensitivities are the same for any peak search methods, whereas the cross-sensitivities are quite sensitive to the peak search algorithm. Moreover, dispersion of the results is smaller for the 3 dB threshold. To better highlight the differences between the peak search algorithms, we calculated the mean (µ) and standard deviation (σ) values over the six methods of each sensitivity, as shown in Tables 8 and 9, for the 1, 3, 6 and 10 dB thresholds.
There is a slight difference in the sensitivities for different thresholds: while the mean values do not differ significantly, the standard deviations are the smallest for the 3 dB threshold. The same conclusion can be drawn for the cross-sensitivity coefficients. Moreover, for the 10 dB threshold, the temperature-strain S tε cross-sensitivity becomes very small with a large standard deviation.
The theoretical shape of the reflection spectrum of a perfect FBG is made of hyperbolic sine functions, therefore Gaussian fit and second-order polynomial fit are only approximations. If the window used to select the points in the main lobe is too wide, the fitting quality can decrease. This effect is mainly visible in Figure 6 for the polynomial fit.  There is perhaps a small asymmetry on the whole experimental spectra, but in our computation, we only used the main lobe, which is much more symmetrical. Indeed, the main lobe asymmetry is not visible on the figures, and difficult to quantify, as there is no easy way to obtain a measure of the asymmetry. However, as all the spectra are treated in the same way, we expect a negligible effect on the coefficient computation.
Another interesting comparison point is the computation time for the different peak search algorithms. This is especially important for real-time monitoring. We used Python programming on 2.3 GHz Dual-Core Intel Core i5, with 8 GB of RAM with state-of-the-art numerical tools from Numpy and Scipy modules. Relative times to the 3 dB threshold bandwidth technique with an execution time around 20 µs for the data of Figure 4) are presented in Table 10. For a given threshold, the fastest method is always the X-dB bandwidth and the slowest is always the Gaussian fit. The polynomial fit and the centroid are still relatively fast compared to the Gaussian fit, whereas the spline is threshold independent. When the threshold increases from 3 to 10 dB, the number of data points used in the computation also increases, and all methods except the cubic spline need more time to execute, with a ratio from 1.1 for the X-dB bandwidth method to 1.4 for the Gaussian fit.
Based on our experimental data, the most efficient technique to calibrate the humidity sensor is thus the 3-dB bandwidth, leading to: where S 0 and S h are the offset and effective humidity sensitivity, respectively. Table 11 and Figure 11 clearly demonstrate the importance of the interaction terms in the calibration procedure. Indeed, the effective humidity sensitivity ranges from 2.844 pm/%RH to 4.544 pm/%RH. It is also clear that the main parasitic effect is the temperature, i.e., for a given temperature, the lines for the different values of ∆ε are nearly parallel and in groups of three in Figure 11. It is also important to note that there is an offset that is strongly temperature-dependent.

Conclusions
The calibration of FBG sensors is vital to making good measurements. This is especially true when the sensor is sensitive to multiple parameters, as the cross-sensitivities affect the effective sensitivity of the main variables. To conduct this calibration in an efficient way, a factorial design with a first-order model with interaction is first tested, and if the control point agrees with the model, the procedure stops there. Otherwise, new calibration points are added to test a second-order model with interaction.
To illustrate this generic procedure, we designed an FBG-based humidity sensor and made a calibration, taking into account the parasitic effects of temperature and strain. We used a three-variable two-level design of the experiment setup and six traditional peak tracking algorithms (maximum, X-dB bandwidth, centroid, Gaussian fit, second-order polynomial fit, and cubic spline) to estimate the sensitivities to humidity, temperature and strain, as well as the cross-sensitivities between the variables. To make a fair comparison, the centroid, Gaussian fit and polynomial fit were computed on the same number of points as the one obtained from the X-dB threshold criteria. We tested 1, 3, 6 and 10 dB thresholds, and, for this sensor, the 3 dB threshold selection mechanism provided the best results with the smallest dispersion and with always the same sign for the interactions. Amongst the six equivalent methods, the 3 dB bandwidth and second-order polynomial fit with 3 dB threshold are the best suited for fast measurements. After calibration, corrections for temperature, and if needed for strain, are easy to handle. Experimental results also reveal that cross-sensitivity corrections are not negligible, especially for temperature.