Analog and Photon Signal Splicing for CO 2 -DIAL Based on Piecewise Nonlinear Algorithm

: In the CO 2 differential absorption lidar (DIAL) system, signals are simultaneously collected through analog detection (AD) and photon counting (PC). These two kinds of signals have their own characteristics. Therefore, a combination of AD and PC signals is of great importance to improve the detection capability (detection range and accuracy) of CO 2 -DIAL. The traditional signal splicing algorithm cannot meet the accuracy requirements of CO 2 inversion due to unreasonable data ﬁtting. In this paper, a piecewise least square splicing algorithm is developed to make signal splicing more ﬂexible and efﬁcient. First, the lidar signal is segmented, and according to the characteristics of each signal, the best ﬁtting parameters are obtained by using the least square ﬁtting with different steps. Then, all the segmented and ﬁtted signals are integrated to realize the effective splicing of the near-ﬁeld AD signal and the far-ﬁeld PC signal. A weight gradient strategy is also adopted in signal splicing, and the weights of the AD and PC signals in the spliced signal change with the height. The splicing effect of the improved algorithm is evaluated by the measured signal, which are obtained in Wuhan, China, and the splice of the AD and PC signals in the range of 800–1500 m are completed. Compared with the traditional method, the evaluation parameter R 2 and the residual sum of squares of the spliced signal are greatly improved. The linear relationship between the AD and PC signals is improved, and the ﬁtting R 2 of differential absorption optical depth reaches 0.909, indicating that the improved signal splicing algorithm can well splice the near-ﬁeld AD signal and the far-ﬁeld PC signal.


Introduction
The accurate detection of atmospheric CO 2 concentration is an important foundation for clarifying carbon sources and sinks, deepening the understanding of carbon transmission, and formulating reasonable emission reduction policies [1][2][3][4][5][6]. Differential absorption lidar (DIAL) is a powerful means of CO 2 detection, which is less affected by the environment and can obtain high-precision, high spatial-temporal resolution of atmospheric CO 2 concentration information. Ground-based DIAL can obtain the vertical profile information of CO 2 concentration distribution, which is more meaningful for the study of carbon cycle [7][8][9][10].
In our CO 2 -DIAL system, a Licel transient recorder is used to collect data. The Licel transient recorder is a powerful data acquisition system, which can reach the best dynamic range together with a high temporal resolution at fast signal repetition rates. It uses analog detection (AD) and photon counting (PC) modes to collect lidar signals simultaneously. These two kinds of signals have their own characteristics due to the difference in data acquisition principles. The AD signal has good data quality at low altitudes, but the signalto-noise ratio (SNR) at high altitudes is greatly reduced. PC signal can maintain good detection performance at high altitudes, but signal saturation is likely at low altitudes. Therefore, a combination of AD and PC signals is of great importance to improve the detection range and the accuracy of CO 2 -DIAL.
At present, many researchers have studied lidar signal splicing. Newsom et al. specified the analog voltage as the dependent variable and the dead time correction count rate as an independent variable to calculate the fitting coefficient [11]. Zhang et al. presented an approach centered on the slope coefficient to realize the splicing of signals [12]. Veberič et al. used the maximum likelihood function to establish the likelihood between AD signals and PC signals to obtain their splicing parameters [13]. Walker et al. used the lamp mapping technique (LMT) to determine glue coefficients in a manner that does not require atmospheric profiles to be acquired [14]. Lange et al. proposed an enhanced data-gluing formulation, which automatically finds the spatial range where both analog and PC signals are more similar based on Euclidian distance minimization over piece-wise range intervals along the whole acquisition spatial range [15]. Most splicing methods focus on how to establish the linear relationship between AD and PC signals to obtain their accurate splicing coefficient (i.e., slope and slant distance). These methods have a high stitching accuracy for lidar signals with a linear relationship between AD and PC signals. However, due to the influence of the detection environment and the system itself, the relationship between AD and PC signals is usually nonlinear [16]. Zhang et al. used the optimal uniform approximation polynomial for AD and PC signal splicing, but it is an integral polynomial, and the accuracy is reduced when the echo signal fluctuates greatly [17]. CO 2 -DIAL receives two beam echo signals of online and offline wavelengths, and the relationship between AD and PC signals is more complex. In this case, the traditional linear signal splicing method cannot obtain high-quality echo signals. In addition, in the traditional splicing method, AD is typically preferred in the near field or where signals are high. PC is generally preferred in the far field or where signals are low, and the mean value of AD and PC signals is generally adopted in the signal splicing region. On the one hand, this method makes the connection between the three splicing segments less accurate. On the other hand, all the splicing areas are averaged, that is, the photon and simulation weights are both 0.5, which is not very reasonable, and errors are likely at the front and rear ends.
In this paper, a more flexible and efficient piecewise nonlinear splicing algorithm is developed. According to the characteristics of the signal, the lidar signal is segmented, and nonlinear fitting is adopted to obtain the best fitting parameters. Then, all the segmented and fitted signals are integrated. In the final signal fusion, AD signal is used in the near field, and PC signal is used in the far field, which is the same as the traditional signal splicing method. For the signal splicing region, weight change splicing is adopted. During the splicing from the near field to the far field, the weight of the AD signal gradually decreases while the weight of the PC signal gradually increases. Thus, the error generated by signal splicing is minimized, which is conducive to the subsequent inversion of CO 2 concentration.
According to the research content, the structure of paper is as follows: Section 2 mainly introduces the basic structure and the inversion algorithm of the CO 2 -DIAL detection system. Section 3 discusses the basic theory and the algorithm flow of piecewise nonlinear splicing algorithm. Section 4 evaluates the accuracy of the algorithm by measured signals. Section 5 presents the conclusions.

System and Inversion Algorithm of CO 2 -DIAL
The CO 2 -DIAL system works by using the absorption phenomenon of CO 2 molecules to the detection laser, and the concentration information of CO 2 is retrieved according to the attenuation of laser energy after absorption. It receives the Mie scattering echo signal of atmospheric particles and retrieves the CO 2 concentration information according to the absorption of CO 2 molecules to the laser. In the CO 2 -DIAL system, two laser pulses with similar wavelengths are transmitted. One laser, called the online wavelength (λ on ), is located at the absorption peak of the detected component to obtain the maximum absorption. The other, called the offline wavelength (λ off ), is near the valley of absorption to obtain the minimum absorption. The lidar equations of the online and offline wavelengths can be written as: where r is the detection range, P(λ, r) is the received power of range r (λ can be both online and offline wavelengths), P 0 is the laser output power, K is the calibration constant for lidar, A is the light area of the receiving telescope, c is the speed of light, τ is the laser pulse duration, β(λ, r) is the backscatter coefficient of the atmosphere, α 0 (λ, r) is the extinction coefficient of the atmosphere (excluding the trace gas under study), N g (r) is the number of trace gas density, and σ g (r) is the absorption cross section of the trace gas [18,19].
In the CO 2 -DIAL system, Equation (1) with the online wavelength is divided by that with the offline wavelength. The number density of the range-resolved CO 2 can then be derived from the following equation: where r 1 and r 2 are the beginning and the end of the integration interval, respectively, and ∆r = r 2 − r 1 is the range resolution. When the laser wavelength range is small and the time frame is short, several atmospheric parameters change slightly with the wavelength, which can be regarded as constant in the DIAL system. To carry out the subsequent CO 2 concentration inversion analysis more easily, the concepts of optical depth (OD) and differential absorption optical depth (DAOD) are introduced here. The OD of CO 2 gas is the energy attenuation caused by the absorption of the laser through the absorption cell filled with CO 2 gas. Assuming that P 0 is the initial intensity of the detection laser and P is the residual laser intensity after CO 2 absorption, then OD can be expressed by Equation (3): In this paper, OD represents the absorption of CO 2 to the laser energy. DAOD refers to the difference between online and offline wavelength in the CO 2 -DIAL system, which is used to represent the difference between the two laser echo signals caused by CO 2 absorption. Then, Equation (2) can also be expressed as the following equation by OD and DAOD: The importance of signal splicing can also be seen from the CO 2 -DIAL inversion algorithm. The echo signals of online and offline wavelengths need to be spliced in the CO 2 -DIAL system.
The configurations of our ground-based CO 2 -DIAL system is shown in Figure 1 [20]. It is composed of the laser transmitter system, the optical reception detection system, and the data acquisition and processing system. The laser launch system consists of a tunable laser, a wavelength control unit, and a precision optical adjustment platform to achieve a high power and stable output of the detection laser. The optical receiver system is composed of a large aperture receiving telescope, a filter bank and near-infrared PMT for echo signal reception, background noise removal, and photoelectric conversion. The data acquisition and processing system is mainly based on a Licel transient recorder to realize data acquisition and processing functions.  Figure 2 shows the AD and PC detection of the same laser echo signal, and Figure 3 shows the DAOD value calculated from the AD and PC signals. The two figures show that the quality of the AD signal is better at low altitudes, but the SNR drops rapidly as detection distance increases; PC signal still has a high SNR at high altitudes, whereas signal saturation occurs at low altitude, which cannot be used for data processing. The limitations of using only AD or PC signals for CO2 concentration inversion are large.

Methodology
The process of AD and PC combination can be expressed as follows: First, within a certain detection range, a high correlation exists between the AD and PC signals, such that  Figure 2 shows the AD and PC detection of the same laser echo signal, and Figure 3 shows the DAOD value calculated from the AD and PC signals. The two figures show that the quality of the AD signal is better at low altitudes, but the SNR drops rapidly as detection distance increases; PC signal still has a high SNR at high altitudes, whereas signal saturation occurs at low altitude, which cannot be used for data processing. The limitations of using only AD or PC signals for CO 2 concentration inversion are large.  Figure 2 shows the AD and PC detection of the same laser echo signal, and Figure 3 shows the DAOD value calculated from the AD and PC signals. The two figures show that the quality of the AD signal is better at low altitudes, but the SNR drops rapidly as detection distance increases; PC signal still has a high SNR at high altitudes, whereas signal saturation occurs at low altitude, which cannot be used for data processing. The limitations of using only AD or PC signals for CO2 concentration inversion are large.

Methodology
The process of AD and PC combination can be expressed as follows: First, within a certain detection range, a high correlation exists between the AD and PC signals, such that  Figure 2 shows the AD and PC detection of the same laser echo signal, and Figure 3 shows the DAOD value calculated from the AD and PC signals. The two figures show that the quality of the AD signal is better at low altitudes, but the SNR drops rapidly as detection distance increases; PC signal still has a high SNR at high altitudes, whereas signal saturation occurs at low altitude, which cannot be used for data processing. The limitations of using only AD or PC signals for CO2 concentration inversion are large.

Methodology
The process of AD and PC combination can be expressed as follows: First, within a certain detection range, a high correlation exists between the AD and PC signals, such that

Methodology
The process of AD and PC combination can be expressed as follows: First, within a certain detection range, a high correlation exists between the AD and PC signals, such that a section of the region can be found as the best splicing region according to the judgment conditions. Second, the conversion coefficient between the two signals is calculated by a certain fitting method in the splicing area. Finally, the splicing rules are used to splice the two fitted signals in the optimal splicing area [13,[21][22][23]. Figure 4 is the basic flow chart of signal splicing.
Atmosphere 2022, 13, x FOR PEER REVIEW 5 of 13 a section of the region can be found as the best splicing region according to the judgment conditions. Second, the conversion coefficient between the two signals is calculated by a certain fitting method in the splicing area. Finally, the splicing rules are used to splice the two fitted signals in the optimal splicing area [13,[21][22][23]. Figure 4 is the basic flow chart of signal splicing. Three main problems are observed in traditional signal splicing: The first is the selection of the fitting interval. The traditional algorithm selects a fixed region in interval fitting. However, the detection height corresponding to the saturation of photon signal is not fixed due to the change in the detection environment. Therefore, finding the height where the photon signal is completely free from the interference of the saturation effect before selecting the signal splicing region is necessary. The second is the selection of the fitting method. The global linear fitting method is adopted in traditional splicing. However, in the actual experiment, the lidar signal sometimes has a large fluctuation due to the influence of clouds and aerosols. Therefore, the traditional global linear fitting method is not accurate enough to the lidar signal combination, which greatly affects the subsequent inversion. The third is the selection and connection of splicing signals. In the traditional method, the AD signal is adopted in the near field, and the PC signal is adopted in the far field while the mean value of the AD and PC signals is usually adopted in the splicing part. This conduction may make the connection between them less precise, resulting in a large error. In addition, the splicing part adopts the mean value, that is, the weight of AD and PC is 0.5, which is inconsistent with the actual situation, resulting in errors.
In this paper, a piecewise nonlinear signal splicing algorithm is developed based on the traditional splicing methods. First, according to the response equation of the PC signal, the height of the signal that is completely free from the interference of saturation effect is found, and the signal splicing region is determined. Second, the lidar signal in the splicing area is segmented according to the fluctuation of the signal. When the signal is smooth, a larger range of signal segmentation is used. For the part with greater signal volatility, the segmentation range is smaller. Then, the AD and the PC of each signal are fitted with local polynomial to obtain the best fitting parameters, and all the fitted signals are spliced together. Finally, the AD signal is used in the near field, and the PC signal is used in the far field for the selection and connection of splicing signals, which is the same as the traditional algorithms. However, for the signal splice region, the fixed mean value of AD and PC signal is no longer adopted, but the weight gradient strategy is adopted. The weight of near-field AD signal is relatively large while that of far-field PC signal is relatively large, and the transition from the near-field AD signal to the far-field PC signal is gradual, which improves the cohesion and accuracy of signals. The improved piecewise nonlinear signal splicing flow is shown in Figure 5.  Three main problems are observed in traditional signal splicing: The first is the selection of the fitting interval. The traditional algorithm selects a fixed region in interval fitting. However, the detection height corresponding to the saturation of photon signal is not fixed due to the change in the detection environment. Therefore, finding the height where the photon signal is completely free from the interference of the saturation effect before selecting the signal splicing region is necessary. The second is the selection of the fitting method. The global linear fitting method is adopted in traditional splicing. However, in the actual experiment, the lidar signal sometimes has a large fluctuation due to the influence of clouds and aerosols. Therefore, the traditional global linear fitting method is not accurate enough to the lidar signal combination, which greatly affects the subsequent inversion. The third is the selection and connection of splicing signals. In the traditional method, the AD signal is adopted in the near field, and the PC signal is adopted in the far field while the mean value of the AD and PC signals is usually adopted in the splicing part. This conduction may make the connection between them less precise, resulting in a large error. In addition, the splicing part adopts the mean value, that is, the weight of AD and PC is 0.5, which is inconsistent with the actual situation, resulting in errors.
In this paper, a piecewise nonlinear signal splicing algorithm is developed based on the traditional splicing methods. First, according to the response equation of the PC signal, the height of the signal that is completely free from the interference of saturation effect is found, and the signal splicing region is determined. Second, the lidar signal in the splicing area is segmented according to the fluctuation of the signal. When the signal is smooth, a larger range of signal segmentation is used. For the part with greater signal volatility, the segmentation range is smaller. Then, the AD and the PC of each signal are fitted with local polynomial to obtain the best fitting parameters, and all the fitted signals are spliced together. Finally, the AD signal is used in the near field, and the PC signal is used in the far field for the selection and connection of splicing signals, which is the same as the traditional algorithms. However, for the signal splice region, the fixed mean value of AD and PC signal is no longer adopted, but the weight gradient strategy is adopted. The weight of near-field AD signal is relatively large while that of far-field PC signal is relatively large, and the transition from the near-field AD signal to the far-field PC signal is gradual, which improves the cohesion and accuracy of signals. The improved piecewise nonlinear signal splicing flow is shown in Figure 5. In this paper, piecewise nonlinear splicing is adopted, and the least squares polynomial fitting is used in signal fitting. The least squares algorithm is a basic parameter estimation method that estimates the unknown parameters in the model based on least square sum of errors according to the observation data and finds the best function match of the data by minimizing the square sum of the errors [24][25][26]. Its basic idea is to select the estimator to minimize the sum of squares of the difference between the output of the model (including static or dynamic, linear or nonlinear) and the measured output.

Measured Signal Splicing
The measured lidar echo signals are spliced by the method in this paper to evaluate the splicing effect. The data used are the echo signals of online and offline wavelengths obtained in Wuhan, China, on 3 May 2016. Figure 6 is the original signal diagram of AD and PC, which can clearly show their advantages and disadvantages.
At a low altitude, the PC signal is saturated, and the quality of the AD signal is high. With the increase of altitude, the intensity of AD signal decreases rapidly, with the decreases of SNR, while PC signal still has a high SNR at high altitude. Therefore, using PC at high altitude is more advantageous, and inversion accuracy is higher. Figure 6 illustrates the necessity of signal splicing. The figure also shows that the AD and PC signals are very similar in a certain area and have a great correlation; thus, signal splicing can be carried out completely. In this paper, piecewise nonlinear splicing is adopted, and the least squares polynomial fitting is used in signal fitting. The least squares algorithm is a basic parameter estimation method that estimates the unknown parameters in the model based on least square sum of errors according to the observation data and finds the best function match of the data by minimizing the square sum of the errors [24][25][26]. Its basic idea is to select the estimator to minimize the sum of squares of the difference between the output of the model (including static or dynamic, linear or nonlinear) and the measured output.

Measured Signal Splicing
The measured lidar echo signals are spliced by the method in this paper to evaluate the splicing effect. The data used are the echo signals of online and offline wavelengths obtained in Wuhan, China, on 3 May 2016. Figure 6 is the original signal diagram of AD and PC, which can clearly show their advantages and disadvantages. In this paper, piecewise nonlinear splicing is adopted, and the least squares polynomial fitting is used in signal fitting. The least squares algorithm is a basic parameter estimation method that estimates the unknown parameters in the model based on least square sum of errors according to the observation data and finds the best function match of the data by minimizing the square sum of the errors [24][25][26]. Its basic idea is to select the estimator to minimize the sum of squares of the difference between the output of the model (including static or dynamic, linear or nonlinear) and the measured output.

Measured Signal Splicing
The measured lidar echo signals are spliced by the method in this paper to evaluate the splicing effect. The data used are the echo signals of online and offline wavelengths obtained in Wuhan, China, on 3 May 2016. Figure 6 is the original signal diagram of AD and PC, which can clearly show their advantages and disadvantages.
At a low altitude, the PC signal is saturated, and the quality of the AD signal is high. With the increase of altitude, the intensity of AD signal decreases rapidly, with the decreases of SNR, while PC signal still has a high SNR at high altitude. Therefore, using PC at high altitude is more advantageous, and inversion accuracy is higher. Figure 6 illustrates the necessity of signal splicing. The figure also shows that the AD and PC signals are very similar in a certain area and have a great correlation; thus, signal splicing can be carried out completely. At a low altitude, the PC signal is saturated, and the quality of the AD signal is high. With the increase of altitude, the intensity of AD signal decreases rapidly, with the decreases of SNR, while PC signal still has a high SNR at high altitude. Therefore, using PC at high altitude is more advantageous, and inversion accuracy is higher. Figure 6 illustrates the necessity of signal splicing. The figure also shows that the AD and PC signals are very similar in a certain area and have a great correlation; thus, signal splicing can be carried out completely.

Dead Time Correction
Dead time is a unique phenomenon produced in PC, which refers to the discrimination and response time required by the PC detector to receive signals. If the time interval between two photons received by the detector is very short, it will cause problems in the detector's response to the previous photon and cannot effectively process and output. Therefore, the PC signal needs to be corrected for dead time. The dead time of the PC in our CO 2 -DIAL system is 7.5 ns. It is corrected according to Equation (5), and the final result is shown in Figure 7. In Figure 7, the blue line is the original PC signal, which shows that its saturation effect at a low altitude is evident, whereas the red line is the PC signal after the dead time correction: where N is the observed value, S is the real value, and τ d is the dead time of the system.

Dead Time Correction
Dead time is a unique phenomenon produced in PC, which refers to the discrimination and response time required by the PC detector to receive signals. If the time interval between two photons received by the detector is very short, it will cause problems in the detector's response to the previous photon and cannot effectively process and output. Therefore, the PC signal needs to be corrected for dead time. The dead time of the PC in our CO2-DIAL system is 7.5 ns. It is corrected according to Equation (5), and the final result is shown in Figure 7. In Figure 7, the blue line is the original PC signal, which shows that its saturation effect at a low altitude is evident, whereas the red line is the PC signal after the dead time correction: where N is the observed value, S is the real value, and τd is the dead time of the system.

Displacement Correction
In addition to the dead time problem of PC, the problem of asynchronous signal reception between AD and PC signals in signal acquisition is observed. This problem is mainly caused by the different circuit timings of the two detection modes, which shows a displacement difference between AD and PC signals, and this displacement difference needs to be corrected before signal splicing.
Although the two detection modes are not synchronized, the displacement difference generated by them is a fixed value, and the displacement difference of the system can be obtained and corrected through the observation and analysis of the signal. In practice, the difference of the cloud position in the two signals is generally used to determine the displacement. When no cloud exists, the displacement can also be determined by observing the details of the two signals.
In this paper, according to several eye-catching positions between AD and PC signals, such as the bulge in the signal, multiple adjustments are performed, and a good coincidence between AD and PC signals is observed when the displacement value between the two signals is 8. Therefore, before the splicing operation, the two signals are corrected with a displacement value of 8 in our CO2-DIAL system.

Splicing Area Selection
The selection of the splicing area mainly aims to find the region where the two signals change smoothly and have the same trend according to the change trend between two signals. According to the echo signal, this paper finally determines that the fitting area is

Displacement Correction
In addition to the dead time problem of PC, the problem of asynchronous signal reception between AD and PC signals in signal acquisition is observed. This problem is mainly caused by the different circuit timings of the two detection modes, which shows a displacement difference between AD and PC signals, and this displacement difference needs to be corrected before signal splicing.
Although the two detection modes are not synchronized, the displacement difference generated by them is a fixed value, and the displacement difference of the system can be obtained and corrected through the observation and analysis of the signal. In practice, the difference of the cloud position in the two signals is generally used to determine the displacement. When no cloud exists, the displacement can also be determined by observing the details of the two signals.
In this paper, according to several eye-catching positions between AD and PC signals, such as the bulge in the signal, multiple adjustments are performed, and a good coincidence between AD and PC signals is observed when the displacement value between the two signals is 8. Therefore, before the splicing operation, the two signals are corrected with a displacement value of 8 in our CO 2 -DIAL system.

Splicing Area Selection
The selection of the splicing area mainly aims to find the region where the two signals change smoothly and have the same trend according to the change trend between two signals. According to the echo signal, this paper finally determines that the fitting area is between 800 and 1500 m. A great correlation is noted between the AD and PC signals in this range, and signal splicing can be carried out.  Figure 8 shows the overall nonlinear relationship between the AD and PC signals in the splicing area. It can be found that the relationship between them is nonlinear on the whole. Therefore, the error of the traditional overall linear fitting method is large, and piecewise fitting and splicing the AD and PC signals is necessary.
Atmosphere 2022, 13, x FOR PEER REVIEW 8 of 13 between 800 and 1500 m. A great correlation is noted between the AD and PC signals in this range, and signal splicing can be carried out. Figure 8 shows the overall nonlinear relationship between the AD and PC signals in the splicing area. It can be found that the relationship between them is nonlinear on the whole. Therefore, the error of the traditional overall linear fitting method is large, and piecewise fitting and splicing the AD and PC signals is necessary.

Signal Splicing
Finally, the spliced signal is composed of three parts, namely, the signal in the lowaltitude area (i.e., near-field signal), the signal in the spliced area (i.e., merging signal), and the signal in the high-altitude area (i.e., far-field signal). The AD and PC signals are adopted as the near-field signal and the far-field signal, respectively, and the signal in the spliced area is the combination of the AD and PC signals. Different from the traditional splicing algorithm, the fixed mean value of AD and PC signals is no longer adopted but replaced by the weight gradient strategy. The AD signal has a high weight in the nearfield signal and a low weight in the far-field signal; the opposite is true for the PC signal. In this paper, the weights of the AD and PC signals in the spliced signal change with the height, and the weight coefficients are calculated as follows: where WAD is the weight of the AD signal, WPC is the weight of the PC signal, H is the height of the signal, Hbottom is the starting height of the splicing area, and Htop is the ending height of the splicing area. In this paper, Hbottom is 800, and Htop is 1500. Figures 9 and 10 show the splicing effect of AD and PC signals obtained by overall fitting and piecewise fitting of online and offline wavelengths, respectively. The signal before 800 m is the AD signal, which is represented by the black line. After 1500 m, it is the PC signal, which is represented by the purple line. The signal values of spliced area are calculated by Equation (7), which is represented by the red line: where IH is the intensity at height H, and IAD and IPC are the intensities of the AD and PC signals at that height, respectively.

Signal Splicing
Finally, the spliced signal is composed of three parts, namely, the signal in the lowaltitude area (i.e., near-field signal), the signal in the spliced area (i.e., merging signal), and the signal in the high-altitude area (i.e., far-field signal). The AD and PC signals are adopted as the near-field signal and the far-field signal, respectively, and the signal in the spliced area is the combination of the AD and PC signals. Different from the traditional splicing algorithm, the fixed mean value of AD and PC signals is no longer adopted but replaced by the weight gradient strategy. The AD signal has a high weight in the near-field signal and a low weight in the far-field signal; the opposite is true for the PC signal. In this paper, the weights of the AD and PC signals in the spliced signal change with the height, and the weight coefficients are calculated as follows: where W AD is the weight of the AD signal, W PC is the weight of the PC signal, H is the height of the signal, H bottom is the starting height of the splicing area, and H top is the ending height of the splicing area. In this paper, H bottom is 800, and H top is 1500. Figures 9 and 10 show the splicing effect of AD and PC signals obtained by overall fitting and piecewise fitting of online and offline wavelengths, respectively. The signal before 800 m is the AD signal, which is represented by the black line. After 1500 m, it is the PC signal, which is represented by the purple line. The signal values of spliced area are calculated by Equation (7), which is represented by the red line: where I H is the intensity at height H, and I AD and I PC are the intensities of the AD and PC signals at that height, respectively.

Evaluation and Discussion
In this paper, the accuracy of the algorithm is evaluated from two aspects: On the one hand, the coefficient of determination (R 2 ) and the residual sum of squares (RSS) are used for direct evaluation. On the other hand, DAOD is used to evaluate the quality of the signal indirectly.
In statistics, R 2 is used to describe the nonlinear or correlation between two or more independent variables and is an evaluation indicator of the fitting regression effect. The magnitude of R 2 determines the closeness of the correlation. The closer R 2 is to 1, the better the fitting regression effect and the higher the reference value of the relevant results; on the contrary, the closer R 2 is to 0, the lower the reference value is indicated. RSS is a measure of the model fitting degree in the linear model. It is a data processing method that describes or compares discrete point groups on plane approximately with continuous curves to express functional relations between coordinates. In order to clarify the effects of explanatory variables and random errors, statistically, the difference between the data point and its corresponding position on the regression line is called residual, and the sum of the squares of each residual is called the RSS, which represents the effect of random errors. The smaller the RSS of a set of data, the better the fit. In this experiment, higher R 2 and lower RSS indicate better signal quality.

Evaluation and Discussion
In this paper, the accuracy of the algorithm is evaluated from two aspects: On the one hand, the coefficient of determination (R 2 ) and the residual sum of squares (RSS) are used for direct evaluation. On the other hand, DAOD is used to evaluate the quality of the signal indirectly.
In statistics, R 2 is used to describe the nonlinear or correlation between two or more independent variables and is an evaluation indicator of the fitting regression effect. The magnitude of R 2 determines the closeness of the correlation. The closer R 2 is to 1, the better the fitting regression effect and the higher the reference value of the relevant results; on the contrary, the closer R 2 is to 0, the lower the reference value is indicated. RSS is a measure of the model fitting degree in the linear model. It is a data processing method that describes or compares discrete point groups on plane approximately with continuous curves to express functional relations between coordinates. In order to clarify the effects of explanatory variables and random errors, statistically, the difference between the data point and its corresponding position on the regression line is called residual, and the sum of the squares of each residual is called the RSS, which represents the effect of random errors. The smaller the RSS of a set of data, the better the fit. In this experiment, higher R 2 and lower RSS indicate better signal quality.

Evaluation and Discussion
In this paper, the accuracy of the algorithm is evaluated from two aspects: On the one hand, the coefficient of determination (R 2 ) and the residual sum of squares (RSS) are used for direct evaluation. On the other hand, DAOD is used to evaluate the quality of the signal indirectly.
In statistics, R 2 is used to describe the nonlinear or correlation between two or more independent variables and is an evaluation indicator of the fitting regression effect. The magnitude of R 2 determines the closeness of the correlation. The closer R 2 is to 1, the better the fitting regression effect and the higher the reference value of the relevant results; on the contrary, the closer R 2 is to 0, the lower the reference value is indicated. RSS is a measure of the model fitting degree in the linear model. It is a data processing method that describes or compares discrete point groups on plane approximately with continuous curves to express functional relations between coordinates. In order to clarify the effects of explanatory variables and random errors, statistically, the difference between the data point and its corresponding position on the regression line is called residual, and the sum of the squares of each residual is called the RSS, which represents the effect of random errors. The smaller the RSS of a set of data, the better the fit. In this experiment, higher R 2 and lower RSS indicate better signal quality. The parameters R 2 and RSS of the spliced signal are recorded in Table 1. It can be clearly found that the piecewise fitting method has better evaluation parameters and higher accuracy than the overall fitting method.  Figure 11 shows the linear relationship between the AD signal and the AD signal converted from the PC signal in the splicing area after piecewise fitting. Compared with Figure 8, linearity is improved, indicating that the proposed splicing algorithm is better than the traditional signal splicing algorithm.
Atmosphere 2022, 13, x FOR PEER REVIEW 10 of 13 The parameters R 2 and RSS of the spliced signal are recorded in Table 1. It can be clearly found that the piecewise fitting method has better evaluation parameters and higher accuracy than the overall fitting method.  Figure 11 shows the linear relationship between the AD signal and the AD signal converted from the PC signal in the splicing area after piecewise fitting. Compared with Figure 8, linearity is improved, indicating that the proposed splicing algorithm is better than the traditional signal splicing algorithm.   Figure 11. Linear relationship between AD signal and AD signal converted from PC signal after piecewise fitting.
Finally, the DAOD of the spliced signals is calculated, and the results are shown in Figure 12. The fitting effect of the DAOD is good, indicating that the proposed splicing algorithm can well complete the splicing work of the near-field AD signal and the far-field PC signal. Finally, the DAOD of the spliced signals is calculated, and the results are shown in Figure 12. The fitting effect of the DAOD is good, indicating that the proposed splicing algorithm can well complete the splicing work of the near-field AD signal and the far-field PC signal.
The measured results show that the piecewise nonlinear algorithm proposed in this paper can accurately splice the AD and PC signal of ground-based CO 2 -DIAL. At the same time, it cannot be denied that there are some defects in the current method, such as the large artificial interference factors in the splicing process, which will lead to some errors. At present, we are working on new algorithms to realize fully automatic nonlinear piecewise signal splicing and real-time display of inversion results.  The measured results show that the piecewise nonlinear algorithm proposed in this paper can accurately splice the AD and PC signal of ground-based CO2-DIAL. At the same time, it cannot be denied that there are some defects in the current method, such as the large artificial interference factors in the splicing process, which will lead to some errors. At present, we are working on new algorithms to realize fully automatic nonlinear piecewise signal splicing and real-time display of inversion results.

Conclusions
In this paper, a segmented nonlinear signal splicing algorithm is proposed to extend the dynamic detection range and improve the signal quality for the problem of low SNR and short detection range of echo signals in the ground-based CO2-DIAL data acquisition. Compared with the traditional signal splicing algorithm, this paper mainly made improvements in the following aspects. First, the traditional signal splicing algorithms are mostly overall linear splicing, whereas the measured AD and PC signals are generally not linear; thus, splicing errors are likely. The piecewise nonlinear splicing algorithm is used to splice AD and PC signals. Signal volatility (coefficient of variation between adjacent points) is used to segment the signal, and then polynomial fitting is performed on each segment to improve the accuracy of signal splicing. Second, the traditional method uses AD signals in the near field and PC signals in the far field, whereas the splicing part generally uses the mean value of AD and PC signals, which may make the connection between these three parts less accurate. In addition, the splicing part adopts the mean value of AD and PC signals, that is, the weight of AD and PC is fixed at 0.5, which is unreasonable and prone to large errors. The weight coefficients of the AD and PC signals are assigned according to the height of the spliced signal. The AD signal in the low-altitude signal takes up more weight while the PC signal in the high-altitude signal takes up more weight. This algorithm is designed to ensure that the signal of each segment is spliced accurately and smoothly, improving the quality of the signal.
Finally, R 2 and RSS are used to evaluate the quality of signal splicing. The results show that compared with the traditional overall linear splicing of signals, the proposed piecewise nonlinear splicing algorithm has a great improvement in accuracy. The R 2 and RSS of the online wavelength are increased from 0.905 and 263.65 in the traditional splicing algorithm to 0.992 and 76.963, respectively. The R 2 and RSS of offline wavelength are increased from 0.890 and 335.39 in the traditional splicing algorithm to 0.988 and 53.322, respectively. Then, the DAOD of the spliced signal is calculated. The R 2 of the DAOD

Conclusions
In this paper, a segmented nonlinear signal splicing algorithm is proposed to extend the dynamic detection range and improve the signal quality for the problem of low SNR and short detection range of echo signals in the ground-based CO 2 -DIAL data acquisition. Compared with the traditional signal splicing algorithm, this paper mainly made improvements in the following aspects. First, the traditional signal splicing algorithms are mostly overall linear splicing, whereas the measured AD and PC signals are generally not linear; thus, splicing errors are likely. The piecewise nonlinear splicing algorithm is used to splice AD and PC signals. Signal volatility (coefficient of variation between adjacent points) is used to segment the signal, and then polynomial fitting is performed on each segment to improve the accuracy of signal splicing. Second, the traditional method uses AD signals in the near field and PC signals in the far field, whereas the splicing part generally uses the mean value of AD and PC signals, which may make the connection between these three parts less accurate. In addition, the splicing part adopts the mean value of AD and PC signals, that is, the weight of AD and PC is fixed at 0.5, which is unreasonable and prone to large errors. The weight coefficients of the AD and PC signals are assigned according to the height of the spliced signal. The AD signal in the low-altitude signal takes up more weight while the PC signal in the high-altitude signal takes up more weight. This algorithm is designed to ensure that the signal of each segment is spliced accurately and smoothly, improving the quality of the signal.
Finally, R 2 and RSS are used to evaluate the quality of signal splicing. The results show that compared with the traditional overall linear splicing of signals, the proposed piecewise nonlinear splicing algorithm has a great improvement in accuracy. The R 2 and RSS of the online wavelength are increased from 0.905 and 263.65 in the traditional splicing algorithm to 0.992 and 76.963, respectively. The R 2 and RSS of offline wavelength are increased from 0.890 and 335.39 in the traditional splicing algorithm to 0.988 and 53.322, respectively. Then, the DAOD of the spliced signal is calculated. The R 2 of the DAOD reaches 0.909, indicating that the quality is high, which is conducive to the high-precision inversion of CO 2 . The proposed signal splicing algorithm is not only applicable to ground-based CO 2 -DIAL but can also be used for signal splicing in other systems to expand the dynamic detection range and improve signal quality.

Author Contributions:
The study was completed with cooperation between all authors. C.X. and A.L. designed the research topic; C.X. conducted the experiment; A.L. checked and analyzed the experimental results; C.X. wrote the paper. All authors have read and agreed to the published version of the manuscript.