#2099·librosa

feature.spectral_centroid / bandwidth / rolloff / contrast / poly_features upcast float32 将频谱图转换为 float64

作者: tritsystem创建于 2026年9月4日更新于 2026年9月4日

Description: librosa.feature.spectral_centroid, spectral_bandwidth, spectral_rolloff, spectral_contrast and poly_features upcast a float32 magnitude spectrogram to float64, while the rest of librosa.feature (melspectrogram, mfcc, chroma_stft, spectral_flatness, rms) and the core (stft, which has an explicit dtype-preserving dtype= argument) preserve float32.

The cause is the frequency grid: each of these five functions does

内容来源: librosa/librosa