⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dratio.m

📁 用MATLAB编程来实现语音信号中D比的计算
💻 M
字号:
function D=Dratio(x)
%this procedure is to calculate the d ratio of the speech signal,which is important in speaker recogniton and speech recognition
% input--- x is a struct array variable, cluding m persons feature matrix f(n*k), x(i).f
%thereinto, n indicate speech number, k indicate feature vector dimension
%output---D  is d ratio of the input x which is a speech signal
[n,m]=size(x);% n is equal to "1", and m indicate the speakers number
%calculate W
n
m
for i=1:m
    [n,k]=size(x(i).data);
    u(i,:)=mean(x(i).data);
    for j=1:n
        xu=x(i).data(j,:)-u(i,:);
        y(i).z(j).a=xu'*xu;
    end
    summ=0;
    for j=1:n
        summ=summ+y(i).z(j).a;
    end
    y(i).b=summ/n;
end
sumb=0;
for i=1:m
    sumb=sumb+y(i).b;
end
W=sumb/m;

%calculate B
Bv=cov(u);
uu=mean(u);
for i=1:m
    ud=u(i,:)-uu;
    y(i).c=ud'*ud;
end
sumc=0;
for i=1:m
    sumc=sumc+y(i).c;
end
B=sumc/m
%calculate D
D=trace(W^(-1)*Bv);

    

    
    
    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -