Changeset efa62ce for python/tests


Ignore:
Timestamp:
Jul 10, 2015, 12:59:23 AM (9 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:
5a7e2c3
Parents:
5e394ecc
Message:

ext/py-musicutils.c: complete window implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_musicutils.py

    r5e394ecc refa62ce  
    22
    33from numpy.testing import TestCase
     4from numpy.testing.utils import assert_almost_equal
    45from aubio import window
    56
     
    2526            self.fail('non-integer window length does not raise a ValueError')
    2627
     28    def test_compute_hanning_1024(self):
     29        from numpy import cos, arange
     30        from math import pi
     31        size = 1024
     32        aubio_window = window("hanning", size)
     33        numpy_window = .5 - .5 * cos(2. * pi * arange(size) / size)
     34        assert_almost_equal(aubio_window, numpy_window)
     35
    2736if __name__ == '__main__':
    2837    from unittest import main
Note: See TracChangeset for help on using the changeset viewer.