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