Skip to main content
. 2024 Feb 28;10:e1901. doi: 10.7717/peerj-cs.1901
Algorithm 1: Preprocessing the input signal using Discrete Wavelet Transform algorithm
Input: original noisy speech signal, wavelet decomposition bands Output: decomposed signals and corresponding coefficients
Xdata[] stores the input data vector, and Ydata[ ] is the output data vector that is returned. N is the length of both data vectors. Before applying this approach, it is presumable that the wavelet filter parameters G[k] and the scale filter parameters H[k] have been provided. L is the total number of parameters. N must be an even number to work with this algorithm.
Step 1: Set s=N2 // Start index of the input array’s gamma coefficients
Step 2: Allocate ydataN; // Provide a memory space for the output data vector
Step 3: for (i = 0 while i <  N increment i  =  i + 1) do // loop over input data
Step 4:ydatai=0; // Reset summation accumulators.
Step 5: endfor;
Step 6:j = 0; // access/index to the output data array
Step 7: for (i = 0 while i <  N increment i  =  i + 1) do // loop over input data.
Step 8: for k = 0 while k < L increment k = k + 1) do // convolution loop.
Step 9:didx=i+kmodN; // access/index into input data with wraparound.
Step 10:ydataj=ydatai+Gkxddatadidx; // Scaling filter contribution
Step 11:ydataj+s=ydatai+s+Hkxddatadidx; // Wavelet filter contribution
Step 12: endfor;
Step 13:j = j + 1;  // Update position in output array
Step 14: endfor;