feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since cc9d0cc was
cc9d0cc,
checked in by Paul Brossier <piem@piem.org>, 15 years ago
|
tests/python/src/temporal/filter.py: update imports
|
-
Property mode set to
100644
|
File size:
747 bytes
|
Rev | Line | |
---|
[6913434] | 1 | from template import aubio_unit_template |
---|
[cc9d0cc] | 2 | from localaubio import * |
---|
[6913434] | 3 | |
---|
| 4 | samplerate = 44100 |
---|
| 5 | buf_size = 1024 |
---|
| 6 | channels = 2 |
---|
| 7 | |
---|
| 8 | class filter_unit(aubio_unit_template): |
---|
| 9 | |
---|
| 10 | def setUp(self): |
---|
| 11 | self.o = new_aubio_filter(samplerate, 8, channels) |
---|
| 12 | |
---|
| 13 | def tearDown(self): |
---|
| 14 | del_aubio_filter(self.o) |
---|
| 15 | |
---|
| 16 | def test_creation(self): |
---|
| 17 | """ check filter creation and deletion """ |
---|
| 18 | pass |
---|
| 19 | |
---|
| 20 | def test_filter_zeroes(self): |
---|
| 21 | """ check filter run on a vector full of zeroes returns zeros """ |
---|
| 22 | vec = new_fvec(buf_size, channels) |
---|
| 23 | aubio_filter_do(self.o, vec) |
---|
| 24 | for index in range(buf_size/2+1): |
---|
| 25 | for channel in range(channels): |
---|
| 26 | self.assertEqual(fvec_read_sample(vec,channel,index),0.) |
---|
| 27 | del_fvec(vec) |
---|
| 28 | |
---|
| 29 | if __name__ == '__main__': |
---|
| 30 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.