0

我使用 soundfile 生成 wav 文件,并使用 librosa 提取 mel 谱图。这是代码:

a=16000*8 #8s wav
noise = np.random.rand(a)
soundfile.write('noise.wav', noise, 16000)

y, sr = librosa.load('noise.wav', sr=16000)
melspec = librosa.feature.melspectrogram(y, sr, n_fft=1024,
            hop_length=160, n_mels=96)
print(melspec.shape)

但打印的是 (96, 801)。我认为它的输出应该是 (96,800),而不是 (96,801),因为 (16000/160)*8=800。我想知道为什么。

4

0 回答 0