Mercurial > hg > libxtract
view swig/python/test.py @ 104:a32738e9d955
- Fixes to descriptors.c where no break statement was given for certain cases is switch conditionals
- Added LPC and LPCC extraction functions. LPC implements Durbin method as described in Rabiner and Juang and implemented in Dr. Dobbs 1994 edition by Jutta Degener
author | Jamie Bullock <jamie@postlude.co.uk> |
---|---|
date | Mon, 24 Dec 2007 13:21:13 +0000 |
parents | 1cbbe5b5e461 |
children | 9518ae6afff4 |
line wrap: on
line source
#!/usr/bin/python try: import xtract except ImportError: print 'Failed to load the library "xtract"' print '\nRunning libxtract Python bindings test...\n' len = 8 a = xtract.floatArray(len) temp = [] for i in range(0, len): a[i] = 2 * i temp.append(str(a[i])) print 'The mean of ' + ', '.join(temp) + ' is: %.2f' % \ xtract.xtract_mean(a,len,None)[1] print 'Computing spectrum...' argv = xtract.floatArray(1) argv[0] = 44100.0 / len # Fake sample rate xtract.xtract_init_fft(len, xtract.XTRACT_SPECTRUM); result = xtract.floatArray(len) xtract.xtract_spectrum(a,len,argv, result) for i in range(len): print result[i] print '\nFinished!\n'