Caution
You're reading an old version of this documentation. If you want up-to-date information, please have a look at 0.9.1.
librosa.core.A_weighting¶
- librosa.core.A_weighting(frequencies, min_db=- 80.0)[source]¶
Compute the A-weighting of a set of frequencies.
- Parameters
- frequenciesscalar or np.ndarray [shape=(n,)]
One or more frequencies (in Hz)
- min_dbfloat [scalar] or None
Clip weights below this threshold. If None, no clipping is performed.
- Returns
- A_weightingscalar or np.ndarray [shape=(n,)]
A_weighting[i] is the A-weighting of frequencies[i]
See also
Examples
Get the A-weighting for CQT frequencies
>>> import matplotlib.pyplot as plt >>> freqs = librosa.cqt_frequencies(108, librosa.note_to_hz('C1')) >>> aw = librosa.A_weighting(freqs) >>> plt.plot(freqs, aw) >>> plt.xlabel('Frequency (Hz)') >>> plt.ylabel('Weighting (log10)') >>> plt.title('A-Weighting of CQT frequencies') >>> plt.show()