Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

I am having trouble understanding on how to read the plot plotted by a wavelet transform,

here is my simple Matlab code,

load noissin;
% c is a 48-by-1000 matrix, each row 
% of which corresponds to a single scale.
c = cwt(noissin,1:48,'db4','plot');

enter image description here

So the brightest part means the scaling coffiecient size is bigger, but how exactly i can understand this plot what is happening there ? Kindly help me.

share|improve this question

3 Answers 3

Imagine for one second, that you just plotted your daubechies-4 wavelet, as you can see here in red.

enter image description here

Now imagine that you take this waveform in red, and simply do a cross-correlation with your signal. You plot that result. This will be the first row of your plot. This is scale-1. Next, you dilate your Daubechies-4 wavelet, (that is, you simply make it 'stretch' it in time, by some factor). Then, you again do a cross-correlation of this new waveform with your signal. You then get row two of your plot. This is scale-2. You keep doing this for all scales, which means you keep taking your original 'mother' wavelet, and you keep dilating, then cross-correlating, dilating, and cross-correlating, etc, and you just plot the results one on top of the others.

This is what the CWT plot is showing you. The results of performing a cross-correlation of your signal with a wavelet at different scales, that is, at different dilation (stretch) factors.

So let us interpret your image. In the first row, you can see that you have weak amplitudes in your cross-correlation. That means that it is telling you, almost nothing in your signal correlates, (or 'matches') your wavelet, when it is at scale-1, (when it is at the smallest scale). You keep stretching your wavelet and correlating, and still it is not matching anything in your signal, until you reach say, scale-31. So when you stretch your wavelet 31 times, and performed a cross-correlation, you start to see some bright spots, which means you are getting good cross-correlation scores between your stretched wavelet, and your signal.

If you look however at the very top, we have the brightest spots. So for scale-46, you made that row by stretching your original wavelet 46 times, and then cross-correlated it with your signal, and then that is your row-46. So you see a lot of nice bright spots. You can see that at positions (x-axis) ~25, ~190, and ~610, I have bright spots. So that is telling you, you have some feature in your signal, that very closely matches your wavelet that is stretched 46 times. So you have 'something' at those locations that closely match your wavelet at this scale.

(Of course, in your case, you have used noise, so the positions that I have talked about are random - that is, there is nothing really 'interesting' going on. Do a CWT with a sine pulse and what I am saying can be made clearer to you.)

In summary, the CWT is simply showing you all possible correlation scores between your template/matched filter (in this case daub-4 wavelet), at different positions, (x-axis) , also at different stretched factors, (y-axis).

Hope this helped.

share|improve this answer
    
Thank you very much , this really helped, but how could you say that i have found out the frequency and time of my signal by this process? –  Sufiyan Ghori Feb 20 '13 at 16:30
1  
@Effected You found the 'time' of occurance of some feature in your signal, by where you get maximum correlation scores. (Example, ~25, ~190, ~610) in your example. To get the frequency content of your signal at that point, you can just look at the FFT of that portion of your signal, OR, you can look at the FFT of your wavelet at that scale, and look at its frequency response. –  Mohammad Feb 20 '13 at 16:33
    
So, do we suppose to take DCT after wavelet in order to have both time and frequency components ? If i have a sine wave (x-axis = time , y-axis = amplitude) and if i take its FFT then i have frequency components from the fft and time components from the original signal then why do we suppose to use wavelet ? –  Sufiyan Ghori Feb 20 '13 at 16:36
1  
@Effected The reason you use DFT/DCT, is to get global frequency content. DFT/DCT tells your frequency content for the entire signal. Where is one specific frequency in time? You dont know. However if you use wavelets, then you can find out not only what your frequency is, (similar to DFT/DCT), but also where you have that frequency. (Location in time). –  Mohammad Feb 20 '13 at 16:44
    
For the record, frequency only exists as a global concept. As soon as you start trying to pin frequency down to a time period, you are really talking about a frequency distributions. The distribution narrows as the time span or scale increases. Computing the DFT of wavelets of differing scales will give you an idea how to interpret associated transform results back to the frequency domain; think bandpass filter. The Morlet wavelet happens to have a nicely Gaussian frequency distribution that is well suited for relating back to Fourier concepts. @endolith touched on this in his response. –  user2718 Feb 20 '13 at 22:19

These plots were helpful for me to understand, coming from a STFT background:

The complex Morlet (sinusoidal) wavelet looks and behaves like the complex kernel of a STFT (since it's derived from the Gabor transform, a type of STFT). When you "slide it past" a signal of the same frequency, it matches, no matter the phase of the signal you're measuring, producing a magnitude and phase measurement at each point (and this is a plot of the magnitude alone):

Magnitude of complex Morlet wavelet transform

Magnitude plot of complex Morlet wavelet transform

The real-valued Morlet wavelet only matches when the phases of the wavelet and the signal line up. So as you slide it past the signal you're measuring, it goes in and out of phase, producing maxima and minima as they cancel or reinforce:

Magnitude of continuous real Morlet wavelet transform

Magnitude of continuous real Morlet wavelet transform

(Actually, in that case, we're plotting the magnitude, so both the positive and negative matches produce orange dots. It's better to switch to a bipolar colormap instead, to show that some peaks are in phase and others are out of phase):

Continuous real Morlet wavelet transform using bipolar colormap

Continuous real Morlet wavelet transform using bipolar colormap

With the real-valued Morlet, the magnitude and phase information are combined into a single output value.

Most commonly-used wavelets are real-valued, so they only match up when the wave you're measuring and the wave you're testing with line up, leading to these oscillations or ripples in the scalogram as you slide one past the other.

share|improve this answer
    
Where did you get those plots from, btw? –  Mohammad Feb 23 '13 at 23:14
    
@Mohammad: Oh, if you follow the links I have more information about them, but in short, I made them with this code: phy.uct.ac.za/courses/python/examples/… –  endolith Feb 24 '13 at 20:56
up vote 3 down vote accepted

This is the example that i think is the best to understand Wavelet plot.

Have a look at the image below, The Waveform (A) is our original Signal, Waveform (B) shows a Daubechies 20 (Db20) wavelet about 1/8 second long that starts at the beginning (t = 0) and effectively ends well before 1/4 second. The zero values are extended to the full 1 second. The point-by-point comparison* with our pulse signal (A) will be very poor and we will obtain a very small correlation value.

we first shift the unstretched basic or mother wavelet slightly to the right and perform another comparison of the signal with this new waveform to get another correlation value. We continue to shift and when the Db20 wavelet is in the position shown in (C) we get a little better comparison than with (B), but still very poor because (C) and (A) are different frequencies.

After we have continued shifting the wavelet all the way to the end of the 1 second time interval, we start over with a slightly stretched wavelet at the beginning and repeatedly shift to the right to obtain another full set of these correlation values. Waveform (D) shows the Db20 wavelet stretched to where the frequency is roughly the same as the pulse (A) and shifted to the right until the peaks and valleys line up fairly well. At these particular amounts of shifting and stretching we should obtain a very good comparison and a large correlation value. Further shifting to the right, however, even at this same stretching will yield increasingly poor correlations. Further stretching doesn't help at all because even when lined up, the pulse and the over-stretched wavelet won’t be the same frequency.

enter image description here

In the CWT we have one correlation value for every shift of every stretched wavelet.† To show the correlation values (quality of the “match”) for all these stretches and shifts, we use a 3-D display.

Here it goes,

enter image description here

The bright spots indicate where the peaks and valleys of the stretched and shifted wavelet align best with the peaks and valleys of the embedded pulse (dark when no alignment, dimmer where only some peaks and valleys line up, but brightest where all the peaks and valleys align). In this simple example, stretching the wavelet by a factor of 2 from 40 to 20 Hz (stretching the filter from the original 20 points to 40 points) and shifting it 3/8 second in time gave the best correlation and agrees with what we knew a priori or “up front” about the pulse (pulse centered at 3/8 second, pulse frequency 20 Hz).

We chose the Db20 wavelet because it looks a little like the pulse signal. If we didn’t know a priori what the event looked like we could try several wavelets (easily switched in software) to see which produced a CWT display with the brightest spots (indicating best correlation). This would tell us something about the shape of the event.

For the simple tutorial example above we could have just visually discerned the location and frequency of the pulse (A). The next example is a little more representative of wavelets in the real world where location and frequency are not visible to the naked eye.

See the example below,

enter image description here

Wavelets can be used to analyze local events. We construct a 300 point slowly varying sine wave signal and add a tiny “glitch” or discontinuity (in slope) at time = 180. We would not notice the glitch unless we were looking at the closeup (b).

Now lets see how FFT will display this Glitch, have a look, enter image description here

The low frequency of the sine wave is easy to notice, but the small glitch cannot be seen.

But if we use CWT instead of FFT it will clearly display that glitch, enter image description here

As you can see CWT wavelet display clearly shows a vertical line at time = 180 and at low scales. (The wavelet has very little stretching at low scales, indicating that the glitch was very short.) The CWT also compares well to the large oscillating sine wave which hides the glitch. At these higher scales the wavelet has been stretched (to a lower frequency) and thus “finds” the peak and the valley of the sine wave to be at time = 75 and 225, For this short discontinuity we used a short 4-point Db4 wavelet (as shown) for best comparison.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.