Raman-based distributed temperature sensor is widely used in power grid monitoring  , mine safety monitoring  , nuclear environmental safety monitoring  and other fields due to its strong resistance to electromagnetic and radiative interference and excellent distributed measurement capability.
The accuracy of temperature measurement of RDTS is susceptible to the inherent loss of the sensing optical fiber and the random noise generated by different noise sources. The excessively high random noise greatly reduces the accuracy of temperature measurement of RDTS. In order to reduce the adverse effects of random noise on the accuracy of temperature measurement of RDTS, the researchers improved the signal-to-noise ratio (SNR) of the sensing signals by changing the hardware structure of RDTS   or using digital signal processing algorithms   and digital image processing algorithms   to process the sensing signals. In these three different ways, the way to change the hardware structure is complicated and costly. In comparison, it is more flexible and economical to use digital signal processing algorithms to improve the SNR of the sensing signals. The digital image processing algorithm is used to improve the SNR of the sensing signal, which takes a lot of computation time and requires a high hardware configuration of the computer. In contrast, the use of digital signal processing algorithms to improve the SNR of the sensing signal requires less computation time and requires less hardware configuration for the computer.
In the research of using digital signal processing algorithms to improve the measurement accuracy of fiber-optics sensors, it is common to use wavelet transform (WT) algorithm to filter out random noise  . However, the WT algorithm is easy to cause distortion of the temperature abrupt regions of RDTS while filtering out noise, and the effect of improving the measurement accuracy of the sensor is limited. In order to try to reduce this adverse effect, this paper proposes a noise reduction approach for RDTS based on nonlinear filter, which can filter out random noise more effectively and improve the accuracy of temperature measurement of RDTS.
2.1. Raman-Based Temperature Sensing Principle
In Raman-based distributed fiber-optics temperature sensor, the semiconductor laser injects a certain power light pulse into the sensing fiber under the control of the synchronization pulse. Then, the temperature-modulated Raman backscattered light passes through the wavelength division multiplexer (WDM) to separate Stokes light and anti-Stokes light. And the two optical signals are converted into an electrical signal by Avalanche Photo Diode (APD)  . Finally, the temperature distribution information carried in the signal is demodulated by the data collected by the data acquisition (DAQ) card.
The intensity of Stokes light is one order of magnitude higher than the intensity of anti-Stokes light, and the sensitivity of these two lights to temperature is different. Anti-Stokes light is more sensitive to temperature changes, and Stokes light is often used as a reference for demodulating anti-Stokes light, which can effectively eliminate the effects of source jitter, fiber bending, and other factors. The ratio of the intensity of the anti-Stokes light to the intensity of the Stokes light has the following relationship with temperature  :
where and are the intensity of anti-Stocks light and Stocks light, respectively; and are the frequency of anti-Stocks light and Stocks light, respectively; is the Planck constant, ; is the speed of light in a vacuum, ; is the number of waves; is absolute temperature; is the Boltzmann constant, .
2.2. Noise Reduction Method Based on Median Filtering for RDTS
The median filtering algorithm (MF) is a nonlinear filtering method   , which is widely used in image denoising  , one-dimensional signal processing  and other fields. The basic principle of median filtering is to suppress the noise in the signal by replacing the value of each element in the digital signal sequence with the median of the element values in one of its neighborhood window. For noise in a signal, its value tends to be greater or less than the value of the normal component of the signal. A suitable length neighborhood window allows more noise components to be replaced by the normal components of the signal in its neighborhood. For the one-dimensional fiber-optics sensing signal sequence , after the median filtering process, the denoised sequence can be expressed as  
where n is the length of the neighborhood window. The process of processing the raw sensing signal by MF is as shown in Figure 1.
The selection of the appropriate window length is very important for the improvement of the accuracy of the MF algorithm to the measurement results of RDTS. In order to quantitatively evaluate the improvement effect of the different methods on the accuracy of the measurement results of RDTS, we measure the accuracy of the measurement results by the maximum deviation (MD) and the root mean square error (RMSE)  . The MD is expressed as
where are the observed temperatures of the temperature abrupt zone measured by RDTS; is the actual temperature of the temperature abrupt zone measured by the mercury thermometer; is the number of effective measurements of the temperature abrupt zone. The RMSE is expressed as
3. Experimental Setup
The experimental device is shown in Figure 2. The temperature of the constant
Figure 1. Flow chart for processing the raw sensing signal by MF.
Figure 2. Experimental device diagram.
temperature water bath is set to 40.0˚C, 50.0˚C, and 60.0˚C, respectively. And the length of the sensing fiber placed in the constant temperature water bath (the length of the three hot zones) is 15 m, 20 m, and 30 m, respectively. The spacing between the hot zones is set to 15 m and 20 m, respectively. The sampling frequency of the data acquisition card is set to 100 MHz, and the number of time domain traces averaging is set to 10,000. The data processing software is MATLAB 2017a, Windows 10 Professional 64-bit, and the computer is configured as Intel i5-4200M, 2.5 GHz, 4 GB RAM, and 256 GB SSD.
4. Results and Discussion
4.1. Overall Effect of Noise Reduction
The temperature information carried by the anti-Stokes signal and the Stokes signal obtained by the above experiment is demodulated by Equation (1), and the demodulation result of the raw data is shown in Figure 3. Before using Equation (1) to demodulate the temperature information, the median filtering algorithm of different length neighborhood windows, wavelet hard threshold method (WT-Hard), and wavelet soft threshold method (WT-Soft) are used to denoise the raw data. The demodulation results of these denoised signals are shown in Figure 4 and Figure 5.
As shown in Figure 3, the temperature information of the raw data processed without denoising algorithm is interspersed with more interference information caused by noise, which greatly reduces the accuracy of the temperature measurement results of RDTS. The accuracy of the temperature measurement results of the signals denoised by the median filtering algorithm is greatly improved, as shown in Figure 4.
Specifically, the average maximum deviation of the temperature measurement results of the signals denoised by the median filtering algorithm with a window length of 10 (10-MF) is reduced from 4.1˚C to 2.6˚C at 40˚C, 50˚C, and 60˚C. The average maximum deviation of the temperature measurement results of the signals denoised by the median filtering algorithm with a window length of 15 (15-MF) is slightly increased from 4.1˚C to 4.4˚C at 40˚C, 50˚C, and 60˚C. The average maximum deviation of the temperature measurement results of the signals denoised by the median filtering algorithm with a window length of 20 (20-MF) is slightly increased from 4.1˚C to 1.4˚C at 40˚C, 50˚C, and 60˚C. The average
Figure 3. Temperature curve with raw data.
Figure 4. Temperature curve with MF. (a) Temperature curve with 10-MF; (b) Temperature curve with 15-MF; (c) Temperature curve with 20-MF; (d) Temperature curve with 25-MF.
Figure 5. Temperature curve with WT. (a) Temperature curve with WT-Hard; (b) Temperature curve with WT-Soft.
maximum deviation of the temperature measurement results of the signals denoised by the median filtering algorithm with a window length of 25 (25-MF) is slightly increased from 4.1˚C to 1.2˚C at 40˚C, 50˚C, and 60˚C.
As shown in Figure 4 and Figure 5, compared with the wavelet threshold method commonly used to improve the signal-to-noise ratio of fiber-optics sensor, the median filtering algorithm with appropriate window length can better improve the accuracy of temperature measurement of RDTS. The WT-Hard and WT-Soft make the edge of the abrupt temperature region appear distortion which is not present in the demodulation result of Raw data. These distortions greatly reduce the accuracy of temperature measurement.
4.2. Evaluation of Noise Reduction Effect
4.2.1. Maximum Deviation (MD)
The maximum deviation of the temperature measurement is calculated by Equation (3). As shown in Figure 6, the MF with appropriate window length (such as 20-MF, 25-MF) is better than WT-Hard and WT-Soft in the MD of temperature measurement results. WT-Hard and WT-Soft cause distortion at the edges of temperature-mutation regions so that they are not as good as Raw data in terms of the MD of temperature measurements.
4.2.2. Root Mean Square Error (RMSE)
The root mean square error of the temperature measurement is calculated by Equation (4). As shown in Figure 7, compared to WT-Hard and WT-Soft, the MF can better reduce the RMSE of temperature measurements. Especially after choosing the appropriate window length (such as 20-MF, 25-MF), the improvement effect is far better than the improvement effect brought by WT-Hard and WT-Soft. WT-Hard and WT-Soft cause the distortion of the edge of the temperature-mutation region so that the improvement effect they brought is not significant, especially WT-Hard, which has a slight improvement effect.
Figure 6. Maximum deviation.
Figure 7. Root mean square error.
Aiming at the problem of the adverse effect of random noise on temperature measurement accuracy in RDTS, we propose a noise reduction method based on nonlinear filtering of median filter to improve the accuracy of temperature measurement of RDTS. Compared with the demodulation results of Raw data, the method proposed in this paper can greatly improve the accuracy of temperature measurement of RDTS. Compared with the commonly used WT method, the method proposed in this paper can better improve the accuracy of temperature measurement of RDTS. The method proposed in this paper is better at both the maximum deviation and RMSE of temperature measurement results of RDTS, especially the median algorithm after selecting the appropriate window length. Therefore, this paper proposes an effective and available method to improve the accuracy of temperature measurement of RDTS. We think that further research on noise adaptive nonlinear filtering algorithms may provide a potential solution to the problem of how to select the appropriate window length for the RDTS sensing signals with different SNR.
This work was supported by the funds of Science Plans of Sichuan Province, China under Grant 2018SZ0347 and Grant 17CZ0004.
 Liu, Y., Lei, T., Sun, Z.-H., Wang, C. and Liu, T.-Y. (2012) Application of Distributed Optical Fiber Temperature System in Online Monitoring and Fault Diagnosis of Smart Grid. 2012 Asia-Pacific Power and Energy Engineering Conference, Shanghai, 27-29 March 2012, 1-4.
 Liu, Y., Lei, T., Sun, Z.-H., Wang, C. and Liu, T.-Y. (2012) Application of Distributed Optical Fiber Temperature Sensing System Based on Raman Scattering in Coal Mine Safety Monitoring. 2012 Symposium on Photonics and Optoelectronics, 21-23 May 2012, Shanghai, 1-4.
 Cangialosi, C., Ouerdane, Y., Girard, S., Boukenter, A., Delepine-Lesoille, S., Bertrand, J., et al. (2014) Development of a Temperature Distributed Monitoring System Based On Raman Scattering in Harsh Environment. IEEE Transactions on Nuclear Science, 61, 3315-3322.
 Lee, D., Yoon, H., Kim, P., Park, J. and Park, N. (2006) Optimization of SNR Improvement in the Noncoherent OTDR Based on Simplex Codes. Journal of Lightwave Technology, 24, 322-328.
 Baronti, F., Lazzeri, A., Roncella, R., Roberto, S., Alessandro, S., Soto, M.A., et al. (2010) SNR Enhancement of Raman-Based Long-Range Distributed Temperature Sensors Using Cyclic Simplex Codes. Electronics Letters, 46, 1221-1223.
 Saxena, M.K., Raju, S.D.V.S.J., Arya, R., Pachori, R.B., Ravindranath, S.V.G., Kher, S. and Oaka, S.M. (2015) Raman Optical Fiber Distributed Temperature Sensor Using Wavelet Transform Based Simplified Signal Processing of Raman Backscattered Signals. Optics & Laser Technology, 65, 14-24.
 Soto, M.A., Ramírez, J.A. and Thévenaz, L. (2016) Intensifying the Response of Distributed Optical Fibre Sensors Using 2D and 3D Image Restoration. Nature Communications, 7, Article ID: 10870.
 Soto, M.A., Ramírez, J.A. and Thévenaz, L. (2017) Image and Video Denoising for Distributed Optical Fibre Sensors. 25th International Conference on Optical Fiber Sensors, Jeju, Korea, 23 April 2017, 103230K.
 Dakin, J.P., Pratt, D.J., Bibby, G.W. and Ross, J.N. (1985) Distributed Optical Fibre Raman Temperature Sensor Using a Semiconductor Light Source and Detector. Electronics Letters, 21, 569-570.
 Gallagher, N. and Wise, G. (1981) A Theoretical Analysis of the Properties of Median Filters. IEEE Transactions on Acoustics, Speech, and Signal Processing, 29, 1136-1141.
 Cao, G., Zhao, Y., Ni, R.-R., Yu, L.-F. and Tian, H.-W. (2010) Forensic Detection of Median Filtering in Digital Images. 2010 IEEE International Conference on Multimedia and Expo, 19-23 July 2010, Suntec City, Singapore, 89-94.
 Verma, R., Mehrotra, R. and Bhateja, V. (2013) An Integration of Improved Median and Morphological Filtering Techniques for Electrocardiogram Signal Processing. 2013 3rd IEEE International Advance Computing Conference (IACC), Ghaziabad, India, 22-23 February 2013, 1223-1228.