1. Introduction
Currently, extensive applications of wavelet transform algorithms (WT) are well documented in the literature [
1,
2,
3,
4,
5]. The algorithms discussed are used, for example, in medicine [
6], image and sound processing [
7], machine diagnostics [
8], seismic vibration analysis [
9], metal analysis [
10], and even in the case of detecting leaks in pipelines [
11]. However, there are few works that provide a universal and accessible method for measurement chain designers to estimate the uncertainty associated with the output values of these algorithms. The methods outlined in current works [
12,
13,
14,
15] are complex, requiring the measurement chain designer to possess in-depth knowledge of the algorithm being utilized.
The universal method for analyzing the metrological properties of WT algorithms was previously introduced in the [
16], where the propagation of random error signals using these algorithms was discussed. Consequently, the issue of how these algorithms propagate deterministic error signals and their role in introducing self-error signals into the output values necessitates further examination. The method outlined in this paper, akin to that in the previous study, employs a matrix representation of the algorithm. Alongside the identification algorithm, which is elaborated on in [
16,
17,
18], an analytical approach for determining the coefficients of this matrix will be presented.
The main goal of the work was to provide a quantitative description of how error signals present in the input quantities of the WT algorithm are transferred to its output and how the parameters of these signals change. This manuscript is divided into 6 sections.
Section 1 contains an introduction and presents the most important assumptions of the work.
Section 2 is devoted to the transmittance of the WT algorithm, explains how the quantity in question affects the error signals processed by the algorithm, and presents an analytical example of determining this quantity for selected algorithm parameters.
Section 3 is devoted to the algorithm’s own errors, explaining their origins and describing the algorithm for identifying their parameters.
Section 4 contains a description of the method used in this work to determine the resultant expanded uncertainty value.
Section 5 presents an example of the application of the discussed analysis method and summarizes the results of a measurement experiment aimed at verifying its correctness.
Section 6 contains the most important conclusions from the work.
All considerations presented in the work were verified through measurements using a previously constructed measurement chain. This article does not include a metrological analysis of the discussed measurement chain regarding the error model and metrological parameters of the input values of the WT algorithm. This aspect is addressed separately and has been detailed in another work [
19]. The uncertainty budget of the signal processed by the WT algorithm has already been established and will serve as a reference for the metrological properties of this signal. Therefore, this work, in conjunction with the previous one [
16,
19], can offer guidance to the designers of measurement chains on how to implement the presented considerations in their own applications of measurement chains.
According to the division introduced in some works [
16,
19,
20], the error signals can be divided according to the nature of the implementation, and we distinguish the following:
Static signals, where subsequent values are constant within a single measurement window;
Dynamic signals, where subsequent values change within a single measurement window, and it is possible to deterministically describe the course of these signals;
Random signals, where subsequent values change within a single measurement window, and it is not possible to deterministically describe the course of these signals;
due to the origin of the signals, we distinguish the following as well:
Own signals, introduced by the analyzed object, resulting from its imperfect properties;
Propagated signals transferred from the input to the output of an object, present in the input quantities.
2. Wavelet Transform Algorithm Transmittance
As described in [
16,
17,
18], many data processing algorithms can be represented in matrix form. In denoting the successive input quantities of the algorithm as
and the output quantities as
, their relationships can be expressed in the following form:
where
N is the number of input quantities,
M is the number of output quantities, and the symbol
denotes the coefficients of the transformation matrix
of the algorithm, obtained according to the method described in [
18] or determined analytically in accordance with the assumptions of the analyzed algorithm, as in [
21]. The method discussed was previously utilized in papers [
16,
22] that described the transfer of random errors using discrete wavelet transform algorithms.
When analyzing how the discussed algorithm transfers errors of a deterministic nature, the transmittance of this algorithm should be taken into account. This algorithm will act as a filter and thus modify the spectrum of the processed signal. This work assumed that the transmittance of the algorithm is ideal, which means that the algorithm does not introduce any deterministic, own errors, but only transfers the errors present in the signal (in case the actual transmittance of the algorithm differs from the ideal one, an additional component of the self-error signal should be considered, as proposed in work [
19] in the attached example). Additionally, the rounding errors introduced by the algorithm during the multiplication and addition operations are taken into account, as presented later in this paper. In general, the analysis discussed should be carried out individually for each output quantity of the algorithm. However, as described in [
16,
22], the values for successive rows of the transformation matrix related to the same level of decomposition are only shifted toward each other, and therefore, their impact on the transmission of the error signal remains constant. Therefore, an analysis can be performed for each level of signal decomposition and not for each output quantity separately, as demonstrated in this paper.
2.1. Relationship between Transmittance and Matrix Form of Algorithm
Based on Equation (
1), the transmittance in the
domain can be determined for the selected row of the transformation matrix in the form
and after substituting
, where
is the sampling perioid corresponding to the sampling frequency
, the dependence describing the transmittance of the selected
i-th row in the pulsation domain denoted as
is obtained. Based on the determined transmittance, the amplification
and phase shift
for the selected harmonic of the signal can be described in the following way:
The transmittance of the object being discussed will impact the error signal components in a manner that alters their amplitude and phase.
2.2. Algorithm Transmittance Impact on Error Signals
Assume that the signal
, processed by the analyzed WT algorithm, can be described in an ideal case as follows:
where
is the sampling period corresponding to sampling frequency
,
is the amplitude, and
is the phase shift of the signal harmonic of pulsation
. In the real case, the quantity
can be described as follows:
where
is random error (non-deterministic),
is the amplitude, and
is the phase shift of the deterministic error.
According to Equation (
3), it is possible to define static error signal
(for which subsequent values do not change for a single WT algorithm run) as follows:
where in case of
, the equation in question can be written as
. In case of harmonics with non-zero pulsation, the dynamic error signal
can be defined as follows:
The random error signal cannot be described in a deterministic form, but statistical parameters such as variance, expected value, and the shape of the probability density function can describe its properties.
According to [
5,
23,
24], a single row of the transmission matrix, as indicated in Equation (
1), and the related transmittance described in Equation (
2), can be analyzed in a manner analogous to a finite impulse response (FIR) filter [
25]. For each output quantity, it is possible to analyze how the algorithm introduces error signals present at its input to this quantity. It should also be noted that in the case of the discussed family of algorithms, the transfer function associated with the selected quantity is linear and time invariant. Therefore, the deterministic error component of the input quantity, as described in Equation (
3), is transferred to the
i-th output of the WT algorithm according to the following relationship:
The discussed transmittance also affects the variance of the analyzed error signals. In the case of both deterministic and random signals, the following relationship can be written [
23,
26]:
where for analyzed error signal
is the variance in the WT algorithm input, and
is the variance in the
i-th WT algorithm output. Given the above equation, the single harmonic variance of the dynamic error signal
in the algorithm output can be determined according to the relationship [
24]
In the case of static error signals, the presented equation simplifies (for
, it becomes
), so it can be written as follows:
In the case of random error signals, it can be observed that the algorithm in question processes
N subsequent realizations of these signals. If these realizations are uncorrelated with each other, or the autocorrelation mentioned is small, and the assumption of the same power spectral density of these signals in the frequency range
holds, the variance of the random error signal at the algorithm’s output can be described by the following equation:
If the specified conditions are not satisfied for the analyzed signal, its variance should be calculated using Equation (
4). In this scenario, it is also feasible to calculate the average variance of the analyzed random error signal:
where
is the normalized pulsation [
24]. Note that Equations (
6) and (
7) are equivalent when the
signal has a constant power spectral density (in case where
), which occurs, i.e., in case of white noise or in case of a quantization error signal [
27,
28,
29,
30]. In the case of non-constant power spectral density, only Equations (
4) and (
7) can be used to calculate the analyzed signal variance correctly.
2.3. Identification of Algorithm Transmittance
The determination of the algorithm’s transmittance concerning the subsequent output quantities can be carried out using Equation (
2) or by understanding the properties of the wavelet utilized by the analyzed algorithm. This process can also be executed for an existing implementation of the algorithm (e.g., implemented in MATLAB [
31], GNU Octave [
32], or the PyWavelets package [
33]), employing a suitable identification algorithm [
18]. Since the mentioned identification algorithm has been utilized in previous studies [
16,
22], and its application is straightforward, the analytical approach will be elaborated below. The illustration pertains to the “Daubechies” [
21] wavelet family, assuming that the WT algorithm will process
input quantities to produce
output quantities, utilizing the “db2” wavelet and undergoing
iterations of the signal decomposition process.
In the case under analysis, the vector of input quantities, previously mentioned in Equation (
1), can be represented as [
5]
where the symbol
denotes the approximations, and the symbol
denotes the details of the signal for the scale number
m and the time shift number
n, while the vector of output quantities can be described in the form
The signal decomposition process, enabling the calculation of the values of the quantities referenced in Equation (
8) from the values of the quantities specified in Equation (
9), can be recursively defined using the equations outlined in [
5]:
where the symbol
represents consecutive non-zero scaling factors, which will be elaborated on later in this paper, while the symbol
signifies the coefficients computed in accordance with the following equation:
where
is the number of non-zero scaling factors resulting from the properties of the wavelet used.
According to Equations (
10) and (
11), to determine the values of the quantities outlined in Equation (
8), one must have knowledge of the number and values of consecutive scaling factors. In considering the assumptions regarding the analyzed wavelet “db2”, this wavelet possesses
non-zero scaling factors:
,
,
, and
[
5,
21]. Furthermore, it is characterized by the following assumptions [
5,
21]:
where in Equation (
14),
, and in Equation (
15),
. Based on the above assumptions, the system of equations can be written as follows:
and solving this system allows the values of the analyzed scaling factors to be determined:
Based on Equations (
10) and (
11), relationships describing the output values of the analyzed algorithm, indicated in Equation (
8), are obtained:
With Equation (
1) and taking into account the order of the elements of the vector of the output quantities consistent with that assumed in Equation (
8) and substituting on the basis of Equation (
9)
, we have
Therefore, based on the relationships indicated so far, the transformation matrix
described in Equation (
1), which is appropriate for the analyzed WT algorithm, takes the form
Knowing the values of the subsequent transformation coefficients
allows us, in accordance with Equation (
2), to determine the transfer functions related to the subsequent output quantities of the analyzed algorithm. A certain regularity can be noticed here—the transmittances related to the output quantities with the same scale number will be identical, regardless of the time shift number (this applies separately to details and signal approximation). Hence,
for
. This property significantly simplifies the analysis of the metrological characteristics of WT algorithms, especially considering that the quantity of output values generated by these algorithms typically exceeds the number of scales analyzed, stemming from the iterations in the input signal decomposition process [
3,
16].
It is essential to highlight that the analysis presented can also be conducted for other wavelet families, varying numbers of decomposition process iterations, and different quantities of algorithm input. In instances involving wavelet families with explicitly defined mother wavelet equations (instead of utilizing appropriate relations as shown in the example), it becomes feasible to determine the algorithm’s transfer function through suitable transformations [
26]. Nonetheless, the connection between the algorithm’s transfer function and the transformation matrix coefficient values is consistently described by Equation (
2).
Another scenario that warrants discussion is when adjustments can be made to the transformation matrix coefficients. This situation may involve modifications such as the incorporation of an additional window function
, where the algorithm’s output values are determined based on the following relationship:
In the discussed case, the coefficients of the transformation matrix of the algorithm are modified according to the equation
where
is the new value of the transformation coefficient
. In this case, a different transfer function is associated with each output quantity, and Equations (
34) and (
35) are no longer valid.
3. Own Errors of the Wavelet Transform Algorithm
In analyzing the values of the subsequent coefficients of the transformation matrix given in Equation (
33), it can be noticed that most of the coefficients are irrational. Based on the analysis of Equation (
1), it can be noticed that in order to determine a single value for the implementation of the selected output quantity of this algorithm, it is necessary to perform
N multiplications and
N additions. These calculations are most often performed by a microprocessor and are therefore associated with errors related to the limited precision of real numbers [
34]. It can therefore be noticed that, in addition to processing error signals present in the algorithm’s input quantities, this algorithm will introduce its own errors resulting from the presented phenomena into the output quantities.
In order to determine the parameters of the own error signal
for the subsequent output values of the algorithm, it is proposed to perform an appropriate experiment using the Monte-Carlo method [
35]. During the experiment, random values of input quantities from the range of values that the algorithm processes in real conditions will be provided as input for the actual implementation of the algorithm. Simultaneously, with the result
for the real algorithm, the result
should be determined in the case of the ideal algorithm, implemented according to Equation (
1). In assuming that the input quantities
of the algorithm are not subject to any error signal (i.e.,
), the error signal
can be defined as follows:
Based on the values of the subsequent realizations of the error signal
, its variances, expected value, and associated expanded uncertainty for a given confidence level can be determined. Unfortunately, it is actually impossible to carry out the presented experiment. The process of determining the value of the realization of the quantity
in the case of an ideal algorithm must also be carried out using a microprocessor, and this, therefore, also introduces errors related to the phenomena discussed earlier in this quantity. However, it is proposed to estimate the parameters of the error signal
by carrying out the process of determining the value of
using numbers with much greater precision than in the case of the value
. Since modern microcontrollers usually use real numbers with word lengths of 16 or 32 bits [
36,
37], the values of
may be determined using a word length of 128 bits [
34,
38].
The discussed experiment was performed for the algorithm described in the previous section, for which its values for the transformation matrix coefficients are presented in Equation (
33). In each experiment, 100,000 random values of the
signal realization from the selected range were fed as input to the algorithm. Then, based on Equation (
38), subsequent realizations of the algorithm’s own error signal were determined. The obtained results allowed for the estimation of the variance, expanded uncertainty, and expansion coefficient for the analyzed cases. The experiment was conducted for an implementation of the algorithm using 16- and 32-bit floating-point numbers. The algorithm was implemented in C using the GNU GCC [
38] compiler to generate the machine code. This compiler is also utilized for the “ARM” and “AVR” platforms [
37,
38,
39]. The experimental results are summarized in
Table 1 and
Table 2. Based on the results obtained, the expansion coefficient for the distributions of the analyzed signals was estimated to be
on average.
In analyzing the results presented in
Table 1 and
Table 2, several of the most important relationships can be noticed. The value of the variance of the self-error signal has the following characteristics:
It depends on the number of arithmetic operations performed on non-zero coefficients of the transformation matrix and increases with the number of these operations;
It depends on the range of possible implementation values of the algorithm’s input quantities and increases as this range is extended;
It depends on the length of the word used by the algorithm and decreases as this length increases.
Therefore, from the perspective of the measuring chain design, this value will rely on the number of the input quantities of the WT algorithm, the iterations of the signal decomposition process, and the order and type of the mother wavelet used. It is also noticeable that for the same stage of signal decomposition, the error signal parameters are nearly identical for each output quantity. Hence, for each algorithm implementation, the parameters of the self-error signals should be determined for the subsequent decomposition stages. The experiment conditions should closely resemble the actual operational conditions of the analyzed algorithm.
4. Method for Determining the Resultant Expanded Uncertainty
In many cases, merely knowing the value of the standard uncertainty parameter or the error signal variance may not suffice [
40]. The most universal method used to determine the resulting expanded uncertainty value in a general situation is the Monte-Carlo method. However, this approach necessitates numerous iterations to obtain the final value of the analyzed error signal and may not be suitable for the real-time evaluation of the metrological properties of the measurement chain due to the time required to repeat the experiment.
An alternative to the Monte-Carlo method could be an analytical method, such as the propagation of distribution functions method described in sources like [
41] or the extended rule of the combination of uncertainties method outlined in [
42]. However, these methods are intricate, and their application to the error model proposed in this study might be less effective compared to the reduction interval arithmetic method, as discussed in works like [
43,
44,
45]. Another alternative could be a method based on fuzzy logic, as detailed in [
46].
Due to the advantages of the interval arithmetic reduction method, such as its simplicity of application, its ability to determine new values of the resulting expanded uncertainty when the error model parameters change without the need for a Monte-Carlo experiment, and its low computational complexity, the reduction interval arithmetic method was employed to ascertain the resulting value of the expanded uncertainty in this study.
According to the method of reduction interval arithmetic, the expanded uncertainty in case of an error signal
can be determined according to the following relation [
43,
44]:
in which the successive values of the expanded uncertainties
for the analyzed component
of the error signal
are determined according to the relation [
40]
where
is the coverage factor for the
i-th
signal component. The successive coherence coefficients
are determined according to the following equation [
43]:
where symbol
denotes the shape factor, which is determined for a pair of signals
and
has a specific distribution shape of the following form [
43]:
assuming that signals
and
are uncorrelated and have the same value of expanded uncertainty
for the same confidence level
[
40].
The coherence coefficients
determined consider the relationships between the shapes of the provided error distributions and their correlations, incorporating corrections arising from the central limit theorem [
40]. The shape factor coefficients
need to be computed only once, which can be achieved through a simulation experiment (Monte-Carlo method) or analytically. Various works such as [
43,
44] describe the process of calculating these coefficients in different manners.
Table 3 displays values for typical scenarios at a 95% confidence level for
.
5. Application of the Proposed Analysis Method
The effectiveness of the proposed analysis method was verified using the measurement chain detailed in a previous study [
19]. This measurement chain processes a time-varying voltage signal
, with realization values falling within the range
on discrete representations of
of this magnitude, where
, and
denotes the sampling period. In a single measurement series, with
, consecutive samples of quantities
are inputted into the WT algorithm described in the previous section, leading to the determination of a vector
of output quantities
. The algorithm’s implementation utilizes floating-point numbers with a word length of 32 bits.
The metrological properties of the section of the measurement chain responsible for converting the quantity
into
were previously discussed in [
19]. The uncertainty budget related to
encompasses the random error signal
and the dynamic error signal
. For the random error signal
, the variance is
, and the realization values of this signal are distributed close to normal. Hence, for a confidence level of
, the coverage factor
, and the expanded uncertainty is
.
Regarding the dynamic error signal
, its characteristics are influenced by the spectrum of the processed signal
. If this signal is a sinusoidally varying signal with pulsation
and amplitude
, the following conditions apply [
19]:
however, if the signal is a triangular signal with the given parameters, then [
19]:
where in Equation (
41), only those harmonics of the signal
for which
holds are taken into account, where
. The introduced phase shift
, which is the origin of the dynamic error signal, is estimated according to the relationship [
19]
As the ambient conditions did not change during the experiments, it is assumed that the static error signal does not occur.
In considering the aforementioned relationships, in the scenario of a sinusoidally varying signal , the resulting error signal will comprise the signal and the signal consisting of a single harmonic with pulsation . In the instance of a triangular signal, the error signal will also encompass a random error component , and depending on the signal’s pulsation , it will include a specific number of harmonics of the random error signal , where the i-th harmonic is characterized by a pulsation of .
These error signals discussed will be propagated to the algorithm output as per Equation (
1). The parameters at the algorithm output can be determined for subsequent output quantities following Equation (
6) for the random error signals and Equation (
5) for the successive harmonics of the resultant dynamic error signal. Moreover, in the scenarios discussed, the WT algorithm will introduce its own error signals
to the output values, linked to the previously mentioned roundings.
The vector of expanded uncertainties related to the resultant error signal for subsequent output quantities of the algorithm, as required in Equation (
39), can thus be delineated as
in the case of a sinusoidal signal, and in the case of a triangular signal, in the following form:
The symbol “∗” represents the output quantity number, assigned following the symbols introduced earlier in Equation (
8). Based on the previously addressed characteristics of the WT algorithm, for random error signals, the uncertainty linked to the propagation of these signals to the WT algorithm’s output can be calculated using the following relationship:
resulting from Equation (
6), while in the case of the subsequent harmonics of the resultant dynamic error signal,
which results from Equation (
5). The resulting expanded uncertainty
related to the subsequent output quantities can be determined according to Equation (
39), with the values of the coherence coefficients estimated based on relationship (
40). For the confidence level
and
[
40],
.
To validate the indicated relationships, a Monte-Carlo measurement experiment was conducted, gathering 30,000 values of the
signal realization each time. Throughout the experiment, the signal source
originated from the RIGOL DG1011 arbitrary waveform generator [
47]. The initial phase of this signal was randomized within the interval
, which was determined using the generator’s synchronizing output. The signal’s frequency
ranged from
for a monoharmonic signal and from
for a polyharmonic signal. The signal parameters remained constant at
and
.
Based on the collected values of the
quantity realization, we have the following the equation:
The error signal values
were determined, and their variances were calculated along with the expanded uncertainty. The measured expanded uncertainty value
was compared with the value
determined using Equation (
39), and the relative error in estimating this value was computed. The outcomes for specific values of signal
pulsation are outlined in
Table 4 and
Table 5.
For example, in the case of a monoharmonic signal with a frequency
for the output quantity
, the following occurs:
and for the indicated case, 14.13 mV was measured. Expanded uncertainty values can be determined similarly in other cases, but due to the large number of components of the indicated equations, further examples were not published in this paper.
6. Conclusions
The expanded uncertainty values determined for a monoharmonic signal for subsequent output values of the measurement chain consistently aligned with those obtained experimentally. The typical deviation between the actual and estimated expanded uncertainty fell within the range of ±5%. However, in the case of a polyharmonic signal, the resultant expanded uncertainty values were determined with a larger margin of error. This discrepancy is primarily due to the imprecise determination of the error model parameter of the analyzed measurement chain. These parameters were established in a previous study [
19], incorporating several simplifications to ensure that the presented analysis example maintained a minimal level of complexity.
Upon analyzing the instances of a polyharmonic signal where there is a notable disparity between the estimated and measured expanded uncertainty values, a specific pattern emerges. Each output quantity of the algorithm corresponds to a particular transmittance, which effectively dampens or enhances error signals with a specific spectrum. Consequently, if there is an inaccurate estimation of the parameter of a particular error signal, especially if this signal emerges as the predominant signal in the algorithm’s output, the estimation will be erroneous.
This observation highlights a crucial insight—even with highly accurate estimations of the resultant error signal parameters of the input quantities of the WT algorithm, there remains a possibility that the parameters of the error signal at the algorithm’s output are inaccurately estimated. The dominant error signal (with accurately determined parameters) could be suppressed, while the less significant signal (with imprecisely determined parameters) could undergo significant amplification.
It can be seen that the transfer function of the WT algorithm can be determined in two ways. The first method, described in [
16,
17,
18], is the most accessible to the designer of the measurement track and does not require any knowledge about the algorithm used; however, its use requires a ready implementation of this algorithm. The second method, presented in this paper, requires knowledge of the assumptions of the wavelet family used and their transformation to the form described in Equation (
2), by following the steps below:
Indicate the form of the vector of the output quantities based on the number of input quantities, the type of wavelet, and the number of iterations of the signal decomposition process (as shown in Equations (
8) and (
9) in the case of the analyzed example).
Determine the values of the scaling factors based on the assumptions of the selected family and the order of the selected mother wavelet (as shown in Equations (
13)–(
16) in the case of the analyzed example).
Determine the equations describing the output quantities indicated in step 1, based on Equations (
10) and (
11) and substitute the values determined in step 2 into them (as shown in Equations (
17)–(
32) in the case of the analyzed example).
This procedure is much more complex due to the necessary calculations, but it does not require the implementation of the algorithm used.
It should be noted that the use of the interval arithmetic reduction method to estimate the resulting expanded uncertainty value comes down to the following:
This implies that in the event of a change in the error model parameter (e.g., alterations in the spectrum of the processed signal, the emergence of an additional error signal, a modification in the parameters of existing error signals), there is no need to conduct Monte-Carlo simulations or any other intricate procedures to ascertain the current resulting value of the expanded uncertainty. The sole task that requires additional effort is determining the values of shape coefficients, which occurs once during the analysis preparation stage. However, this feature indicates that the obtained results may be inaccurate if the analyzed error signals exhibit a realization distribution shape different from the one assumed in the calculations.
In conclusion, the proposed analysis method and the previously suggested error model can be deemed suitable. It is essential to highlight that the accuracy of the proposed analysis method hinges on the precision of determining the parameters of the proposed error model. The authors of this article anticipate that the proposed method will be beneficial for the designers of measurement chains utilizing WT algorithms or other types of linear measurement data processing algorithms.