## 2 Combining Geometric and Arithmetic Mean as a Denoising Method
A comparison of the filter's  
Figure 1: FBG spectra deformation by geometric mean filtering (**a**), difference between original and filtered FBG spectra (**b**) in terms of maximum intensity (amplitude) difference between original and filtered FBG spectra for different k values. effect on the reduction in the spectrum's amplitude is shown in Figure 2b. The filter using the two sum components distorts the amplitude to a greater extent than the filter using the sum of \(K\) components. This property can be explained by the fact that individual products for samples farther away from the currently considered one have a greater difference in value from the central product (the value of the current input sample raised to the second power). We use the term symmetric filters due to the possibility of another asymmetric modification derived directly from the alternative version of the energy operator being called the high-order differential energy operator [25]:  
\[y[n]=\left(\prod_{i=-k}^{k}x[n-i]\right)^{\frac{1}{2+1}}. \tag{2}\]0  
which, for a third-order operator, takes the following form:  
\[y[n]=\left(\prod_{i=-k}^{k}x[n-i]\right)^{\frac{1}{2+1}}. \tag{2}\]1  
Transforming Equation (9) into filter form, we have the following notation:  
\[y[n]=\left(\prod_{i=-k}^{k}x[n-i]\right)^{\frac{1}{2+1}}. \tag{2}\]2  
The general form depending on the shift parameter \(k\) is  
\[y[n]=\left(\prod_{i=-k}^{k}x[n-i]\right)^{\frac{1}{2+1}}. \tag{2}\]3  
And, the final version of the geometric-arithmetic mean filter is  
\[y[n]=\left(\prod_{i=-k}^{k}x[n-i]\right)^{\frac{1}{2+1}}. \tag{2}\]4  
\[y[n]=\left(\prod_{i=-k}^{k}x[n-i]\right)^{\frac{1}{2+1}}. \tag{2}\]5 Difference between original FBG spectra and filtered version (**a**); maximum intensity (amplitude) difference between original and filtered FBG spectra for two filter versions (**b**). \[y[n]=\left(\prod_{i=-k}^{k}x[n-i]\right)^{\frac{1}{2+1}}. \tag{2}\]6 FBG spectra deformation analysed by nonlinear mean filtering (**a**), difference between original and filtered FBG spectra (**b**). In Figures 4 and 5, one can see that the performance of both nonlinear filters was worse for small signal values. In order to reduce this negative effect, a constant value (offset) was added to the spectra before filtering. After processing the spectrum by the filter, the offset was subtracted. The positive effect of such a relatively simple operation is shown in \[y[n]=\left(\prod_{i=-k}^{k}x[n-i]\right)^{\frac{1}{2+1}}. \tag{2}\]7 The benefits of offset can be seen especially when comparing Figure 6 with Figures 4 and 5. During the numerical analyses, different offset values from 0.1 to 100 were tested. A positive effect occurred for all values for which the optical spectrum ceased to have negative values. Finally, we used an offset value of 1. Figure 7 shows spectra subjected to nonlinear filtering with a significant value of \(K\) = 20. This is the equivalent of an impulse response length of 41 for the linear filter. The processed spectrum is devoid of visible noise features. The spectrum peak is reduced, and the half-width is increased. The effect of such processing can therefore be described as oversmoothing. Figure 8a shows the effect of the Savitzky-Golay (SG) filter with an impulse response length of 19 and a degree of polynomial approximation of 5. Figure 8b shows the differences between the spectra after the filtering operation and without noise. Four types of filters were compared: two SG filters, geometric mean and arithmetic-geometric mean filters. The differences were smaller for nonlinear filters, especially for small amplitudes. The computational complexity of nonlinear arithmetic-geometric filters is similar to that of finite impulse response filters implemented with convolution. For the same order of K, the same numbers of products and summations are required. In the case of a geometric filter, it is possible to reduce the number of products when calculating each output sample.