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='sym4'
In [5]: input=open('piecepoly.txt','r')
In [6]: for file in input:
...: x=append(x,float(file))
...:
In [7]: input.clos()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
C:\Python26\work\<ipython-input-7-a02641ca887a> in <module>()
----> 1 input.clos()
AttributeError: 'file' object has no attribute 'clos'
In [8]: input.close()
In [9]: plot(x),title('Input Signal')
Out[9]: ([<matplotlib.lines.Line2D at 0x2670730>], <matplotlib.text.Text at 0x26fb350>)
In [10]: [swtop,length]=wv.dwt.swt(x,J,nm)
In [11]: length
Out[11]: 1024
In [12]: plot(swtop),title('Full SWT Decomposition')
Out[12]: ([<matplotlib.lines.Line2D at 0x293b870>], <matplotlib.text.Text at 0x27ac510>)
In [13]: l=length
In [14]: l
Out[14]: 1024
In [15]: plot(swtop[0:l]),title('Approximation Coefficients at Level 2')
Out[15]: ([<matplotlib.lines.Line2D at 0x293bd70>], <matplotlib.text.Text at 0x296be10>)
In [16]: l=length
In [17]: l
Out[17]: 1024
In [18]: plot(swtop[l:l+length]),title('Detail Coefficients at Level 2')
Out[18]: ([<matplotlib.lines.Line2D at 0x29aa0d0>], <matplotlib.text.Text at 0x2c09390>)
In [19]: l
Out[19]: 1024
In [20]: l=l+length
In [21]: l
Out[21]: 2048
In [22]: plot(swtop[l:l+length]),title('Detail Coefficients at Level 1')
Out[22]: ([<matplotlib.lines.Line2D at 0x2b47e70>], <matplotlib.text.Text at 0x2b66910>)
In [23]: iswtop=wv.dwt.iswt(swtop,J,nm)
In [24]: plot(iswtop),title('Reconstructed Signal')
Out[24]: ([<matplotlib.lines.Line2D at 0x2cb24b0>], <matplotlib.text.Text at 0x2dc3710>)
In [25]: