如何将梅尔频谱图转换为对数缩放梅尔频谱图

如何将梅尔频谱图转换为对数缩放梅尔频谱图

本文介绍了如何将梅尔频谱图转换为对数缩放梅尔频谱图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读

我还可以将其显示为对数刻度的频谱图:

  librosa.display.specshow(ps,y_axis ='log',x_axis ='time') 

很显然,它们看起来有所不同,但实际的声谱图 ps 是相同的.使用librosa,如何将这种质谱图转换为对数标度的质谱图?此外,对数标度谱图对原始质谱图的用途是什么?只是为了减小频域的方差以使其与时间轴可比,还是其他?

解决方案

librosa.power_to_db 应该这样做,看看吧

I was reading this paper on environmental noise discrimination using Convolution Neural Networks and wanted to reproduce their results. They convert WAV files into log-scaled mel spectrograms. How do you do this? I am able to convert a WAV file to a mel spectrogram

y, sr = librosa.load('audio/100263-2-0-117.wav',duration=3)
ps = librosa.feature.melspectrogram(y=y, sr=sr)
librosa.display.specshow(ps, y_axis='mel', x_axis='time')

I am also able to display it as a log scaled spectrogram:

librosa.display.specshow(ps, y_axis='log', x_axis='time')

Clearly, they look different, but the actual spectrogram ps is the same. Using librosa, how can I convert this melspectrogram into a log scaled melspectrogram? Furthermore, what is the use of a log scaled spectrogram over the original? Is it just to reduce the variance of the Frequency domain to make it comparable to the time axis, or something else?

解决方案

librosa.power_to_db should do it, take a look at that

这篇关于如何将梅尔频谱图转换为对数缩放梅尔频谱图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 08:46