Wavelet Homepage                               Table of Contents

4 Wavelet Theory 

Applying wavelet techniques is the next step in solving the signal analysis puzzle.  This portion of the paper will show that wavelets are the ideal tool for transient detection and classification.  The Haar wavelet is given as a demonstration of how wavelets work and as an example of what is possible with this new field of mathematics.  It should be noted that the purpose of this portion of the paper is not to give the reader a comprehensive understanding of wavelets or an ability to apply wavelets, but rather to provide the reader with enough background to understand the method taken and the conclusions reached from the given information and plots.

  4.1 The Haar Wavelet

            For our purposes, we want a wavelet basis that can detect transients.  A transient is defined as a sudden deviation from the average value in the signal [14].  An investigation of the Haar wavelet shows that it is the ideal choice for transient detection.

Wavelets are composed of two bases, a scaling and a wavelet basis [14-18].  The scaling basis deals with how the wavelet represents a signal over a given frequency band [15].  The wavelet basis shows how the wavelet sees the transients in a signal on a given frequency band [15].  The tricky part about wavelets lies in understanding what the word “sees” means.  For the purposes of this paper, we forgo a mathematical explanation and instead opt for an example. 

As stated, every wavelet is composed of two bases.  For the Haar wavelet, the scaling and wavelet bases are , and  respectively [15].  We now consider the signal in Figure 4 composed of two transients.  By noting that the slope of the first transient is larger than the second, we see that the first transient is of a higher frequency than the second. 

Figure 4: Example Vector with Two Transients

 

            The first step in the wavelet analysis process in to convolute the signal with the wavelet basis [15].  The result of convoluting the example vector with the Haar wavelet basis is shown in Figure 5.  Note the strength of the first transient compared to the second one.  The image in Figure 6 is the same signal as in Figure 5, but plotted so that colors represent strength.  In our case, the lighter colors represent the stronger signal. The imagesc (image scaled colors) function in Matlab was used to make the plot in Figure 6.  

Figure 5: Results of Haar Wavelet Convolution with Example Vector

 

Figure 6: Image Color Scale Representation of Haar Wavelet Convolution

 

            The coefficients in the Haar scaling function are designed to take a rolling average of the data [15].  A rolling average is an average of every two samples in the signal i.e. samples 1 and 2, then samples 2 and 3, then samples 3 and 4, for the length of the signal [16].  The coefficients in the Haar wavelet function were designed to take the difference between every two samples in the signal [15].  This is important to us because a large jump in the difference from one data point to the next (in other words a transient) would result in a large value of the convolution of the Haar wavelet function and the signal at that point.  Note again that the slope of the first transient is greater than the second, thus the difference in values from one point to the next is greater in the first transient than in the second.  This is what we see in Figures 5 and 6, the sudden changes in value results in a large value of the convolution between the Haar wavelet and the signal.  This is what we mean by how the wavelet function “sees” the signal, it “sees” the magnitude of the differences from one point to the next.

            According to the Nyquist theorem, the highest frequency a signal can properly hold is half the number of samples per second in the signal [17].  For our purposes, the example signal has 100 samples per second, so the highest frequency we can see is 50 Hz.  Keeping this in mind, we introduce the idea of down-sampling.  Down-sampling a signal means to take out every other element in the signal [15,17].  According to the Nyquist theorem, down-sampling a signal cuts the maximum frequency the signal can hold in two [17].  So down-sampling the example signal cuts the max frequency to 25 Hz.  Down-sampling is the next step in the wavelet analysis process.  A plot of the down-sampled signal is given in Figure 7.  Note that the first transient was lost in the process.

Figure 7: Down-Sampled Example Vector

 

            The new down-sampled vector represents what the example vector would look like if the signal were sampled at half the original sample rate.  The next step in the analysis process is to convolute the down-sampled signal with the Haar wavelet basis [15].  The convoluted signal is then up-sampled.  Up-sampling a signal is simply placing a zero in between each sample [15,17].  This does not change the Nyquist frequency, but does create a mathematical anomaly that is compensated for by convoluting the up-sampled signal again with the Haar wavelet basis [17].  How this anomaly is compensated for is different for each wavelet and is dictated by the scaling function.  The purpose of up-sampling is to keep the representation of the down-sampled signal at its original number of samples so that it can be compared to the original signal [16].  The result of this process is given in Figure 8, with its image color scale representation in Figure 9.

Figure 8: Newly Formed Signal from Down-Sampling, Convoluting, and then Up-sampling and Convoluting

Figure 9: Image Color Scale Representation of Signal in Figure 8

 

            Remember that the signal in Figures 8 and 9 represents frequencies up to only the original Nyquist divided by 2.  The absence of the first transient in the second signal shows that it exists only in the frequencies from the original Nyquist frequency to the original Nyquist frequency divided by 2 (50 Hz to 25 Hz).  If the original signal were down-sampled twice, and the convolution, up-sampling, convolution process repeated, the result would be the strength of the transients in the frequency band up to the Nyquist frequency divided by 4.  Each time this down-sampling process is repeated we say that a new decomposition level is created [15].  Each decomposition level represents a given frequency band corresponding to the number of times the signal has been down-sampled.  By combining each level into one plot, an accurate representation of the signal’s frequency content is established.  This is partially shown by combining levels one and two as in Figure 10.

Figure 10: Levels 1 and 2 Combined

 

You can see from Figure 10 that while the first transient exists completely in the first level of decomposition (25 Hz-50 Hz), the second transient exists on both levels but is stronger on the second band (0 Hz-25 Hz).  Although the transient have the same magnitude, the first transient lies completely in the first level while the second transient’s power is divided between both levels. If we were to add a third level of decomposition, level two would show the 12.5 Hz-25 Hz band only and we would see that the second transient does not exist below the second level.  By repeating the process for as many levels as desired, we can get a very accurate representation of a signal’s time-frequency relation. 

At this point we have established that the Haar wavelet allows the user to detect transients, and represent them on a time (samples) versus frequency image.  The analysis technique for this wavelet is also simple and requires little processing power to perform.  The Haar wavelet is indeed an acceptable choice for our transient detection purposes.

  4.2 Effects of More Complicated Wavelets

            The Haar Wavelet was designed to detect transients [14].  However, its simplicity prevents it from getting a truly accurate representation of complicated signals [16].  To clarify this, note that the Haar wavelet’s property of differencing every two samples prevents it from properly representing curves.  As an illustration of this effect, take the example function in Figure 11.  This is a function composed of three separate frequencies super-imposed on top of each other with two transients injected into the signal.  Figures 12 and 13 show the first level Haar and Daubechies wavelet decompositions of the signal.  Notice that the transients are equally visible through both wavelet filters, yet the Daubechies is able to pass over the remainder of the signal in a much smoother pattern.

Figure 11: Example Function [11]

 

Figure 12: Level 1 Haar Wavelet Decomposition of Example Function [11]

 

Figure 13: Level 1 Daubechies Wavelet Decomposition of Example Function [11]

 

Wavelet Homepage                               Table of Contents