def test_peak_hold_frequency(self): peak_hold = siganalysis.calculate_peak_hold(self.data_stft, self.freq_array_stft) self.assertEqual(peak_hold['frequency'][-1], self.freq_array_stft[-1])
def test_peak_hold_amplitude(self): peak_hold = siganalysis.calculate_peak_hold(self.data_stft, self.freq_array_stft) self.assertEqual(np.amax(peak_hold['amplitude']), np.amax(self.data_stft))
def test_peak_hold_amplitude_calculation(self): peak_hold = siganalysis.calculate_peak_hold(self.data_stft, self.freq_array_stft) self.assertAlmostEqual(np.amax(peak_hold['amplitude']), self.signal_1_amplitude)
def test_peak_hold_size(self): peak_hold = siganalysis.calculate_peak_hold(self.data_stft, self.freq_array_stft) self.assertEqual(self.data_stft.shape[1], self.freq_array_stft.size) self.assertEqual(self.data_stft.shape[0], self.time_array_stft.size) self.assertEqual(peak_hold.size, self.freq_array_stft.size)