Wavelet plot with Python libraries
Asked Answered
D

1

7

I know that SciPy has some signal processing tools for wavelets in scipy.signal.wavelets and a chart can be drawn using Matplotlib, but it seems I can't get it right. I have tried plotting a Daubechies wavelet against a linear space, but it's not what I am looking for. I am highly unskilled about wavelets and math in general . :)

Dumfound answered 7/7, 2009 at 20:25 Comment(1)
Also an explanation of what it IS that you're looking for, since all you mention is that it's NOT "plotting a daub wavelet against a linspace" but that leaves another trillion things it COULD be!-)Vevay
Z
14

With a recent trunk version of PyWavelets, getting approximations of scaling function and wavelet function on x-grid is pretty straightforward:

[phi, psi, x] = pywt.Wavelet('db2').wavefun(level=4)

Note that x-grid output is not available in v0.1.6, so if you need that you will have to use the trunk version.

Having that data, you can plot it using your favourite plotting package, for example:

import pylab
pylab.plot(x, psi)
pylab.show()

A very similar method is used on wavelets.pybytes.com demo page, but there the charts are done with Google Charts for online presentation.

Zig answered 13/7, 2009 at 10:3 Comment(1)
Thanks, I found this method after I had this post, but I was too tired to put an answer.Dumfound

© 2022 - 2024 — McMap. All rights reserved.