## 4 Analysis of Spectral Shift Demodulation Methods for Simulation Data  
The centroid method is used as the simplest demodulation method, which determines the equivalent of the centre of gravity of spectrum \(R(\lambda)\):  
\[\lambda_{B}=\frac{\sum_{n}\lambda_{B}\cdot R(\lambda_{n})}{\sum_{n}R(\lambda_ {n})}. \tag{17}\]  
The centroid is most often calculated for wavelengths for which the reflectivity value exceeds a specified value relative to the maximum value. For a symmetric spectrum, the centre of gravity coincides with the maximum value of the spectrum. For asymmetric spectra, the centre of gravity differs from the Bragg wavelength and the maximum value of the reflectivity of the spectrum. As a demodulation method for comparing the properties of denoising methods, the cross-correlation algorithm is used, which has good properties and is also resistant to distortions of the grating spectrum [31]. The cross-correlation function between two spectra \(R0\) and \(R1\) can be determined as follows:  
\[C_{j}=\sum_{i=0}^{N-1}R_{0}(\lambda_{i})R_{1}\big{(}\lambda_{i+j}\big{)}, \tag{18}\]  
for \(j=0\), \(1\), \(2\), \(\ldots\), \((2N-1)\). Cross-correlation can be efficiently calculated in the Fourier transform domain [32]. The analysis of the cross-correlation function can be performed using the centroid algorithm or by calculating the Hilbert transform [3]. The secondimportant method of determining the shift is the fast phase correlation (FPC) method, which consists of determining the phase difference in the Fourier transform domain between the transform of the considered spectrum \(F1=FFT(R_{1})\) and the transform of the reference spectrum \(F_{0}=FFT(R_{0})\). For individual frequencies, the spectral shift can be determined as follows:  
\[\Delta\lambda_{k}=(\angle_{k}FFT(R1)-\angle_{k}FFT(R0))\cdot\frac{N\cdot\delta \lambda}{2\pi k}. \tag{19}\]  
where \(k=1,2,\ldots,(N-1)\), because, for \(k=0\), we are dealing with a constant component, which always has a real value. The final value of the wavelength shift is the median of the shifts determined for the first dozen (several dozen) frequencies \(K\)[4]:  
\[\Delta\lambda=median(\Delta\lambda_{1},\ldots,\Delta\lambda_{k},\ldots, \Delta\lambda_{K}) \tag{20}\]  
The Bragg grating spectrum can be obtained based on the parameters of its structure recorded in the fibre core [33]. For a Bragg grating with applied apodisation, the reflection spectrum can be presented in the form of a Gaussian shape:  
\[R(\lambda)=R_{0}exp\left(-4 ln2\left(\frac{\lambda-\lambda_{B}}{\Delta\lambda _{B}}\right)^{2}\right), \tag{21}\]  
where \(R_{0}\) is the peak amplitude and \(\Delta\lambda_{B}\) is its full width at half -maximum. Real spectra may have various deviations from the ideal symmetric Gaussian shape. Additionally, the grating may undergo various deformations, for example, as a result of its nonuniform stress. The asymmetric shape of the spectrum is modelled by combining two parts of symmetric gratings [31]. The model of the asymmetric Gaussian shape is as follows [34]:  
\[RR(\lambda)=\left\{ \begin{aligned} & R_{0}exp\left(-4 ln2\left(\frac{ \lambda-\lambda_{B}}{\Delta\lambda_{B}}\right)^{2}\right),\lambda<\lambda_{B} \\ & R_{0}exp\left(-4 ln2\left(\frac{\lambda-\lambda_{B}}{\lambda \cdot\Delta\lambda_{B}}\right)^{2}\right),\lambda\geq\lambda_{B}\end{aligned}  \right., \tag{22}\]  
where the parameter \(\chi\) is used to determine the degree of spectral asymmetry. Asymmetric spectra with an FWHM value of 0.5 nm and an asymmetry parameter value of \(\chi=2\) were selected for simulation and numerical analysis of demodulation algorithms (Figure 9). The Bragg wavelength was changed in the range of 1 nm for 1001 values. The spectra were calculated assuming a spectral resolution of 0.01 nm. In the next step, noise with seven SNR values in the range from 30 to 60 dB was added to the spectra. Figure 9: Example of FBG spectra with three wavelength shift values.