librosa.fft_frequencies#
- librosa.fft_frequencies(*, sr=22050, n_fft=2048, dtype=<class 'numpy.float64'>)[source]#
Alternative interface for np.fft.rfftfreq
- Parameters:
- srnumber > 0 [scalar]
Audio sampling rate
- n_fftint > 0 [scalar]
length of the FFT frame
- dtypenp.dtype
The floating-point data type of the output array. The default (
np.float64) matches np.fft.rfftfreq. Passingnp.float32allocates the grid at single precision up front, which lets callers keep afloat32pipeline without an extra copy.
- Returns:
- freqsnp.ndarray [shape=(1 + n_fft/2,)]
Frequencies
(0, sr/n_fft, 2*sr/n_fft, ..., sr/2)
Examples
>>> librosa.fft_frequencies(sr=22050, n_fft=16) array([ 0. , 1378.125, 2756.25 , 4134.375, 5512.5 , 6890.625, 8268.75 , 9646.875, 11025. ])