shithub: aubio

Download patch

ref: d98f3c0edde3838f1f6e9fa856dac1bbe1f1631a
parent: 4093c0cc1ac3110dc536d108b48f7434fd66be61
author: Paul Brossier <piem@piem.org>
date: Mon Nov 28 13:14:01 EST 2016

python/tests/test_fft.py: skip test fft(zeros).phas == 0 if needed, expected powerpc

--- a/python/tests/test_fft.py
+++ b/python/tests/test_fft.py
@@ -33,7 +33,14 @@
         f = fft (win_s)
         fftgrain = f (timegrain)
         assert_equal ( fftgrain.norm, 0 )
-        assert_equal ( fftgrain.phas, 0 )
+        try:
+            assert_equal ( fftgrain.phas, 0 )
+        except AssertionError:
+            assert_equal (fftgrain.phas[fftgrain.phas > 0], +pi)
+            assert_equal (fftgrain.phas[fftgrain.phas < 0], -pi)
+            assert_equal (np.abs(fftgrain.phas[np.abs(fftgrain.phas) != pi]), 0)
+            self.skipTest('fft(fvec(%d)).phas != +0, ' % win_s \
+                    + 'This is expected when using fftw3 on powerpc.')
 
     def test_impulse(self):
         """ check the transform of one impulse at a random place """
--- a/python/tests/test_phasevoc.py
+++ b/python/tests/test_phasevoc.py
@@ -46,7 +46,14 @@
             r = f.rdo(s)
             assert_equal ( t, 0.)
             assert_equal ( s.norm, 0.)
-            assert_equal ( s.phas, 0.)
+            try:
+                assert_equal ( s.phas, 0 )
+            except AssertionError:
+                assert_equal (s.phas[s.phas > 0], +np.pi)
+                assert_equal (s.phas[s.phas < 0], -np.pi)
+                assert_equal (np.abs(s.phas[np.abs(s.phas) != np.pi]), 0)
+                self.skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \
+                        + 'This is expected when using fftw3 on powerpc.')
             assert_equal ( r, 0.)
 
     @params(