Пример #1
0
 def average_power(self):
     """
     Average power = sum of PSD (in decibel) divided by number of pixels
     :param self.args:
     :return:
     """
     psddb = get_psddb(self.args)
     return np.sum(psddb) / np.size(psddb)
Пример #2
0
 def max_power(self):
     """
     Max power is the darkest pixel in the spectrogram
     :param self.args:
     :return:
     """
     psddb = get_psddb(self.args)
     return np.max(psddb)
Пример #3
0
 def average_frame_power(self):
     """
     Average power = sum of PSD (in decibel) divided by number of pixels
     :param self.args:
     :return:
     """
     psddb = get_psddb(self.args)
     return np.mean(psddb, axis=0)
Пример #4
0
 def dominant_frequency(self):
     """
     Dominant frequency is the frequency at which max power occurs
     :param self.args:
     :return:
     """
     psddb = get_psddb(self.args)
     fs = self.args['fs']
     max_indices = np.argmax(psddb, axis=0)
     nyquist = fs / 2.0
     return max_indices / psddb.shape[0] * nyquist
Пример #5
0
 def max_frequency(self):
     """
     Max frequency is the frequency at which max power occurs
     :param self.args:
     :return: float: max frequency over the entire duration
     """
     psddb = get_psddb(self.args)
     fs = self.args['fs']
     max_index = np.argmax(np.max(psddb, axis=1))
     nyquist = fs / 2.0
     return max_index / psddb.shape[0] * nyquist