# FPGA-Based Methodology for Detecting Positional Accuracy Degradation in Industrial Robots
## 2 Materials and Methods
### Discrete Wavelet Transform  
The discrete wavelet transform (DWT) is a mathematical method that gives time-frequency information of a signal [39]. The signal is separated into different frequency bands by passing through a filtering process. The process involves convolving the signal of interest with a transform function known as the mother wavelet, which determines the parameters of the high-pass and low-pass filters. In simpler terms, DWT allows a signal to be separated into its frequency components, which makes it possible to identify frequency changes over time. The complete process consists of two stages; first, the calculation of the approximation and detail coefficients is made, and second, the signal at the required level of decomposition is reconstructed using the coefficients of the previous stage in a process known as inverse DWT. Equation (4) defines the DWT of a discrete-time signal \(x(k)\) with \(k\) samples, and \(\psi\) represents the discrete mother wavelet used for decomposition level \(i\)  
\[DWT_{ik}=\sum x(k)\psi_{i,k}(t). \tag{4}\]  
The selection of the wavelet mother family depends on the application; the most common families are [PERSON], [PERSON], and Daubechies, among others. The Daubechies family is used in this work due to its characteristics of the higher number of vanishing moments [40], compact support in the frequency domain, and conserving the energy of the signal [41]. DWT algorithm consists of the following steps and is represented in Figure 2a,b:  
* Define the wavelet mother function or wavelet basis and the decomposition level \(i\) to be used. * The wavelet mother function provides the high-pass \(g[n]\) and low-pass \(h[m]\) filter coefficients. * Perform the convolution operation between the signal \(x[n]\) and the filters to separate the signal into high and low-frequency bands. * Downsample by two filtered signals obtained in the previous step, keeping the even-indexed samples. * The outputs of filtering and downsampling the signal provide the detail vector \(d_{i}\) and the approximation vector \(a_{i}\) of the high-pass and low-pass filtering, respectively, at each decomposition level \(i\). * Repeat the filtering and downsampling process using the previous approximation output as input for the next decomposition level until all levels are completed. * To reconstruct the approximation and detail branches of the signal for a specific level \(i\), upsample the corresponding coefficient vectors \(a_{i}\) and \(d_{i}\) by a factor of 2 (adding zeros in the positions of the removed samples in the downsampling process, if necessary). * Apply the corresponding time-inverse high-pass \(g^{\prime}[n]\) or low-pass \(h^{\prime}[m]\) filter coefficients. * The signal reconstruction \(x^{\prime}[n]\) is obtained by the inverse process using the last approximation vector \(a_{i}\) and all the detail vectors \(d_{i}\), \(i=1,2,\ldots,i\). DWT's recent applications include condition monitoring of slew bearings [42], evaluation of plant growth status [43], and wind power prediction [44]. Robot operating conditions in industrial environments involve different factors such as disturbances, noise, temperature, humidity, and others. The acquisition of robot signals in a noisy environment requires the use of signal processing techniques to handle the noise. In this sense, it is necessary to perform an analysis of the signal of interest to determine, depending on its characteristics, which type of techniques to use, such as high-pass or low-pass filtering. On the other hand, time-frequency analysis techniques such as DWT allow the separation of the original signal into different parts that are already filtered while preserving the original characteristics of the signal. DWT is used in this work because it allows for the decomposition of a signal into different frequency bands using a series of filters, which is useful when dealing with noisy signals.