## 2 Combining Geometric and Arithmetic Mean as a Denoising Method  
The concepts for developing the new method were derived from several methods aimed at various types of filtration, feature extraction and signal feature enhancement. The first type of nonlinear filtering is the geometric mean filter, which has been used to improve signal quality in many fields such as acoustics [17] or image processing [18,19]. In relation to the arithmetic mean, the use of the geometric mean reduces the influence of very small and very large sample values on the result. In general, filters based on nonlinear means eliminate both additive and impulsive noise in a better way [20]. The nonlinear causal geometric filter can be written with the following equation:  
\[y[n]=\left(\prod_{i=0}^{K-1}x[n-i]\right)^{\frac{1}{K}}. \tag{1}\]  
where \(K\) is defined using an analogy to averaging filters as the order of the filter. The geometric mean can be written in another form as calculating the exponential of an arithmetic mean of the logarithmic-transformed signal [21]. Since the causal filter introduces a delay, and the data are most often analysed offline, such a filter can be transformed to a noncausal version. For an odd number of input signal samples used in calculating a single output signal sample, the following formula is proposed with a \((2k+1)\) gap [22]:  
\[y[n]=\left(\prod_{i=-k}^{k}x[n-i]\right)^{\frac{1}{2+1}}. \tag{2}\]  
For example, for \(k=2\), we obtain the following formula:  
\[y[n]=\left(x[n-2]\cdot x[n-1]\cdot x[n]\cdot x[n+1]\cdot x[n+2]\right)^{\frac{ 1}{5}}. \tag{3}\]  
It is therefore the fifth-degree root of the product of 5 elements. Such a filter uses the current sample \(x[n]\), two previous samples \(x[n+1]\), \(x[n+2]\), and two subsequent samples \(x[n-1]\) and \(z[n-2]\) to determine the nth output value \(y[n]\). It therefore has the properties of a noncausal filter, whose linear equivalent does not shift the output signal relative to the input signal. The effect of the Gaussian spectrum distortion by the geometric filter in Equation (3) for different values of \(K\) is shown in Figure 1. The FBG presented here has a Bragg wavelength \(\lambda\_\)B = 1555 nm, an FWHM value of 0.5 nm, and a spectral resolution \(\delta\lambda\) = 0.01 nm. A commonly used nonlinear operator is the discrete Teager-Kaiser energy operator [23]:  
\[y[n]=x^{2}[n]-x[n-1]\cdot x[n+1]. \tag{4}\]  
which is also used in an extended version introducing a differentiated delay between the product of shifted signal elements [24]:  
\[y_{k}[n]=x^{2}[n]-x[n-k]\cdot x[n+k]. \tag{5}\]  
By changing the above nonlinear differential equation from subtraction to summation, we obtain the sum of the two components. The first component is the square of the current sample value, and the second is the product of the previous and next sample values. The calculated sum should still be normalised by dividing it by two and then calculating the square root of the result. Finally, the basic version of the new filtering algorithm for the difference \(k\) = 1 is as follows:  
\[y[n]=\Big{(}\Big{(}x^{2}[n]+x[n-1]\cdot x[n+1]\Big{)}/2\Big{)}^{1/2}. \tag{6}\]  
In the version with different \(k\) delay values, the equation is  
\[y_{k}[n]=\Big{(}\Big{(}x^{2}[n]+x[n-k]\cdot x[n+k]\Big{)}/2\Big{)}^{1/2}\;. \tag{7}\]  
The final version is  
\[y_{kk}[n]=\Bigg{(}\sum_{k=0}^{K}(x[n-k]\cdot x[n+k])/K\Bigg{)}^{1/2}. \tag{8}\]  
Equation (8) can be described as a symmetrical geometric-arithmetic mean filtering method. The effect of FBG spectrum distortion depending on the degree of filtration is shown in Figure 2 for the filter in the version in Equation (7). As the filter order increases, the signal intensity decreases. The difference between the original and transformed spectrum is symmetrical. Figure 3 shows the difference between the original spectrum and the spectrum after applying the filter in the version in Equation (8).