feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 927f630 was
974dddc,
checked in by Paul Brossier <piem@piem.org>, 17 years ago
|
move tests/python/demo to tests/, add localaubio.py module helpers
|
-
Property mode set to
100755
|
File size:
807 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | import pylab |
---|
4 | import numpy |
---|
5 | import sys |
---|
6 | |
---|
7 | from localaubio 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 | mfcc_filters = [] |
---|
18 | for channel in range(n_filters): |
---|
19 | vec = aubio_filterbank_getchannel(filterbank,channel) |
---|
20 | mfcc_filters.append([]) |
---|
21 | for index in range(win_size): |
---|
22 | mfcc_filters[channel].append(fvec_read_sample(vec,0,index)) |
---|
23 | |
---|
24 | doLog=False |
---|
25 | if len(sys.argv)>1: |
---|
26 | if sys.argv[1]=='log': |
---|
27 | doLog=True |
---|
28 | |
---|
29 | nmat= numpy.array(mfcc_filters) |
---|
30 | |
---|
31 | pylab.hold(True) |
---|
32 | |
---|
33 | n_filters=numpy.shape(nmat)[0] |
---|
34 | for i in range(n_filters): |
---|
35 | if doLog==True: |
---|
36 | pylab.semilogx(nmat[i,:]) |
---|
37 | else: |
---|
38 | pylab.plot(nmat[i,:]) |
---|
39 | |
---|
40 | pylab.hold(False) |
---|
41 | #pylab.savefig('test.png') |
---|
42 | pylab.show() |
---|
Note: See
TracBrowser
for help on using the repository browser.