Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Wavelet coefficients -- what do they mean exactly?

Subject: Wavelet coefficients -- what do they mean exactly?

From: Frank

Date: 4 Dec, 2009 17:28:25

Message: 1 of 21

Kind of new to wavelet analysis here. I'm trying to isolate certain
frequencies from a signal, to determine the amplitude of those
frequencies. It seems like wavelets are good thing to use for this.
However, I'm having trouble understanding what exactly the
coefficients are after performing a wavelet transform (be it with CWT
or DWT). It seems like the coefficients would need to be adjusted by
some scaling or other factor to get them back into a representation of
the signal. I guess the inverse transform can do this, after setting
all the other coefficients to zero? Or is there an easier way?

I'm sure I probably need to give more details. Any help would be
appreciated.

Thanks,
Frank

Subject: Wavelet coefficients -- what do they mean exactly?

From: Rune Allnor

Date: 4 Dec, 2009 17:31:21

Message: 2 of 21

On 4 Des, 18:28, Frank <fble...@yahoo.com> wrote:
> Kind of new to wavelet analysis here. I'm trying to isolate certain
> frequencies from a signal, to determine the amplitude of those
> frequencies. It seems like wavelets are good thing to use for this.

They are not.

> However, I'm having trouble understanding what exactly the
> coefficients are after performing a wavelet transform (be it with CWT
> or DWT). It seems like the coefficients would need to be adjusted by
> some scaling or other factor to get them back into a representation of
> the signal. I guess the inverse transform can do this, after setting
> all the other coefficients to zero? Or is there an easier way?

Wavlets do exactly that - represent the signal. They are
different from e.g. Fourier transforms in that they have
no obvious *intuitive* interpretation.

> I'm sure I probably need to give more details.

No, you don't.

> Any help would be
> appreciated.

You are using the wrong tool for the job.

Rune

Subject: Wavelet coefficients -- what do they mean exactly?

From: Frank

Date: 4 Dec, 2009 17:40:10

Message: 3 of 21

On Dec 4, 11:31 am, Rune Allnor <all...@tele.ntnu.no> wrote:

> > Any help would be
> > appreciated.
>
> You are using the wrong tool for the job.
>
> Rune

What's the right tool then...bandpass filtering?

Subject: Wavelet coefficients -- what do they mean exactly?

From: Rune Allnor

Date: 4 Dec, 2009 17:55:05

Message: 4 of 21

On 4 Des, 18:40, Frank <fble...@yahoo.com> wrote:
> On Dec 4, 11:31 am, Rune Allnor <all...@tele.ntnu.no> wrote:
>
> > > Any help would be
> > > appreciated.
>
> > You are using the wrong tool for the job.
>
> > Rune
>
> What's the right tool then...bandpass filtering?

The DFT.

Rune

Subject: Wavelet coefficients -- what do they mean exactly?

From: Frank

Date: 4 Dec, 2009 18:04:40

Message: 5 of 21

On Dec 4, 11:55 am, Rune Allnor <all...@tele.ntnu.no> wrote:
> On 4 Des, 18:40, Frank <fble...@yahoo.com> wrote:
>
> > On Dec 4, 11:31 am, Rune Allnor <all...@tele.ntnu.no> wrote:
>
> > > > Any help would be
> > > > appreciated.
>
> > > You are using the wrong tool for the job.
>
> > > Rune
>
> > What's the right tool then...bandpass filtering?
>
> The DFT.
>
> Rune

I guess I should have added that the data is non-stationary. It's a
time series of wind data. I'm trying to isolate wind gust of a certain
frequency. DFT didn't really give me what I was looking for. Thanks.

Subject: Wavelet coefficients -- what do they mean exactly?

From: dbd

Date: 5 Dec, 2009 02:45:10

Message: 6 of 21

On Dec 4, 9:40 am, Frank <fble...@yahoo.com> wrote:

.> ...
.> What's the right tool then...bandpass filtering?

Frank

Both wavelets and DFTs are decompositions into bandpass filters. For
wavelets, the filter spacings and bandwidths are inversely
proportional to frequency. For DFTs the the filter bandwidths and
spacings are constant with frequency and the bandwidth is inversely
proportional to effective data window length while the filter spacings
are inversely proportional to transform size.

To apply either correctly you need to figure the correct window/
wavelet duration and compute samples of the subbands often enough to
satisfy Nyquist for the bandwidth of each subband.

Those confronted with non-stationary data often forget that the
achievable resolution is determined by the dynamics of their data, not
the size of the DFTs they can select and use too large an fft and too
large a data stride between the starts of data blocks transformed.
This then, of course, doesn't give you what you are looking for.
Picking the scale and mother wavelet duration for the correct
wavelets is also dependent on the dynamics of your data.

The important difference between choosing DFT and wavelets depends of
how the dynamics of your signals vary with frequency. If high
frequencies change faster, low frequencies slower, wavelets might
match. If the dynamics are similar across frequency, the DFT may work
better. Long practice has shown the DFT to be the proper tool for many
real world applications.

As always:
Knowledge of the data is improved by choosing the right tools.
Choice of tools is improved by knowledge of the data.

And you are correct, you probably need to give more details to get
help selecting the right tools.

Dale B. Dalrymple

Subject: Wavelet coefficients -- what do they mean exactly?

From: Matt J

Date: 5 Dec, 2009 10:24:08

Message: 7 of 21

Frank <fbleahy@yahoo.com> wrote in message <768a1f40-b1f5-4f8b-ab88-8de90ea94ef3@r40g2000yqn.googlegroups.com>...
> Kind of new to wavelet analysis here. I'm trying to isolate certain
> frequencies from a signal, to determine the amplitude of those
> frequencies. It seems like wavelets are good thing to use for this.

Wavelet transforms can be a good way of separating a signal into coarse features and fine features, but it's important to understand that they don't decompose it into sinusoids, as Fourier transforms do. So, if when you say you want to "isolate certain frequencies", you mean frequencies of sinusoidal components, then Fourier analysis is probably more appropriate.



> However, I'm having trouble understanding what exactly the
> coefficients are after performing a wavelet transform (be it with CWT
> or DWT).

Well, they are coefficients of a certain set of basis function which, when summed together give you your signal. When you do

[cA,cD]=dwt(X,'wname')

The 'wname' argument determines what family of basis functions to use. The cA are coefficients of the family's father wavelet basis functions and the cD are coefficients of the mother wavelets. You'll need to google the different wavelet families to see what these functions look like and see which family best matches the wind gusts you are trying to isolate.

You should also be aware of waverec() which apples dwt() recursively to the cA coefficients. It will let you get approximations to your signal of different coarseness/fineness...


> some scaling or other factor to get them back into a representation of
> the signal. I guess the inverse transform can do this, after setting
> all the other coefficients to zero? Or is there an easier way?

Yes, but isn't that easy/natural? It's exactly what we do when we filter in Fourier space.

Subject: Wavelet coefficients -- what do they mean exactly?

From: Rune Allnor

Date: 5 Dec, 2009 12:42:53

Message: 8 of 21

On 4 Des, 19:04, Frank <fble...@yahoo.com> wrote:
> On Dec 4, 11:55 am, Rune Allnor <all...@tele.ntnu.no> wrote:
>
>
>
>
>
> > On 4 Des, 18:40, Frank <fble...@yahoo.com> wrote:
>
> > > On Dec 4, 11:31 am, Rune Allnor <all...@tele.ntnu.no> wrote:
>
> > > > > Any help would be
> > > > > appreciated.
>
> > > > You are using the wrong tool for the job.
>
> > > > Rune
>
> > > What's the right tool then...bandpass filtering?
>
> > The DFT.
>
> > Rune
>
> I guess I should have added that the data is non-stationary. It's a
> time series of wind data. I'm trying to isolate wind gust of a certain
> frequency. DFT didn't really give me what I was looking for. Thanks.

The DFT gives you what you *said* you are looking for.
If you are unable to specify the task, you are in deep
trouble no matter what tools you mess around with.

Rune

Subject: Wavelet coefficients -- what do they mean exactly?

From: Nicolas

Date: 5 Dec, 2009 15:31:04

Message: 9 of 21

Frank <fbleahy@yahoo.com> wrote in message <768a1f40-b1f5-4f8b-ab88-8de90ea94ef3@r40g2000yqn.googlegroups.com>...
> Kind of new to wavelet analysis here. I'm trying to isolate certain
> frequencies from a signal, to determine the amplitude of those
> frequencies. It seems like wavelets are good thing to use for this.
> However, I'm having trouble understanding what exactly the
> coefficients are after performing a wavelet transform (be it with CWT
> or DWT). It seems like the coefficients would need to be adjusted by
> some scaling or other factor to get them back into a representation of
> the signal. I guess the inverse transform can do this, after setting
> all the other coefficients to zero? Or is there an easier way?
>
> I'm sure I probably need to give more details. Any help would be
> appreciated.
>
> Thanks,
> Frank

Hi Frank,

If you know what frequencies have to be isolated, and just want to determine what are their amplitudes, there are tools called "Matrix Pencil" and "Fast Orthogonal Search".

Regards,
Nicolas

Subject: Wavelet coefficients -- what do they mean exactly?

From: Frank

Date: 7 Dec, 2009 05:07:05

Message: 10 of 21

> The important difference between choosing DFT and wavelets depends of
> how the dynamics of your signals vary with frequency. If high
> frequencies change faster, low frequencies slower, wavelets might
> match. If the dynamics are similar across frequency, the DFT may work
> better. Long practice has shown the DFT to be the proper tool for many
> real world applications.
>
Thanks for the response. The dynamics are not similar. That's why I
thought wavelets would be better. The data basically consists of
contributions from all frequencies, but magnitude of those features
change with time. If I do a DFT, I can isolate a certain frequency,
but it will have the same amplitude for all times (at least in the
chosen window of the data). I guess I can do the short FFT, I just
wanted to see if wavelets would be a better tool. If I do the wavelet
transform, the coefficients basically look like my data (at certain
scales/frequencies). I just wasn't sure if I can stop there, or if I
needed to do the inverse transform (with idwt or waverec) on just
those coefficients that correspond to the desired frequency.

Subject: Wavelet coefficients -- what do they mean exactly?

From: Frank

Date: 7 Dec, 2009 05:14:55

Message: 11 of 21

> Wavelet transforms can be a good way of separating a signal into coarse features and fine features, but it's important to understand that they don't decompose it into sinusoids, as Fourier transforms do. So, if when you say you want to "isolate certain frequencies", you mean frequencies of sinusoidal components, then Fourier analysis is probably more appropriate.

Exactly....and I do not want the sinusoids. I want to isolate the
single events. That's why I figured wavelets would be the right tool.
>
> Well, they are coefficients of a certain set of basis function which, when summed together give you your signal.  

So does "idwt" just sum the coefficients to get back to the signal?

Subject: Wavelet coefficients -- what do they mean exactly?

From: Matt J

Date: 7 Dec, 2009 05:55:07

Message: 12 of 21

Frank <fbleahy@yahoo.com> wrote in message <eece67c5-1351-4082-b835-beafc0b393c4@j9g2000vbp.googlegroups.com>...

> So does "idwt" just sum the coefficients to get back to the signal?

Or something equivalent to that, yes

Subject: Wavelet coefficients -- what do they mean exactly?

From: Frank

Date: 7 Dec, 2009 18:44:29

Message: 13 of 21

Perhaps I should give some background on what I am trying to do. I
have several time series of wind measurements. A simple view is that
the data consists of many different frequencies, for which the
magnitudes (ie, wind gusts) for certain frequencies will vary
depending on time of day. I'm trying to capture how those magnitudes
vary with time of day. I suppose I'm looking for the ultimate bandpass
filter. If I use DFT, the magnitudes are the same for all times, which
I know is not correct, but is just an artifact of doing DFT. So I
tried using wavelets. I do the transform (tried both dwt and cwt), and
get the coefficients for certain scales/frequencies, which appear to
have the same characteristics of my data. However, there seems to be a
scaling issue with them. Which brings me back to my original
question.....what exactly are the coefficients? Are they basically the
"bandpass" of a signal? Or do they need to be inverse transformed to
be the "bandpass" part? And is the latter accomplished by keeping the
coefficient of the scale of interest, and setting all the other
coefficients to zero and doing an inverse transform (unfortunately,
there is no icwt in Matlab)?

Sorry if these are dumb questions. I just can't seem to figure this
out.

Subject: Wavelet coefficients -- what do they mean exactly?

From: TideMan

Date: 7 Dec, 2009 18:59:39

Message: 14 of 21

On Dec 8, 7:44 am, Frank <fble...@yahoo.com> wrote:
> Perhaps I should give some background on what I am trying to do. I
> have several time series of wind measurements. A simple view is that
> the data consists of many different frequencies, for which the
> magnitudes (ie, wind gusts) for certain frequencies will vary
> depending on time of day. I'm trying to capture how those magnitudes
> vary with time of day. I suppose I'm looking for the ultimate bandpass
> filter. If I use DFT, the magnitudes are the same for all times, which
> I know is not correct, but is just an artifact of doing DFT. So I
> tried using wavelets. I do the transform (tried both dwt and cwt), and
> get the coefficients for certain scales/frequencies, which appear to
> have the same characteristics of my data. However, there seems to be a
> scaling issue with them. Which brings me back to my original
> question.....what exactly are the coefficients? Are they basically the
> "bandpass" of a signal? Or do they need to be inverse transformed to
> be the "bandpass" part? And is the latter accomplished by keeping the
> coefficient of the scale of interest, and setting all the other
> coefficients to zero and doing an inverse transform (unfortunately,
> there is no icwt in Matlab)?
>
> Sorry if these are dumb questions. I just can't seem to figure this
> out.

For orthogonal wavelets, using wrcoef, you can inverse transform the
coefficients into the "wavelet details". Now, you have a set of time
series at various scales that you can process using time series
analysis. The details have the same length as the original signal and
can be combined or treated individually. And they are orthogonal, so
they are completely uncorrelated with each other.

One data processing exercise I find useful is a zero-crossing analysis
on each detail. This generates a series of wave heights, periods (or
more strictly time scales), and times of occurrence. Then you can
split the record into windows and in each window calculate the average
of the highest third of the waves to get an estimate of the
"significant" wave height.

You can do the same with continuous wavelets, but instead of getting a
finite number of orthogonal details, you get a continuous distribution.

Subject: Wavelet coefficients -- what do they mean exactly?

From: dbd

Date: 7 Dec, 2009 19:57:21

Message: 15 of 21

On Dec 7, 10:44 am, Frank <fble...@yahoo.com> wrote:
> Perhaps I should give some background on what I am trying to do. I
> have several time series of wind measurements. A simple view is that
> the data consists of many different frequencies, for which the
> magnitudes (ie, wind gusts) for certain frequencies will vary
> depending on time of day. I'm trying to capture how those magnitudes
> vary with time of day. I suppose I'm looking for the ultimate bandpass
> filter. If I use DFT, the magnitudes are the same for all times, which
> I know is not correct, but is just an artifact of doing DFT. So I
> tried using wavelets. I do the transform (tried both dwt and cwt), and
> get the coefficients for certain scales/frequencies, which appear to
> have the same characteristics of my data. However, there seems to be a
> scaling issue with them. Which brings me back to my original
> question.....what exactly are the coefficients? Are they basically the
> "bandpass" of a signal? Or do they need to be inverse transformed to
> be the "bandpass" part? And is the latter accomplished by keeping the
> coefficient of the scale of interest, and setting all the other
> coefficients to zero and doing an inverse transform (unfortunately,
> there is no icwt in Matlab)?
>
> Sorry if these are dumb questions. I just can't seem to figure this
> out.

Both DFT and DWT coefficients are the convolutions of a bandpass
impulse response with segments of your data. For the DFT the impulse
responses are windowed, frequency shifted sines and cosines. The
Fourier transform of the window describes the shape of the passband.
The effective duration of the window determines the time resolution.
It is a common, but not always the best, practice to use an FFT the
size of the window.

For an example with your data, consider the DFT. If you have, say, a
day worth of data samples and you want to know the frequency content
of wind speed during 5 minute gusts, break your data into 5 minute
segments (this is usually done into segments that overlap, say, 50%)
and perform the FFT on these segments. If you plot power against
segment number (time), you have a time-frequency distribution. Plotted
with time horizontal, the display is often called a spectrogram.
Plotted with time vertical, the display is often called a waterfall
(particularly if it actively scrolls). You would not use wavelets for
this task because when you select a wavelet for 5 minute duration at a
nominal frequency, you get twice that duration (10 minutes) at half
that frequency, four times (20 minutes) at a quarter of the nominal
frequency, etc.

In practice I have only seen the DC term of this process, peaked
picked and displayed on an hourly basis. This can be more easily
calculated as a single lowpass filter on sample magnitudes.

Dale B. Dalrymple

Subject: Wavelet coefficients -- what do they mean exactly?

From: Frank

Date: 8 Dec, 2009 23:06:37

Message: 16 of 21

On Dec 7, 12:59 pm, TideMan <mul...@gmail.com> wrote:
>
> For orthogonal wavelets, using wrcoef, you can inverse transform the
> coefficients into the "wavelet details".  Now, you have a set of time
> series at various scales that you can process using time series
> analysis.  The details have the same length as the original signal and
> can be combined or treated individually.  And they are orthogonal, so
> they are completely uncorrelated with each other.

TideMan.....thanks for the suggestion on wrcoef. It worked like a
charm!! I just wished there was a way to do scales that are in between
2^1, 2^2, 2^3, etc.

Subject: Wavelet coefficients -- what do they mean exactly?

From: dbd

Date: 8 Dec, 2009 23:56:42

Message: 17 of 21

On Dec 8, 3:06 pm, Frank <fble...@yahoo.com> wrote:
> On Dec 7, 12:59 pm, TideMan <mul...@gmail.com> wrote:
> ...
> I just wished there was a way to do scales that are in between
> 2^1, 2^2, 2^3, etc.

In major system applications that span multiple octaves, such as
passive sonar processing for submarine towed arrays or sonobuoy data
the common practice has been to decompose into octave bands and
perform an fft spanning each band to efficiently achieve finer
resolutions like 100 to 800 filters per octave. The process works fine
at coarser resolutions as well.

If you are fussy about geometric spacing, the same ffts can be used to
generate arbitrarily spaced constant Q filters. See:
J. Brown and M. Puckette. An efficient algorithm for the calculation
of a constant Q transform. JASA,. 92(5):2698–2701, 1992.

Dale B. Dalrymple

Subject: Wavelet coefficients -- what do they mean exactly?

From: TideMan

Date: 9 Dec, 2009 06:56:04

Message: 18 of 21

On Dec 9, 12:06 pm, Frank <fble...@yahoo.com> wrote:
> On Dec 7, 12:59 pm, TideMan <mul...@gmail.com> wrote:
>
>
>
> > For orthogonal wavelets, using wrcoef, you can inverse transform the
> > coefficients into the "wavelet details".  Now, you have a set of time
> > series at various scales that you can process using time series
> > analysis.  The details have the same length as the original signal and
> > can be combined or treated individually.  And they are orthogonal, so
> > they are completely uncorrelated with each other.
>
> TideMan.....thanks for the suggestion on wrcoef. It worked like a
> charm!! I just wished there was a way to do scales that are in between
> 2^1, 2^2, 2^3, etc.

Well, maybe you should use continuous wavelets, as per this page:
http://paos.colorado.edu/research/wavelets/

And have a look here at how I use the methods of Torrence & Compo for
real-time analysis of long waves (e.g., tsunami):
http://www.tideman.co.nz/GeoNet/NorthCape.html
See Figure 1B and the explanation here:
http://www.tideman.co.nz/GeoNet/LWExtractionMethodology.htm#ConWave

Subject: Wavelet coefficients -- what do they mean exactly?

From: Frank

Date: 9 Dec, 2009 15:54:44

Message: 19 of 21

On Dec 9, 12:56 am, TideMan <mul...@gmail.com> wrote:

> Well, maybe you should use continuous wavelets, as per this page:http://paos.colorado.edu/research/wavelets/
>
> And have a look here at how I use the methods of Torrence & Compo for
> real-time analysis of long waves (e.g., tsunami):http://www.tideman.co.nz/GeoNet/NorthCape.html
> See Figure 1B and the explanation here:http://www.tideman.co.nz/GeoNet/LWExtractionMethodology.htm#ConWave

Thanks again TideMan. Yes....I tried using continuous wavelets, since
you can choose whatever scale you desire. But how do you reconstruct
with the continuous wavelet? Or do I even need to? There appears to be
scale and phase issues that need to be accounted for (via
reconstruction or some other method?). I found the invcwt function by
Jon Erickson on the file exchange. Did you use something like that?

Subject: Wavelet coefficients -- what do they mean exactly?

From: TideMan

Date: 9 Dec, 2009 18:52:08

Message: 20 of 21

On Dec 10, 4:54 am, Frank <fble...@yahoo.com> wrote:
> On Dec 9, 12:56 am, TideMan <mul...@gmail.com> wrote:
>
> > Well, maybe you should use continuous wavelets, as per this page:http://paos.colorado.edu/research/wavelets/
>
> > And have a look here at how I use the methods of Torrence & Compo for
> > real-time analysis of long waves (e.g., tsunami):http://www.tideman.co.nz/GeoNet/NorthCape.html
> > See Figure 1B and the explanation here:http://www.tideman.co.nz/GeoNet/LWExtractionMethodology.htm#ConWave
>
> Thanks again TideMan. Yes....I tried using continuous wavelets, since
> you can choose whatever scale you desire. But how do you reconstruct
> with the continuous wavelet? Or do I even need to? There appears to be
> scale and phase issues that need to be accounted for (via
> reconstruction or some other method?). I found the invcwt function by
> Jon Erickson on the file exchange. Did you use something like that?

It's all in Torrence and Compo.
Here's the code:
denom=scale'*ones(1,nt);
ywrecon=real(wave)./sqrt(denom);
ywrecon=ywrecon*sqrt(dt)*dj*factor;

where factor is from Table 2 of Torrence and Compo, and the other
arrays and parameters are from T&C's wavelet function.

Subject: Wavelet coefficients -- what do they mean exactly?

From: Frank

Date: 10 Dec, 2009 14:41:32

Message: 21 of 21

On Dec 9, 12:52 pm, TideMan <mul...@gmail.com> wrote:
>
> It's all in Torrence and Compo.
> Here's the code:
> denom=scale'*ones(1,nt);
> ywrecon=real(wave)./sqrt(denom);
> ywrecon=ywrecon*sqrt(dt)*dj*factor;
>
> where factor is from Table 2 of Torrence and Compo, and the other
> arrays and parameters are from T&C's wavelet function.

Thanks again TideMan. You have been a tremendous help on this one.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us