1. Introduction
Spatial Heterodyne Spectroscopy (SHS) is an advanced spectral analysis technique that enables high-resolution and high-sensitivity spectral measurements [
1,
2,
3,
4]. It has been applied in research related to the detection of atmospheric gases such as oxygen and carbon dioxide. However, during actual measurements, the interferograms collected by SHS instruments often contain phase errors due to various interfering factors, which reduces the accuracy of spectral reconstruction [
5,
6,
7]. Traditional phase correction methods, such as those developed by Mertz and Forman, correct phase errors by interpolating low-frequency phase errors and extending them to high-frequency regions. However, these methods exhibit significant correction residuals for nonlinear phase errors that do not vary smoothly with optical path differences or incident light frequency, resulting in limited effectiveness for correcting phase errors in SHS systems [
8]. To address this issue, Englert et al. proposed a convolution correction method, which first extracts the single-sided spectrum from the interferogram, then estimates the phase error using the inverse Fourier transform, and finally derives the phase correction function to implement convolution correction [
9,
10]. Shi et al. utilized continuously tunable monochromatic light to measure the actual phase corresponding to each wavelength. They combined this with the theoretical phase obtained from frequency calibration and performed convolution in the spectral domain to eliminate phase errors [
11]. Current calibration methods require phase error calibration on the ground before correction; however, factors in the space environment can cause changes in instrument parameters, rendering the phase information obtained under ground conditions no longer applicable. Additionally, accurately acquiring phase errors on satellites is quite challenging. Therefore, developing a novel phase correction method that does not rely on prior phase error information has become an urgent issue that needs to be addressed.
Recurrent Neural Networks (RNNs) [
12,
13,
14] can learn and model the mapping relationship of phase errors in interferograms, thereby achieving phase error correction. This method overcomes the limitation of requiring prior phase error information for phase correction and does not necessitate complex preprocessing of the raw data. It also provides relatively stable correction results for different phase error surfaces. Therefore, based on the fundamental principles of spatial heterodyne spectroscopy, this paper proposes a spatial heterodyne interferogram phase correction method based on Recurrent Neural Network to address phase errors in interferograms. The method’s effectiveness has been validated through comparative analysis of pre- and post-correction spectral residuals against error-free reference spectra. Furthermore, using standard deviation and mean absolute error as evaluation metrics, comparative studies with conventional convolution-based correction methods establish the superior performance of the proposed RNN approach in phase correction applications.
2. Phase Error Correction Using RNN
RNN is a type of feedforward neural network that can receive and process feedback information [
15,
16,
17,
18], where both past and current inputs influence the current output. There exists a certain relationship between the spectral data without phase errors and that with phase errors; RNN models can establish an inverse mapping relationship between the two.
When using the RNN model to correct phase errors, the interferogram is taken as input to learn the phase error patterns through multiple time steps. At each time step, the RNN combines the current input with the hidden state from the previous time step to generate phase error predictions for correcting the phase errors in the interferogram. During the training phase, the RNN utilizes known interferograms and accurate phase information for supervised learning, optimizing the network parameters by minimizing the difference between predicted errors and actual errors. Since RNNs may encounter problems of vanishing or exploding gradients when processing long sequences, selecting an appropriate optimization algorithm is crucial for training the RNN. The Adam optimization algorithm can effectively handle variations in different gradients, accelerating training, improving the model’s convergence speed, and making the RNN more stable when dealing with complex sequence data [
19,
20]. Therefore, this study employs the Adam algorithm to optimize the RNN.
The process of correcting phase errors using RNN is as follows: First, it is necessary to simulate m original spectra of incident light at different frequencies and their corresponding error-free interferograms. Then, the same phase error surface is applied to these m interferograms, and a Fourier transform is performed to obtain m spectra with errors. The error-free spectra and their corresponding spectra with errors are treated as a set of data, resulting in m data pairs. These data pairs are then divided into two parts: n1 training sets and n2 testing sets. The spectra with errors in the training set serve as input variables, while the error-free spectra serve as output variables for model training. The trained model can then be used to correct the spectra with errors in the testing set. The effectiveness of the correction can be assessed by comparing the corrected data with the error-free data in the testing set.
3. Simulation with Phase Error-Containing Data
The accuracy of the RNN model is related to the size of the training dataset; a larger dataset results in higher model accuracy. In practical applications, obtaining a large amount of experimental data from known light sources is quite challenging. To ensure the reliability of the research data and facilitate subsequent comparative analysis, this study employs a simulation method to generate experimental data. This simulation takes the oxygen absorption band (756.9 nm–786.4 nm) as the study object, and the generated interferogram size is 1024. To simulate spectra with phase errors, it is necessary to first simulate error-free spectra and the phase error surface.
The phase errors of the spatial heterodyne spectrometer exhibit a two-dimensional (2D) surface characteristic. By measuring a series of interferograms from monochromatic light sources, the phase error curves corresponding to each characteristic frequency can be calculated, and then the complete 2D phase error distribution field can be reconstructed using interpolation methods. The phase error curves corresponding to four different frequencies obtained through simulation are shown in
Figure 1a. Among them, curves 3 and 4 exhibit significant peaks, indicating that the phase error varies sharply with pixel position at the corresponding frequencies. In contrast, curves 1 and 2 are relatively flat overall, indicating that the phase error varies more steadily.
Due to the complex variations in phase errors influenced by multiple factors, significant differences in phase errors with respect to pixel positions exist at different frequencies. Therefore, it is essential to employ an appropriate interpolation method to reconstruct the phase error surface. The Lagrange interpolation method is chosen for its high precision and good flexibility, making it suitable for this interpolation task. The phase error surface obtained from the simulation is shown in
Figure 1b.
By introducing the phase error surface into the error-free interferogram, the interferogram with corresponding phase errors can be obtained. The interferogram with phase errors can be expressed as [
10]:
Here, represents the spectral intensity, denotes the frequency, indicates the position of the detector pixel, and signifies the phase error. The Fourier-transformed spectrum corresponds to the spectrum that includes these errors.
The spectra without phase errors and those with phase errors are shown in
Figure 2. Comparing with the spectrum without phase errors, it can be observed that in the wavelength range of 757 nm to 760 nm, the spectrum with phase errors exhibits slight fluctuations. In the wavelength range of 779 nm to 786.4 nm, the spectrum with phase errors shows a significant increase in amplitude and the presence of numerous spikes, leading to a noticeable decline in spectral quality. Therefore, it is necessary to perform phase error correction on the spectra with phase errors to enhance spectral accuracy.
4. RNN-Based Method for Phase Error Correction
To improve model accuracy, this study simulates 600 sets of spectral data, with 500 sets used as the training set and the remaining 100 sets as the testing set. The number of hidden units in the RNN is set to 100, and the network architecture includes a sequential input layer, two fully connected layers, and a regression layer. The specific parameter settings are shown in
Table 1. Some tuning and cross-validation were conducted during parameter selection.
The model obtain from training is used to correct 100 sets of spectral data with errors in the testing set. The results of the corrected spectra with errors, shown in
Figure 2b, are illustrated in
Figure 3a. In the wavelength ranges of 757 nm to 760 nm and 779 nm to 786.4 nm, the spectra are much smoother, the spikes have been completely removed, and the profiles are consistent with the error-free spectra.
Figure 3b shows the residuals before and after the correction of the spectra with errors. The range of residuals decreased from −2.2 to 1.8 before correction to −0.04 to 0.04 after correction, indicating a significant improvement. The average standard deviation of the 100 sets of spectra with errors in the testing set compared to the error-free spectra decreased from 0.120 before correction to 0.015 after correction. This demonstrates that the RNN can achieve effective correction without relying on known phase errors.
5. Generalizability of RNN-Based Phase Error Correction
In practical applications, a phase error surface corresponds only to the error characteristics of a specific instrument. Therefore, multiple phase error surfaces are needed to validate the applicability of the RNN model. This study simulates the generation of 12 differently distributed phase error surfaces, along with 600 sets of spectral data corresponding to each phase error surface (each set containing both error-free and error-containing spectra). For the 600 sets of spectral data corresponding to each phase error surface, 500 sets are used for training and 100 sets for testing. The RNN and convolution methods are used to correct the 100 spectra with errors in the testing set, and a comparative analysis is conducted. The convolution method requires prior knowledge of the phase errors for correction, while the RNN does not. By calculating the standard deviations of the 100 spectra before and after correction in the testing set and averaging the results, the results are as shown in
Table 2.
As shown in
Table 2, the range of standard deviations before phase error correction is 0.155 to 0.710, with significant fluctuation, indicating that different phase errors have a large impact on the spectra. After correction using the convolution-based correction method, the standard deviation shows improvement, reducing to 0.0697 to 0.615. However, in some cases, such as in the 2nd, 5th, and 10th sets of data, the corrected standard deviation is larger than the pre-correction value, indicating that the convolution-based correction method fails to effectively correct spectra with three phase error. In contrast, the standard deviation after correction using the RNN method is the lowest and most stable, demonstrating the superior stability and consistency of this method.
To more intuitively validate the superiority of the RNN algorithm, the correction results of the two methods corresponding to the two different 2D phase error surfaces in the table are selected as representative cases, specifically the 2nd and 7th datasets. Among these, the 2nd dataset serves to evaluate the correction performance when the phase error is large, while the 7th dataset serves to evaluate the correction performance when the phase error is small.
The phase error surface for the 2nd data set is shown in
Figure 4a, with an amplitude range from −150 to 150 rad. The standard deviation before correction is relatively large, indicating a significant impact on the accuracy of the data. An arbitrary spectrum from the testing set of the 2nd data set (which contains 100 spectra) is selected, and the residual curves after correction using both methods are shown in
Figure 4b. In
Figure 4b, the purple curve represents the residual after correction using the convolution method, while the blue curve represents the residual after correction using the RNN method. In the wavelength range of 756 nm to 776 nm, both the uncorrected and corrected residual curves are relatively stable, with the RNN residual curve showing the smallest amplitude and the convolution method showing the largest. In the wavelength range of 776 nm to 786 nm, the residuals of the uncorrected spectra exhibit significant fluctuations, and the residual curve after correction with the convolution method remains highly variable, indicating poor correction performance. In contrast, the residual amplitude after RNN correction is significantly reduced and shows smoother fluctuations. The Root Mean Square Error (RMSE) after correction using the convolution method is 0.4033, while the RMSE after RNN correction is 0.0430. Therefore, it can be concluded that the convolution method is not suitable for correcting larger phase errors, while the RNN method can effectively correct for larger phase errors, demonstrating excellent correction capability across the entire wavelength range.
The phase error surface for the 7th data set is shown in
Figure 5a, with an amplitude range from −100 to 100 rad. There is only one noticeable peak on the surface, and the standard deviation before correction is relatively small, indicating a minor impact on the accuracy of the data. The residual curves after correction using both methods for an arbitrary spectrum with errors from the testing set are shown in
Figure 5b. Compared to the 2nd data set, the residual curve of the 7th data set has a significantly smaller amplitude. In the wavelength range of 756 nm to 779 nm, the residuals before and after correction fluctuate around zero, but in the range of 779 nm to 786 nm, the uncorrected residuals exhibit large fluctuations. The residual values decrease after correction using the convolution method, and the residual curve after RNN correction is much smoother, significantly reducing the deviation between the predicted and error-free spectra. The RMSE after correction using the convolution method is 0.1418, while the RMSE after RNN correction is 0.0312. Thus, it can be seen that for smaller phase errors, the convolution method has some correction capability, but it is not as effective as the RNN method.
By calculating the Mean Absolute Error (MAE) of 600 different spectra corrected under the same phase error surface, we can comprehensively evaluate the correction effects of the convolution method and the RNN method.
Figure 6 shows the phase error surface used to test the Mean Absolute Error, which exhibits a complex undulating shape, indicating that the influence of this phase error surface on the interference pattern is quite complex.
Table 3 shows the extreme values of the Mean Absolute Error (MAE) after correction using the convolution method and the RNN method. The MAE extreme value of the convolution method is relatively large, indicating a certain applicability to the phase error surface and making it suitable for scenarios where high accuracy is not critical. In contrast, the MAE extreme value of the RNN method is smaller, demonstrating high prediction accuracy and enabling precise handling of data with complex phase error characteristics, thus providing strong support for high-precision spectral predictions.
6. Conclusions
The spatial heterodyne spectrometer, as a high-precision detection instrument, is subject to changes in its system parameters in a space environment. Such changes can directly interfere with the phase accuracy of the interference data, ultimately leading to deviations in the spectral inversion results. To address this issue, this paper proposes a phase correction method for spatial heterodyne interference patterns based on recurrent neural network (RNN). This method first trains a model based on the mapping relationship between error-free spectra and error-containing spectra, and employs the trained model to correct the error-containing spectra. Experimental results indicate that for phase error surfaces of the same complexity, the spectral residuals and standard deviations after RNN correction are significantly reduced, and the extreme values of the mean absolute error are smaller than those obtained by the convolution method. For phase error surfaces of varying complexity, the RNN-based correction method consistently outperforms the original data and the convolution-based method. The RMSE after RNN correction is one order of magnitude smaller than that achieved by the convolution method. This advantage of RNN becomes particularly pronounced when the amplitude of the phase error is large. Thus, the RNN method can achieve effective correction even in the absence of prior phase error information and demonstrates excellent correction accuracy and applicability for large amplitude errors. However, compared to the convolution-based method, the approach proposed in this paper requires a large amount of real data for model training, and its processing time still needs further optimization. The types of phase error surfaces tested in this study are limited, which may not encompass all potential error patterns. Therefore, further exploration is needed on how to extend this method to cover a broader range of phase errors.