匹配两个系列的 Mfcc 系数
我从包含相同语音内容的两个大约 30 秒的音频文件中提取了两个系列 MFCC 系数。音频文件是从不同来源记录在同一位置的。应该估计音频是否包含相同的对话或不同的对话。目前我测试了两个Mfcc系列的相关性计算,但结果不是很合理。对于这种情况有最佳实践吗?
I have extracted two series MFCC coefficients from two around 30 second audio files consisting of the same speech content. The audio files are recorded at the same location from different sources. An estimation should be made whether the audio contains the same conversation or a different conversation. Currently I have tested a correlation calculation of the two Mfcc series but the result is not very reasonable. Are there best practices for this scenario?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
由于这两个向量实际上是直方图,因此您可能需要尝试计算向量之间的卡方距离(直方图的常见距离度量)。
可以在此工具箱中找到良好的(mex)实现:
http://www.mathworks.com/matlabcentral/fileexchange/15935-computing-pairwise-distances-and-metrics
调用如下:
Since the two vectors are effectively histograms, you might want to try calculating the chi-squared distance between the vectors (a common distance measure for histograms).
A good (mex) implementation can be found in this toolbox:
http://www.mathworks.com/matlabcentral/fileexchange/15935-computing-pairwise-distances-and-metrics
Call as follows:
我遇到了同样的问题,解决方案是使用动态时间扭曲来匹配两个 MFCC 阵列 算法。
计算 MFCC 后,对于两个信号中的每一个,您现在应该拥有一个数组,其中每个元素包含帧的 MFCC(数组的数组)。第一步是计算一个数组的每个元素与另一个数组的每个元素之间的“距离”,即每两组 MFCC 之间的距离(您可以尝试使用 欧几里得距离)。
这应该会留下一个二维数组(我们称之为“dist”),其中元素 (i,j) 表示第一个信号中第 i 帧的 MFCC 与第 j 帧的 MFCC 之间的距离你的第二个信号。
在此数组上,您现在可以应用 DTW 算法:
表示两个文件之间“差异”的值是 dtw(n,m),其中 n = nr。第一个信号中的帧数,m = nr。第二个帧的帧数。
如需进一步阅读,本文可能会为您提供应用 DTW 的总体视图到 MFCC 和 DTW 算法的演示可能也会有所帮助。
I had the same problem and the solution for it was to match the two arrays of MFCCs using the Dynamic Time Warping algorithm.
After computing the MFCCs you should now have, for each of your two signals, an array where each element contains the MFCCs for a frame (an array of arrays). The first step would be to compute "distances" between every one element of one array and every one element of the other, i.e. distances between every two sets of MFCCs (you could try using the Euclidian Distance for this).
This should leave you with a 2-dimensional array (let's call it "dist") where element (i,j) represents the distance between the MFCCs of the i-th frame in the first signal and the MFCCs of the j-th frame of your second signal.
On this array you can now apply the DTW algorithm:
The value representing the "difference" between your two files is dtw(n,m), where n = nr. of frames in the first signal, m = nr. of frames of the second one.
For further reading, this paper might give you an overall view of applying DTW to MFCCs and this presentation of the DTW algorithm might also help.
我最近遇到了同样的问题。我发现最好的方法是使用音频库 MIRtoolbox< /a>,在音频处理方面非常强大。
添加此库后,可以通过调用轻松计算两个 MFCC 的距离(距离较低<=>相似匹配):
I faced the same problem recently. The best way I found is to use the audio library MIRtoolbox, which is very powerful in terms of audio processing.
After adding this library, the distance of two MFCCs can be easily computed by calling (lower distance <=> similar matches):
我知道这个问题已经存在了近 10 年,但我现在正在寻找同样的东西,我个人发现上述建议太复杂了。
对于仍在搜索的其他人,您可以从简单地使用 scipy 开始使用 mfcc 数据获取两个矩阵之间的距离:
https://docs.scipy.org/doc/scipy/reference/ generated/scipy.spatial.minkowski_distance.html
为了获取详细的 MFCC 数据,我使用了 yaafe(打包在 Docker 容器中):
http://yaafe.github.io/Yaafe/manual/install.html
这是解决安装问题的方法:https://github.com/Yaafe/Yaafe/issues/52
I know the question is here for almost 10 years, but I was searching for the same thing now and I personally found the above suggestions to be too complicated.
For others who is still searching you can start with simply using scipy to get distance between two matrices with your mfcc data:
https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.minkowski_distance.html
To get the detailed MFCC data I was using yaafe (packaged in Docker container):
http://yaafe.github.io/Yaafe/manual/install.html
This is how to workaround the installation issue: https://github.com/Yaafe/Yaafe/issues/52