feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 14aebce was
3730d94,
checked in by Paul Brossier <piem@piem.org>, 17 years ago
|
removed plotmat.py, modified plotfb.py to build filterbank on the fly, moved to python/test
|
-
Property mode set to
100755
|
File size:
817 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | import pylab |
---|
4 | import numpy |
---|
5 | import sys |
---|
6 | |
---|
7 | from aubio.aubiowrapper import * |
---|
8 | |
---|
9 | win_size = 2048 |
---|
10 | channels = 1 |
---|
11 | n_filters = 40 |
---|
12 | samplerate = 44100 |
---|
13 | |
---|
14 | filterbank = new_aubio_filterbank_mfcc(n_filters, win_size, samplerate, |
---|
15 | 0., samplerate) |
---|
16 | |
---|
17 | |
---|
18 | mfcc_filters = [] |
---|
19 | for channel in range(n_filters): |
---|
20 | vec = aubio_filterbank_getchannel(filterbank,channel) |
---|
21 | mfcc_filters.append([]) |
---|
22 | for index in range(win_size): |
---|
23 | mfcc_filters[channel].append(fvec_read_sample(vec,0,index)) |
---|
24 | |
---|
25 | doLog=False |
---|
26 | if len(sys.argv)>1: |
---|
27 | if sys.argv[1]=='log': |
---|
28 | doLog=True |
---|
29 | |
---|
30 | nmat= numpy.array(mfcc_filters) |
---|
31 | |
---|
32 | pylab.hold(True) |
---|
33 | |
---|
34 | n_filters=numpy.shape(nmat)[0] |
---|
35 | for i in range(n_filters): |
---|
36 | if doLog==True: |
---|
37 | pylab.semilogx(nmat[i,:]) |
---|
38 | else: |
---|
39 | pylab.plot(nmat[i,:]) |
---|
40 | |
---|
41 | pylab.hold(False) |
---|
42 | #pylab.savefig('test.png') |
---|
43 | pylab.show() |
---|
Note: See
TracBrowser
for help on using the repository browser.