source: python/tests/test_mathutils.py @ 6514bb6

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 6514bb6 was 6514bb6, checked in by Paul Brossier <piem@piem.org>, 11 years ago

aubiomodule.c: add unwrap2pi

  • Property mode set to 100755
File size: 1.0 KB
Line 
1#! /usr/bin/env python
2
3from numpy.testing import TestCase, run_module_suite
4from numpy.testing import assert_equal, assert_almost_equal
5from aubio import bintomidi, miditobin, freqtobin, bintofreq, freqtomidi, miditofreq
6from aubio import unwrap2pi
7
8class aubio_mathutils(TestCase):
9
10    def test_unwrap2pi(self):
11       a = [ x/100. for x in range(-600,600,100) ]
12       b = [ unwrap2pi(x) for x in a ]
13       #print b
14
15    def test_miditobin(self):
16       a = [ miditobin(a, 44100, 512) for a in range(128) ]
17
18    def test_bintomidi(self):
19       a = [ bintomidi(a, 44100, 512) for a in range(128) ]
20
21    def test_freqtobin(self):
22       a = [ freqtobin(a, 44100, 512) for a in range(128) ]
23
24    def test_bintofreq(self):
25       a = [ bintofreq(a, 44100, 512) for a in range(128) ]
26
27    def test_freqtomidi(self):
28       a = [ freqtomidi(a) for a in range(128) ]
29
30    def test_miditofreq(self):
31       freqs = [ miditofreq(a) for a in range(128) ]
32       midis = [ freqtomidi(a) for a in freqs ]
33
34if __name__ == '__main__':
35    from unittest import main
36    main()
Note: See TracBrowser for help on using the repository browser.