You're reading an old version of this documentation. If you want up-to-date information, please have a look at 0.10.0.
- librosa.frequency_weighting(frequencies, kind='A', **kw)[source]
Compute the weighting of a set of frequencies.
- frequenciesscalar or np.ndarray [shape=(n,)]
One or more frequencies (in Hz)
- kindstr in
The weighting kind. e.g. ‘A’, ‘B’, ‘C’, ‘D’, ‘Z’
- min_dbfloat [scalar] or None
Clip weights below this threshold. If None, no clipping is performed.
- weightingscalar or np.ndarray [shape=(n,)]
weighting[i]is the weighting of
Get the A-weighting for CQT frequencies
>>> import matplotlib.pyplot as plt >>> freqs = librosa.cqt_frequencies(108, librosa.note_to_hz('C1')) >>> weights = librosa.frequency_weighting(freqs, 'A') >>> fig, ax = plt.subplots() >>> ax.plot(freqs, weights) >>> ax.set(xlabel='Frequency (Hz)', ylabel='Weighting (log10)', ... title='A-Weighting of CQT frequencies')