Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wavelet plot with Python libraries

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 . :)

like image 490
hyperboreean Avatar asked Jul 07 '09 20:07

hyperboreean


People also ask

What is db4 wavelet?

The Daubechies wavelets, based on the work of Ingrid Daubechies, are a family of orthogonal wavelets defining a discrete wavelet transform and characterized by a maximal number of vanishing moments for some given support.

How do you choose a wavelet?

An orthogonal wavelet, such as a Symlet or Daubechies wavelet, is a good choice for denoising signals. A biorthogonal wavelet can also be good for image processing. Biorthogonal wavelet filters have linear phase which is very critical for image processing.

What does wavelet decomposition do?

Wavelet decompositions are more recent addition to the arsenal of multiscale signal processing techniques. Unlike the Gaussian and Laplacian pyramids, they provide a complete image representation and perform decomposition according to both scale and orientation.


1 Answers

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.

like image 133
nigma Avatar answered Sep 22 '22 12:09

nigma