[PyWavelets] code for wavelet based spectrogram

760 views
Skip to first unread message

Brian Murphy

unread,
May 14, 2010, 11:24:56 AM5/14/10
to PyWavelets
Hi,

can anyone point me to some example code to extract the development of
frequency amplitude estimates over time, from continuous 1 dimensional
signals (EEG signals in my case, but I assume code written for audio
or other 1D signals would work equally well).

And another question, that probably reveals my ignorance about
wavelets - but do wavelets in general, or this package in particular,
yield phase estimates for each of the component frequency like a DFT
does?

thanks,

Brian

--
You received this message because you are subscribed to the Google Groups "PyWavelets" group.
To post to this group, send email to pywav...@googlegroups.com.
To unsubscribe from this group, send email to pywavelets+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pywavelets?hl=en.

Nathaniel Smith

unread,
May 22, 2010, 5:26:56 PM5/22/10
to pywav...@googlegroups.com
On Fri, May 14, 2010 at 8:24 AM, Brian Murphy <mo...@gmx.net> wrote:
> Hi,

Hi Brian,

> can anyone point me to some example code to extract the development of
> frequency amplitude estimates over time, from continuous 1 dimensional
> signals (EEG signals in my case, but I assume code written for audio
> or other 1D signals would work equally well).

The basic version of this is literally just:

pywt.wavedec(data_vector, "bior4.4")

which gives you a list where the first entry is a vector containing
the time-evolving amplitude of the lowest-frequency band, the second
entry is the same for the second-lowest frequency band, etc. Of course
there are many details that may depend on what you want to do --
"bior4.4" is the CDF 9/7 biorthogonal wavelet basis, which I've seen
people use for EEG before, though I don't have references handy. There
are a number of different wavelet bases that have different
advantages. And see also the optional arguments to wavedec if you want
more things to tweak and worry about :-).

> And another question, that probably reveals my ignorance about
> wavelets - but do wavelets in general, or this package in particular,
> yield phase estimates for each of the component frequency like a DFT
> does?

My understanding is that the closest wavelet analogue to that is the
complex wavelet transform:
http://en.wikipedia.org/wiki/Complex_wavelet_transform
which is not currently supported by pywt. I assume that the
implementation would be fairly simple given the existing code, but I
don't understand the CWT math well enough to say.

-- Nathaniel
Reply all
Reply to author
Forward
0 new messages