source: interfaces/python/demo_filterbank_slaney.py @ 10a6f7d

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 10a6f7d was 913ee14, checked in by Paul Brossier <piem@piem.org>, 12 years ago

demo_filterbank*.py: improved

  • Property mode set to 100755
File size: 563 bytes
Line 
1#! /usr/bin/python
2
3from aubio import filterbank
4from numpy import array, arange, vstack
5
6win_s = 8192
7samplerate = 16000
8
9f = filterbank(40, win_s)
10f.set_mel_coeffs_slaney(samplerate)
11
12from pylab import loglog, title, show, xlim, ylim, xlabel, ylabel
13xlim([0,samplerate / 2])
14print f.get_coeffs().shape
15times = vstack([arange(win_s / 2 + 1) * samplerate / win_s] * 40)
16print times.shape
17loglog(times.T, f.get_coeffs().T, '.-')
18title('Mel frequency bands coefficients')
19xlim([100, 7500])
20ylim([1.0e-3, 2.0e-2])
21xlabel('frequency (Hz)')
22ylabel('amplitude')
23show()
Note: See TracBrowser for help on using the repository browser.