⛄一、获取代码方式
获取代码方式1:
完整代码已上传我的资源:【语音识别】基于matlab说话人识别系统【含Matlab源码 1704期】
点击上面蓝色字体,直接付费下载,即可。
获取代码方式2:
付费专栏Matlab语音处理(初级版)
备注:
点击上面蓝色字体付费专栏Matlab语音处理(初级版),扫描上面二维码,付费29.9元订阅海神之光博客付费专栏Matlab语音处理(初级版),凭支付凭证,私信博主,可免费获得1份本博客上传CSDN资源代码(有效期为订阅日起,三天内有效);
点击CSDN资源下载链接:1份本博客上传CSDN资源代码
⛄二、部分源代码
function test(testdir, n, code)
% Speaker Recognition: Testing Stage
%
% Input:
% testdir : string name of directory contains all test sound files
% n : number of test files in testdir
% code : codebooks of all trained speakers
%
% Note:
% Sound files in testdir is supposed to be:
% s1.wav, s2.wav, …, sn.wav
%
% Example:
% >> test(‘C:\data\amintest’, 8, code);
for k = 1:n % read test sound file of each speaker
file = sprintf(‘%ss%d.wav’, testdir, k);
[s, fs] = wavread(file);
v = mfcc(s, fs); % Compute MFCC's
distmin = inf;
k1 = 0;
for l = 1:length(code) % each trained codebook, compute distortion
d = disteu(v, code{l});
dist = sum(min(d,[],2)) / size(d,1);
if dist < distmin
distmin = dist;
k1 = l;
end
end
msg = sprintf('Speaker %d matches with speaker %d', k, k1);
disp(msg);
end
function r = mfcc(s, fs)
% MFCC
%
% Inputs: s contains the signal to analize
% fs is the sampling rate of the signal
%
% Output: r contains the transformed signal
%
%
%%%%%%%%%%%%%%%%%%
%
m = 100;
n = 256;
l = length(s);
nbFrame = floor((l - n) / m) + 1;
for i = 1:n
for j = 1:nbFrame
M(i, j) = s(((j - 1) * m) + i);
end
end
h = hamming(n);
M2 = diag(h) * M;
for i = 1:nbFrame
frame(:,i) = fft(M2(:, i));
end
t = n / 2;
tmax = l / fs;
m = melfb(20, n, fs);
n2 = 1 + floor(n / 2);
z = m * abs(frame(1:n2, 😃).^2;
r = dct(log(z));
⛄三、运行结果
⛄四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1]韩纪庆,张磊,郑铁然.语音信号处理(第3版)[M].清华大学出版社,2019.
[2]柳若边.深度学习:语音识别技术实践[M].清华大学出版社,2019.文章来源:https://www.toymoban.com/news/detail-834960.html
3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除文章来源地址https://www.toymoban.com/news/detail-834960.html
到了这里,关于【语音识别】说话人识别系统【含Matlab源码 1704期】的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!