Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Wavelets Extract High and Low Frequencies

Wavelets are powerful tools that can help you analyze signals and compress data, but you first have to know how to use them.

John Hanks and Mahesh Chugani, National Instruments, Austin, TX -- Test & Measurement World, 8/1/1997

Whenever you analyze electrical signals, you often can't look at a waveform you've captured and see all the information you need. When you capture and plot a signal, you get only a graph of amplitude versus time. Sometimes, you need frequency and phase information, too. Other times, you need to now when in a waveform certain characteristics occur. Signal processing can help, but you need to know which type of processing to apply to solve your data-analysis problem.

Many engineers use the fast Fourier transform (FFT) to represent a signal in terms of its frequency components. FFTs are useful, but they don't always tell you what you need to know about a signal. In applications where time information isn't important, and the frequency content is all you need, then the FFT is an excellent tool for data analysis.

The FFT limits your ability to analyze a signal, though, because it doesn't tell you when a particular frequency component occurs within a signal. Suppose you have a signal that contains two sine waves of different frequencies that occur at different times. With an FFT, you'll get the same frequency plot regardless of which frequency occurred first. That's where using wavelet transforms can help. Wavelet transforms can preserve the timing information that FFTs lose. And with wavelet transforms, you can simultaneously extract both low-frequency and high-frequency signals with different frequency resolutions--something you can't do with FFTs.

Perhaps you've read about wavelets and wavelet transforms but aren't sure what they do or how to use them. While the Internet contains many papers on wavelets, most are written by mathematicians and you can easily get lost in the math (see "Wavelet Web Sites" at the end of this article). Wavelets have kept the mathematicians busy for the last 10 years, and now it's time for practicing engineers to learn how to use these powerful tools.

Wavelets Versus FFTs
The best way to understand wavelets is to compare them with FFTs. FFTs tell you how well a signal matches a set of sinusoidal waveforms of different frequencies. That's the equivalent to passing the signal through a filter bank. The output of each filter (bin) has a Fourier coefficient. The greater the magnitude of the coefficient, the more that bin's frequency matches a frequency in the original waveform. Each bin spans a frequency band of equal width. Therefore, you get the same frequency resolution across every bin in a spectral plot.

Fourier transforms are based on the assumption that the signals they transform repeat forever. Because of that assumption, FFTs lose all time information from the time-domain signal. Not so with wavelet transforms. When using wavelet transforms to analyze a signal, you can break down the signal as the weighted sum of time-limited functions (wavelets). Because wavelets are time limited, they preserve some time information about the waveform. How much time information a wavelet preserves depends on the duration of the wavelet relative to the duration of the waveform you need to analyze.

You can adjust the time duration of a wavelet, which lets you best extract signals of different frequencies from a waveform. You're not forced to transform all portions of a waveform with equal frequency resolution as you are with FFTs. Like an FFT, a wavelet transform is effectively a filter bank. Unlike an FFT, a wavelet transform breaks the original signal into a set of logarithmic, rather than equal, bands.

To produce a wavelet transform, you must pick the waveform that you think best matches the signal characteristics you want to analyze. You're not limited to performing these transforms with sinusoid. The waveform, or base function, you choose to apply to your signal is called a mother wavelet. Because you choose the wavelet shape, you have an infinite number of choices for each mother wavelet.

The trick to using wavelets is to find or design the best mother wavelet to use in your transform. The better the match, the higher the magnitude of the coefficients the transform will produce. Using wavelets is, in effect, a pattern-matching process.

Figure 1 shows the process of using a wavelet. The actual wavelet transform takes place in software. That software is usually a C routine that you use as part of your own analysis program. Wavelet routines are available for many math and data-acquisition software packages. Some wavelet routines are available free over the Internet.

08f2fg1a.gif

Figure 1. Finding the best wavelet is a trial-and-error process. You have to keep trying until you find a wavelet that best matches the characteristic of the input signal you want to analyze or process.

Best Fit
You first have to select your mother wavelet. Try to use a wavelet that will produce the best match to the signal you want to analyze. Some examples of wavelets are shown in the top of Figure 1.

Next, you try to best fit the mother wavelet to the portion or portions of the original waveform that you want to analyze. To do that, you scale the mother wavelet in time (dilate or compress) and create a daughter wavelet. You can also shift the daughter wavelet in time to effectively scan across the time-domain-waveform. Altering the width of the mother wavelet changes the frequency resolution of the transform. Assume you need to extract the discontinuity from the original signal. You might choose a wavelet similar to the second wavelet from the left in Figure 1 for your mother wavelet.

Discontinuities in waveforms contain high frequencies, so you may have to compress the mother wavelet's time duration (width). If you sufficiently compress the mother wavelet, the daughter wavelet will contain frequencies high enough to extract the high frequencies in the discontinuity, but will remove the remaining frequencies in the original waveform. In effect, you'll create a high-pass filter.

Figure 2 shows a mother wavelet compressed into a daughter wavelet. The wavelet transform software scans the daughter wavelet across the original signal. When the wavelet passes over the drop-off in the original signal, the transform's output (coefficients) rise sharply, and then drop sharply when the wavelet moves past the drop-off.

Figure 2. Compressing a mother wavelet into a daughter wavelet lets you attain the best match to a specific characteristic of a waveform.

You can also dilate a mother wavelet when you need to extract low frequencies. Doing so lowers the frequencies contained in the mother wavelet, but increases the frequency resolution. Dilating a wavelet effectively creates a low-pass filter. Therefore, you can use wavelets to match both low and high frequencies in your waveforms with different resolutions. You can't do that with an FFT because the width of each frequency bin is the same across the spectrum.

A Real-World Example
Working with Dennis Erickson, senior electronics engineer at Bonneville Power Administration (Vancouver, WA), we used wavelets to analyze electric power lines. Erickson discovered that prior to a power failure, the load on the electric lines displayed a small, low-frequency, nonsinusoidal characteristic.

To measure how much of a warning occurred, we had to know when a power failure occurred and then develop a method for predicting those failures. The top trace in Figure 3 shows the load on the power lines dropping to zero from a power failure. A small-amplitude signal on the power line's load always precedes the power failure. We realized that if we could detect the presence of that warning signal, we could possibly avoid a power failure.

Figure 3. Wavelet transforms can simultaneously extract both high-frequency components (middle plot) and low-frequency components (bottom plot) of a waveform.

We calculated the time of the failure by performing a wavelet transform on the power-line load signal. When the power outage occurred, we recorded a high-frequency component (a discontinuity) when the load signal dropped to zero. Had we performed an FFT on this signal, we would have seen the high frequencies from the drop-off, but we would have had no idea when the high frequency component, and hence the power outage, occurred.

Figure 3 shows that we extracted the high frequencies at the time of the power failure. Note that the spike in the middle trace appears directly below the point of the power failure. That tells us that the wavelet transform preserved the time information. The scales on the plots represent bins, and the entire x-axis on each plot represents an equal amount of time. (We'll explain the differences in x-axis scales later.)

By performing a wavelet transform on the original signal using a dilated scale, we extracted the low-frequency, low-amplitude signal that precedes a power failure. The result of this transform appears in the bottom trace of Figure 3. The signal is difficult to extract from the original waveform using an FFT because the load on the power line can slowly change, resulting in the same frequencies as the warning signal. Because the warning signal is unique, we could extract it with a wavelet transform, something we couldn't do with an FFT.

Extract High Frequencies
Here's how the transform worked. After choosing our mother wavelet and scaling it, we called the wavelet transform function in software to perform a transform using the compressed daughter wavelet. When the daughter wavelet passed the power failure, the coefficients (or output) from the transform suddenly increased because the wavelet matched the discontinuity far better than it matched any other point. After the daughter wavelet passed the drop-off bin, the coefficients dropped sharply.

Because we knew at which bin in the transform the match occurred and we knew the amount of time duration for each bin, we could tell when the power failure occurred to within the duration of the daughter wavelet. The wavelet transform preserved the time information about when the power failure occurred.

Extract Low Frequencies
Detecting the sharp drop-off of the power-line failure was relatively easy because the drop-off was prominent in the waveform. But, how did Erickson's computer extract the low-level frequency signal that precedes a power failure? Figure 4 shows that process.

Figure 4. Applying a narrow daughter wavelet to the power signal is equivalent to applying a high-pass filter, which completes path 1. The result is a spike at the time of the power drop. Extracting the leading low-frequency signal requires applying four daughter wavelets that are wider than the signal you need to match, then applying a fifth daughter wavelet that became a high-pass filter, completing path 2.

We took advantage of the wavelet transform's logarithmic bands to achieve enough frequency resolution to extract the 0.3-Hz warning signal from the original signal. We chose a mother wavelet that approximated the nonsinusoidal oscillations that preceded the power failure. In this case, we dilated a mother wavelet before performing the transform.

To get a coefficient of sufficient magnitude to extract the signal, the wavelet transform software had to process the wavelet five times. The first four times, the transform effectively passed the signal through a low-pass filter. Only on the fifth pass did the transform produce a coefficient substantial enough to extract the 0.3-Hz signal through the high-pass filter. At the fifth pass, the wavelet transform could finally complete its job. At that point, the width of the wavelet was long enough for its frequencies to be below that of the 0.3-Hz signal, and thus the final stage was a high-pass filter. The combination of the four low-pass filters and final high-pass filter created a bandpass filter. The results of the transform appear in the bottom plot in Figure 3.

Compare the results of the wavelet transforms in Figure 3 with the process in Figure 4. Note that the value in path 1 of Figure 3 is 1. That tells you that the wavelet transform required just one high-pass filter to extract the high-frequency signal indicating the loss of power. Because we were interested in extracting the highest frequencies in the original waveform, the transform could extract those frequencies with a high-pass filter.

Path 2, however, required five filter banks to extract the low-frequency signal that preceded the power failure. That corresponds to the 00001 value in Figure 3. The four zeros indicate that the signal passed through four low-pass filters before the transform could apply a high-pass filter. Therefore, we needed to go through five stages to get a coefficient large enough to detect the 0.3-Hz signal.

The three x-axis scales in Figure 3 represent bins. You'll recall that with Fourier transforms, the number of bins in the frequency domain is always equal to the number of points in the time domain, but half of the information is repeated. Therefore, a signal captured in 1024 samples will yield a 512-bin FFT. That same ratio occurs in each stage of the wavelet transform. Because we needed only one filter to get the output we needed in path 1, the wavelet transform reduced the number of bins by a factor of two in producing the middle trace in Figure 3. While the plot doesn't show the exact number of points, you can still see that the number of points in the top trace is about twice the number of points in the middle trace. Because path 2 required five filter banks, the transform divided the number of points by 25, or 32.

Each plot in Figure 3 represents the same amount of time. Because the middle plot has half the number of points as the top plot, each point in the middle plot represents twice the amount of time as points in the top plot. In the bottom plot, each point represents 32 times the amount of time as does each point in the top plot. The wavelet transform, therefore, preserves time information. But each filter bank cuts the number of points, and hence the time resolution, by 2. FFTs, on the other hand, lose all time information.

Once we knew how to extract the low-frequency signal, Erickson could program his computers to continuously perform a wavelet transform on the power-line signal. Because the warning signal is unique, the transforms produce a significant coefficient only when the warning signal appears. The computers detect the presence of the large coefficient and trigger alarms.

Inverse Wavelet Transforms
You can do more with wavelets than just use them to analyze portions of a waveform. Wavelets are also useful in data compression and other forms of signal processing.

Once you've transformed a time-domain signal into the wavelet domain, you can process the signal and perform an inverse wavelet transform to reconstruct the signal. The top plot in Figure 5 shows an EKG signal. The second plot shows the output after one stage of high-pass filtering. The third plot shows the signal after two stages of filtering--one a low pass, the other a high pass. Finally, the bottom trace shows the waveform after another stage of low-pass filtering--we've reproduced the original waveform with one-fourth the number of points (900 versus 3600).

Figure 5. Wavelets let you process an EKG signal so you can accurately plot the signal with just one-fourth the number of points (900 versus 3600).

By performing some calculations, you can reconstruct a signal minus any unwanted components. An application of this is in the removal of noise. You can also use wavelets in audio signal analysis. With wavelets, you can remove the sound of any instrument from an orchestra or any voice from a chorus. You can also obtain a close approximation of the original signal during reconstruction by choosing only those coefficients with a sufficiently large value and omitting those with small amplitudes. That's what makes wavelets attractive for data compression.

Regardless of how you use wavelets, you still must master the art of selecting the right wavelet for your transform. There are certain rules of thumb to follow when selecting a wavelet. The most important thing to remember is that you use a wavelet transform to extract a unique signal from certain subband combinations. Most of the time, you won't know which combination, and hence which wavelet, will give you the best results. Fortunately, you can easily change the wavelet and time scales and observe the output of each coefficient. Using this technique, you can design the optimum wavelet transform for your application. T&MW

FOR FURTHER READING
Chiu, C. K., An Introduction to Wavelets, Academic Press, New York, NY, 1992.

Graps, Amara, "An Introduction to Wavelets," IEEE Computational Science & Engineering, Summer 1995, IEEE, Piscataway, NJ.

Wickerhauser, Mladen Victor, Adapted Wavelet Analysis from Theory to Software, A.K. Peters, Wellesley, MA, 1994.

Wavelet Web Sites
www.wavelet.org
www.amara.com/current/wavelet.html
ftn.kaist.ac.kr/

John Hanks is the analysis product manager for National Instruments, where he is responsible for the company's analysis and image-processing products. He received a B.S.E.E. from Texas A&M University and an M.S.E.E. from the University of Texas at Austin.

Mahesh Chugani is a DSP software engineer with National Instruments. He holds a Ph.D. and M.S.E.E from Rensselaer Polytechnic Institute, a B.Engg., electronics and telecommunications from the College of Engineering (Pune, India), and a diploma in electronics and radio engineering, from Cusrow Wadia Institute of Technology (Pune, India).

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

 

By This Author

There are no other articles written by this author.

Sponsored Links



 
Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Podcasts

Blogs

  • Martin Rowe
    Rowe's and Columns

    May 28, 2008
    More on Bill and Dave
    In my January 11 posting, "Tell your Bill and Dave Stories," I asked if the HP Way still e...
    More
  • Rick Nelson
    Taking the Measure

    May 6, 2008
    LED bulbs not quite ready for consumer lighting
    Now that people are finally adopting compact fluorescent bulbs, is it time to throw them out and rep...
    More
  • » VIEW ALL BLOGS RSS

Podcasts

Advertisements





NEWSLETTERS

Click on a title below to learn more.

Test Industry News (3 Times Per Month)
Machine-Vision & Inspection (Monthly)
Communications Test (Monthly)
Design, Test & Yield (Monthly)
Automotive, Aerospace & Defense (Monthly)
Instrumentation (Monthly)
Resource Center E-Alert (Monthly)
About Us | Advertising Info | Site Map | Contact Us | FREE Subscription | Editorial Calendar
©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites