nnAudio.librosa_functions.hz_to_octs¶
- nnAudio.librosa_functions.hz_to_octs(frequencies, tuning=0.0, bins_per_octave=12)¶
Convert frequencies (Hz) to (fractional) octave numbers.
Examples
>>> librosa.hz_to_octs(440.0) 4. >>> librosa.hz_to_octs([32, 64, 128, 256]) array([ 0.219, 1.219, 2.219, 3.219])
- Parameters
frequencies (number >0 or np.ndarray [shape=(n,)] or float) – scalar or vector of frequencies
tuning (float) – Tuning deviation from A440 in (fractional) bins per octave.
bins_per_octave (int > 0) – Number of bins per octave.
- Returns
octaves – octave number for each frequency
- Return type
number or np.ndarray [shape=(n,)]
See also
octs_to_hz