## 4 Simulation Verification of the Method
### The Case of Spectrum Leakage  
The first problem considered is the case of spectral leakage [39]. This situation occurs in the case of noncoherent sampling, i.e., when \(f_{k}\
eq\frac{n}{N}f_{s}\) where \(n\in\mathbb{N}\). While the estimated energy value for the analyzed signal does not change, the output quantities \(X(k)\) of the DFT algorithm show additional harmonics with frequencies \(f_{k}\) close to the actual harmonic frequency of the signal \(s(t)\). This means that the estimated dynamic error signal \(e_{x,d}(i)\) contains more harmonics than actually present. Because, according to Equation (27), the estimated variance of the \(k\)th harmonic depends on the introduced phase shift, which in turn depends on the harmonic's frequency, this situation is unfavorable. If most of the real energy of the harmonic of \(s(t)\) leaks to a lower frequency harmonic, the variance of the dynamic error signal associated with that harmonic will be underestimated. Otherwise, due to a larger value of the phase shift parameter \(\tilde{\varphi}_{y}(\omega)\), this variance will be overestimated. To verify the influence of this phenomenon on the relative error in estimating the variance of the dynamic error signal \(e_{x,d}(i)\) described by Equation (34), a monoharmonic signal \(s(t)\), defined by the equation, was applied to the input of the measurement channel described in the Introduction section of this paper:  
\[s(t)=\sin\bigl{(}\omega_{o}t+\varphi_{o}\bigr{)}, \tag{37}\]  
where \(\omega_{o}=2\pi f_{o}\) is the angular frequency of the signal \(s(t)\) and \(\varphi_{o}\in[0;\omega_{o}]\) is the initial phase of this waveform, random for each iteration of the experiment. The quantization error introduced by the A/D converter was not considered in the experiment. The experiment was performed for the following parameter combinations: \(f_{n}\in\{3,9,\dots,21\}\) kHz, \(N\in\{32,64,128\}\), and for the signal frequency \(s(t)\) equal to the following:  
\[f_{o}=f_{n}+\frac{f_{s}}{N}f_{mul}, \tag{38}\]  
where the multiplier \(f_{mul}\in\{-0.9,-0.8,\dots,0.\dots,0.8,0.9\}\). Thus, for each frequency, different cases of spectral leakage were tested, caused by failure to meet the coherent sampling condition \(f_{o}\
eq\frac{n}{N}f_{s}\) for \(n\in\mathbb{N}\), as well as the case of coherent sampling where \(f_{mul}=0\). The experiment was performed for all combinations of these parameter values. Selected results are presented in Figure 3 and summarized in Table 1. The experiment can be reproduced by running the script in the file case_1_sine.m located in the repository [47]. In analyzing the presented results, it can be seen that the phenomenon of spectrum leakage significantly affects the relative error in estimating the variance of the dynamic error signal and its spread. When coherent sampling conditions are maintained, the value of this error is close to zero. This phenomenon is particularly noticeable when the number of samples of the analyzed signal is low, where the frequency resolution of the DFT algorithm is limited, and for low frequencies of the signal processed by the measurement chain. As the frequency of the processed signal increases and the number of samples increases, the effect of spectrum leakage becomes less noticeable, and consequently its impact on the obtained results is minimal. For low frequencies of the processed signal, the variance of the dynamic error signal is small, and the ratio of the frequency difference \(\frac{f_{2}+1}{f_{k}}\) between subsequent results of the DFT algorithm is much higher than in the case of higher values of this quantity. Because this difference directly influences the estimated phase shift and consequently the estimated variance, these differences are significant in this context. However, it should be noted that the variance of the dynamic error signal is very small in this case, which, relative to the overall uncertainty budget, may have a negligible impact on the resultant variance and the expanded uncertainty of the analyzed quantity.