source: tests/python/src/temporal/filter.py @ cc9d0cc

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since cc9d0cc was cc9d0cc, checked in by Paul Brossier <piem@piem.org>, 11 years ago

tests/python/src/temporal/filter.py: update imports

  • Property mode set to 100644
File size: 747 bytes
Line 
1from template import aubio_unit_template
2from localaubio import *
3
4samplerate = 44100
5buf_size = 1024
6channels = 2
7
8class 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
29if __name__ == '__main__':
30  unittest.main()
Note: See TracBrowser for help on using the repository browser.