#!/usr/bin/env python import loudia import scipy import scipy.signal # Test the magToDb <-> dbToMag i = scipy.arange(1, 7, dtype = 'f4') a = loudia.magToDb(i) o = loudia.dbToMag(a) print 'magToDb/dbToMag:', scipy.allclose(i, o) # Test the transform of windows transf = loudia.hammingTransform(24, 10, 1024, 4096) # Test the poly function a = scipy.array([1, 2, 3, 4, 5]) rr = loudia.poly( a ) rs = scipy.poly( a ) print 'poly:', scipy.allclose(rr, rs) a = scipy.array([2, 0]) rr = loudia.poly( a ) rs = scipy.poly( a[:-1] ) print 'poly, plus zero:', scipy.allclose(rr[0,:-1], rs)
#!/usr/bin/env python import loudia import scipy import scipy.signal # Test the magToDb <-> dbToMag i = scipy.arange(1, 7, dtype='f4') a = loudia.magToDb(i) o = loudia.dbToMag(a) print 'magToDb/dbToMag:', scipy.allclose(i, o) # Test the transform of windows transf = loudia.hammingTransform(24, 10, 1024, 4096) # Test the poly function a = scipy.array([1, 2, 3, 4, 5]) rr = loudia.poly(a) rs = scipy.poly(a) print 'poly:', scipy.allclose(rr, rs) a = scipy.array([2, 0]) rr = loudia.poly(a) rs = scipy.poly(a[:-1]) print 'poly, plus zero:', scipy.allclose(rr[0, :-1], rs)
#!/usr/bin/env python import scipy import pylab import loudia pylab.ion() for i in range(10): a = loudia.hammingTransform(50 + i/10.0, 1, 1024, 1024) pylab.plot(a[0,:]) pylab.ioff() pylab.show()
#!/usr/bin/env python import scipy import pylab import loudia pylab.ion() for i in range(10): a = loudia.hammingTransform(50 + i / 10.0, 1, 1024, 1024) pylab.plot(a[0, :]) pylab.ioff() pylab.show()