Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]

Type "copyright", "credits" or "license" for more information.


IPython 0.12.dev -- An enhanced Interactive Python.

? -> Introduction and overview of IPython's features.

%quickref -> Quick reference.

help -> Python's own help system.

object? -> Details about 'object', use 'object??' for extra details.

%guiref -> A brief reference about the graphical user interface.


In [1]: import wavepy as wv


In [2]: x=array([])


In [3]: J=2


In [4]: nm='db2'


In [5]: ext='sym'


In [6]: input=open('noisybumps.txt','r')


In [7]: for file in input:

   ...: x=append(x,float(file))

   ...:


In [8]: plot(x),title('Input Signal')

Out[8]: ([<matplotlib.lines.Line2D at 0x2668f90>], <matplotlib.text.Text at 0x267eab0>)


In [9]: input.close()


In [10]: [dwtop,length,flag]=wv.dwt.dwt(x,J,nm,ext)


In [11]: plot(dwtop),title('Full 2-Level DWT Decomposition')

Out[11]: ([<matplotlib.lines.Line2D at 0x272d230>], <matplotlib.text.Text at 0x2755db0>)


In [12]: plot(dwtop[0:length[0]]),title('Approximation Coefficients at Level 2')

Out[12]: ([<matplotlib.lines.Line2D at 0x285e470>], <matplotlib.text.Text at 0x2b82fd0>)


In [13]: l=length[0]


In [14]: plot(dwtop[l:l+length[1]]),title('Detail Coefficients at Level 2')

Out[14]: ([<matplotlib.lines.Line2D at 0x2bb4e70>], <matplotlib.text.Text at 0x2a5a170>)


In [15]: l+=length[1]


In [16]: length

Out[16]: array([ 514., 514., 1025., 2048.])


In [17]: l

Out[17]: 1028.0


In [18]: plot(dwtop[l:l+length[2]]),title('Detail Coefficients at Level 1')

Out[18]: ([<matplotlib.lines.Line2D at 0x2ccacf0>], <matplotlib.text.Text at 0x2ce9730>)


In [19]: oup=wv.dwt.idwt(dwtop,nm,length,flag)


In [20]: plot(oup),title('Reconstructed Signal')

Out[20]: ([<matplotlib.lines.Line2D at 0x2d0ed30>], <matplotlib.text.Text at 0x2e933f0>)


In [21]: