예제 #1
0
 def test_pseudo_wv_energy(self):
     """Test the energy property of the pseudo WV representation."""
     signal, _ = fmsin(128)
     signal = signal / 128.0
     tfr, _, _ = cohen.PseudoWignerVilleDistribution(signal).run()
     x = np.sum(np.sum(tfr))
     y = np.sum(np.abs(signal)**2) * 128
     self.assertAlmostEqual(x, y, places=3)
예제 #2
0
 def test_pseudo_wv_reality(self):
     """Test the reality property of the pseudo WV representation."""
     signal, _ = fmsin(128)
     tfr, _, _ = cohen.PseudoWignerVilleDistribution(signal).run()
     self.assertTrue(np.all(np.isreal(tfr)))