Changeset 2672d67


Ignore:
Timestamp:
Oct 8, 2009, 2:13:38 AM (15 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
5a93302
Parents:
f603b57
Message:

tests/python/src/temporal/: update a_weighting tests

Location:
tests/python/src/temporal
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • tests/python/src/temporal/a_weighting.py

    rf603b57 r2672d67  
    33samplerate = 44100
    44buf_size = 1024
    5 channels = 2
     5channels = 1
    66
    7 class adsgn_filter_unit(aubio_unit_template):
     7class a_weighting_unit (aubio_unit_template):
    88
    99  def setUp(self):
     
    4747    del_fvec(vec)
    4848
     49  def test_simple(self):
     50    buf_size = 32
     51    input = new_fvec (buf_size, 1)
     52    output = new_fvec (buf_size, 1)
     53    expected = array_from_text_file('src/temporal/a_weighting_test_simple.expected')
     54    fvec_write_sample (input, 0.5, 0, 12)
     55    for i in range(buf_size):
     56      for c in range(channels):
     57        self.assertEqual(expected[0][i], fvec_read_sample(input, c, i))
     58    f = new_aubio_filter_a_weighting (samplerate, channels)
     59    aubio_filter_do_outplace (f, input, output)
     60    del_aubio_filter (f)
     61    for i in range(buf_size):
     62      for c in range(channels):
     63        self.assertCloseEnough(expected[1][i], fvec_read_sample(output, c, i))
     64
    4965if __name__ == '__main__':
    5066  import unittest
Note: See TracChangeset for help on using the changeset viewer.