Changeset 71ef9c2


Ignore:
Timestamp:
Mar 3, 2013, 9:33:29 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
68d0492
Parents:
45f0f4a
Message:

python/tests/test_filterbank.py: added test against existing coeffs

Location:
python/tests
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • python/tests/test_filterbank.py

    r45f0f4a r71ef9c2  
    55from numpy import random
    66from math import pi
     7from numpy import array
    78from aubio import cvec, filterbank
     9
     10def array_from_text_file(filename, dtype = 'float'):
     11  return array([line.split() for line in open(filename).readlines()],
     12      dtype = dtype)
    813
    914class aubio_filterbank_test_case(TestCase):
     
    5560    assert_equal ( f(c) > 0., True )
    5661
     62  def test_mfcc_coeffs_16000(self):
     63    expected = array_from_text_file('filterbank_mfcc_16000_512.expected')
     64    f = filterbank(40, 512)
     65    f.set_mel_coeffs_slaney(16000)
     66    assert_almost_equal ( expected, f.get_coeffs() )
     67
    5768if __name__ == '__main__':
    5869  from unittest import main
Note: See TracChangeset for help on using the changeset viewer.