shumashibie.m
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- %数码语音训练数据
- samples={};
- for i=1:9
- for k=1:8
- s=sprintf('c:/matlab7/work/yuyin/yb/%d%d',i,k);%'g:\yuyin\wh\'
- samples{i}{k}=wavread(s);
- end
- end
- %获取参数
- for i=1:length(samples)
- sample=[];
- for k=1:length(samples{i})
- sample(k).wave=samples{i}{k};
- sample(k).data=[];
- end
- fprintf('n第%d词训练',i)
- hmm{i}=train(sample,[3 3 3 3]);
- end
- %数码识别
- for i=1:9
- fname = sprintf('d:/work/fj/%d1',i);
- x = wavread(fname);
- [x1 x2] = vad(x);
- m = mfcc(x);
- m = m(x1-2:x2-2,:);
- for j=1:3
- pout(j) = viterbi(hmm{j}, m);
- end
- [d,n] = max(pout);
- fprintf('第%d个词, 识别为%dn', i,n)
- end