Example #1
0
 def testToNumpyFormat(self):
     dfts = []
     dfts.append(([[4, 0, 1, 0]], [[2, 1, 0, 0]]))
     dfts.append(([[1, 0, 0, 1]], [[0, 1, 1, 0]]))
     arr = mat.to_numpy_format(dfts)
     self.assertListFloatEqual(arr[:, 0], [4, 0, 1, 1, 0, 0, 0, 2])
     self.assertListFloatEqual(arr[:, 1], [1, 0, 1, 0, 1, 1, 0, 0])
Example #2
0
 def testFFTComp(self):
     data = np.array([1, 0, 0, 1, 1, 0, 0, 1], dtype=np.float32)
     self.stft.performStft(data)
     dfts = self.stft.getDFTs()
     transformed = mat.to_numpy_format(dfts)
     ifftout = fftp.irfft(transformed[:, 0] / 2)
     print ifftout
     self.assertListFloatEqual(data, ifftout)