librosa/core/constantq.py
def __trim_stack(cqt_resp, n_bins):
    '''Helper function to trim and stack a collection of CQT responses'''

    # cleanup any framing errors at the boundaries
    max_col = min(x.shape[1] for x in cqt_resp)

    cqt_resp = np.vstack([x[:, :max_col] for x in cqt_resp][::-1])

    # Finally, clip out any bottom frequencies that we don't really want
    # Transpose magic here to ensure column-contiguity
    return np.ascontiguousarray(cqt_resp[-n_bins:].T).T
def __trim_stack(cqt_resp, n_bins):
    '''Helper function to trim and stack a collection of CQT responses'''

    # cleanup any framing errors at the boundaries
    max_col = min(x.shape[1] for x in cqt_resp)

    cqt_resp = np.vstack([x[:, :max_col] for x in cqt_resp][::-1])

    # Finally, clip out any bottom frequencies that we don't really want
    # Transpose magic here to ensure column-contiguity
    return np.ascontiguousarray(cqt_resp[-n_bins:].T).T
def __trim_stack ( cqt_resp , n_bins ) : # cleanup any framing errors at the boundaries max_col = min ( x . shape [ 1 ] for x in cqt_resp ) cqt_resp = np . vstack ( [ x [ : , : max_col ] for x in cqt_resp ] [ : : - 1 ] ) # Finally, clip out any bottom frequencies that we don't really want # Transpose magic here to ensure column-contiguity return np . ascontiguousarray ( cqt_resp [ - n_bins : ] . T ) . T
Helper function to trim and stack a collection of CQT responses
Helper function to trim and stack a collection of CQT responses