def test_scale_by_freq_set_to_false(self): """ To certify that scale_by_freq is set to False this test will check the average value of the estimated psd of the marple_data. It must be approximately equal to 0.40. """ fxx, pxx = _calc_pburg_psd(marple_data, fs=1.0) np.testing.assert_almost_equal(np.mean(pxx), 0.400, decimal=2)
def test_calc_pburg_psd_returns_numpy_arrays(self): fake_rri = list(range(20)) fxx, pxx = _calc_pburg_psd(fake_rri, fs=4.0) self.assertIsInstance(fxx, np.ndarray) self.assertIsInstance(pxx, np.ndarray)
def test_pburg_method_being_called(self, _pburg): _calc_pburg_psd(rri=[1, 2, 3], fs=4.0) _pburg.assert_called_once_with(data=[1, 2, 3], NFFT=None, sampling=4.0, order=16)