function varargout = untitled1(varargin)
%UNTITLED1 MATLAB code file for untitled1.fig
% UNTITLED1, by itself, creates a new UNTITLED1 or raises the existing
% singleton*.
%
% H = UNTITLED1 returns the handle to a new UNTITLED1 or the handle to
% the existing singleton*.
%
% UNTITLED1('Property','Value',...) creates a new UNTITLED1 using the
% given property value pairs. Unrecognized properties are passed via
% varargin to untitled1_OpeningFcn. This calling syntax produces a
% warning when there is an existing singleton*.
%
% UNTITLED1('CALLBACK') and UNTITLED1('CALLBACK',hObject,...) call the
% local function named CALLBACK in UNTITLED1.M with the given input
% arguments.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help untitled1
% Last Modified by GUIDE v2.5 03-Nov-2021 20:18:36
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @untitled1_OpeningFcn, ...
'gui_OutputFcn', @untitled1_OutputFcn, ...
'gui_LayoutFcn', [], ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before untitled1 is made visible.
function untitled1_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin unrecognized PropertyName/PropertyValue pairs from the
% command line (see VARARGIN)
% Choose default command line output for untitled1
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes untitled1 wait for user response (see UIRESUME)
% uiwait(handles.figure1)
% --- Outputs from this function are returned to the command line.
function varargout = untitled1_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close all;
clear all;
clc %起始清空
global music;
global MyRecording;
[x3,f5]=audioread('start1.mp3');%读取录音
sound(x3,f5);
music=audiorecorder(20000,16,2); %创建保存音频的对象
recordblocking (music,3); %录制3s音频
MyRecording=getaudiodata(music); %得到以n*2列数字矩阵存储的刚录制的音频信号
audiowrite('myspeech.wav' , MyRecording , 20000);
global hmm
global x
global fs
load hmm.mat
[x, fs]=audioread('myspeech.wav');
[x1,x2]=vad(x,fs);
O=mfcc(x);
O=O(x1:x2-5,:);
for j=1:10
pout(j)=viterbi(hmm{j},O);
end
[~,n]=max(pout);
%delete(d);
c=num2str(n-1);
if(c=='0')
string=sprintf('识别结果:你好');
msgbox(string,'识别结果','none');
elseif(c=='1')
string=sprintf('识别结果:小布小布');
msgbox(string,'识别结果','none');
elseif(c=='2')
string=sprintf('识别结果:食堂');
msgbox(string,'识别结果','none');
elseif(c=='3')
string=sprintf('识别结果:位置');
msgbox(string,'识别结果','none');
elseif(c=='4')
string=sprintf('识别结果:吃饭');
msgbox(string,'识别结果','none');
elseif(c=='5')
string=sprintf('识别结果:背诗');
msgbox(string,'识别结果','none');
elseif(c=='6')
string=sprintf('识别结果:喝水');
msgbox(string,'识别结果','none');
elseif(c=='7')
string=sprintf('识别结果:天气好吗');
msgbox(string,'识别结果','none');
elseif(c=='8')
string=sprintf('识别结果:睡觉');
msgbox(string,'识别结果','none');
elseif(c=='9')
string=sprintf('识别结果:成绩');
msgbox(string,'识别结果','none');
end
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, ~, ~)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close all;
clear all;
clc %起始清空
global music;
global MyRecording;
[x3,f5]=audioread('start.mp3');%读取录音
sound(x3,f5);
music=audiorecorder(20000,16,2); %创建保存音频的对象
recordblocking (music,3); %录制3s音频
MyRecording=getaudiodata(music); %得到以n*2列数字矩阵存储的刚录制的音频信号
audiowrite('myspeech.wav' , MyRecording , 20000);%将音频存入
global hmm
global x
global fs
load hmm.mat %引入hmm 模型训练出的矩阵
[x,fs]=audioread('myspeech.wav');%读取录音
[x1,x2]=vad(x,fs);
O=mfcc(x);
O=O(x1:x2-5,:);
for j=1:10
pout(j)=viterbi(hmm{j},O);
end
[~,n]=max(pout);
c=num2str(n-1);
b=round(rand(1,1)*2);
disp(b);
if(c=='0')
if(b==1)
[x,fs]=audioread('hello1.mp3');
sound(x,fs);
elseif(b==2)
[x,fs]=audioread('hello2.mp3');
sound(x,fs);
elseif(b==0)
[x,fs]=audioread('hello3.mp3');
sound(x,fs);
end
elseif(c=='1')
if(b==1)
[x,fs]=audioread('en1.mp3');
sound(x,fs);
elseif(b==2)
[x,fs]=audioread('en2.mp3');
sound(x,fs);
elseif(b==0)
[x,fs]=audioread('en3.mp3');
sound(x,fs);
end
elseif(c=='2')
if(b==1)
[x,fs]=audioread('shitang1.mp3');
sound(x,fs);
elseif(b==2)
[x,fs]=audioread('shitang2.mp3');
sound(x,fs);
elseif(b==0)
[x,fs]=audioread('shitang3.mp3');
sound(x,fs);
end
elseif(c=='3')
if(b==1)
[x,fs]=audioread('weizhi1.mp3');
sound(x,fs);
elseif(b==2)
[x,fs]=audioread('weizhi2.mp3');
sound(x,fs);
elseif(b==0)
[x,fs]=audioread('weizhi3.mp3');
sound(x,fs);
end
elseif(c=='4')
if(b==1)
[x,fs]=audioread('chifan1.mp3');
sound(x,fs);
elseif(b==2)
[x,fs]=audioread('chifan2.mp3');
sound(x,fs);
elseif(b==0)
[x,fs]=audioread('chifan3.mp3');
sound(x,fs);
end
elseif(c=='5')
if(b==1)
[x,fs]=audioread('beishi1.mp3');
sound(x,fs);
elseif(b==2)
[x,fs]=audioread('beishi2.mp3');
sound(x,fs);
elseif(b==0)
[x,fs]=audioread('beishi3.mp3');
sound(x,fs);
end
elseif(c=='7')
if(b==1)
[x,fs]=audioread('tianqi1.mp3');
sound(x,fs);
elseif(b==2)
[x,fs]=audioread('tianqi2.mp3');
sound(x,fs);
elseif(b==0)
[x,fs]=audioread('tianqi3.mp3');
sound(x,fs);
end
elseif(c=='8')
if(b==1)
[x,fs]=audioread('shuijiao1.mp3');
sound(x,fs);
elseif(b==2)
[x,fs]=audioread('shuijiao2.mp3');
sound(x,fs);
elseif(b==0)
[x,fs]=audioread('shuijiao3.mp3');
sound(x,fs);
end
elseif(c=='9')
if(b==1)
[x,fs]=audioread('chengji1.mp3');
sound(x,fs);
elseif(b==2)
[x,fs]=audioread('chengji2.mp3');
sound(x,fs);
elseif(b==0)
[x,fs]=audioread('chengji3.mp3');
sound(x,fs);
end
else
[x,fs]=audioread('other.mp3');
sound(x,fs);
end
% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with
没有合适的资源?快使用搜索试试~ 我知道了~
hmm算法语音识别附matlab代码.zip
共167个文件
wav:115个
mp3:33个
m:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 129 浏览量
2023-12-11
21:41:49
上传
评论
收藏 33.23MB ZIP 举报
温馨提示
1.版本:matlab2014/2019a/2021a,内含运行结果,不会运行可私信 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 5.作者介绍:某大厂资深算法工程师,从事Matlab算法仿真工作10年;擅长智能优化算法、神经网络预测、信号处理、元胞自动机等多种领域的算法仿真实验,更多仿真源码、数据集定制私信+。
资源推荐
资源详情
资源评论
收起资源包目录
hmm算法语音识别附matlab代码.zip (167个子文件)
untitled1.fig 8KB
img.jpg 131KB
untitled1.m 16KB
vad.m 2KB
melbankm.m 2KB
enframe.m 2KB
getparam.m 2KB
baum.m 1KB
inithmm.m 1KB
viterbi.m 1019B
mfcc.m 1015B
trainhmm.m 754B
train.m 546B
mymfcc.m 401B
mixture.m 360B
pdf.m 233B
samples.mat 16.67MB
mfcc.mat 1.38MB
hmm.mat 47KB
hello3.mp3 14KB
hello1.mp3 10KB
shitang3.mp3 10KB
other.mp3 9KB
other.mp3 9KB
hello2.mp3 8KB
shitang2.mp3 8KB
tianqi3.mp3 7KB
anjing.mp3 7KB
weizhi2.mp3 6KB
chifan1.mp3 6KB
weizhi.mp3 6KB
weizhi1.mp3 6KB
chifan2.mp3 6KB
chifan3.mp3 6KB
tianqi1.mp3 6KB
shitang1.mp3 5KB
chengji1.mp3 5KB
shuijiao3.mp3 5KB
chengji3.mp3 5KB
tianqi2.mp3 5KB
beishi1.mp3 4KB
weizhi3.mp3 4KB
en3.mp3 4KB
shuijiao1.mp3 4KB
chengji2.mp3 4KB
beishi2.mp3 3KB
en2.mp3 3KB
shuijiao2.mp3 3KB
beishi3.mp3 3KB
en1.mp3 3KB
start.mp3 3KB
start1.mp3 2KB
pujian.wav 7.1MB
myspeech.wav 234KB
63.wav 156KB
13.wav 156KB
44.wav 156KB
16.wav 156KB
88.wav 156KB
48.wav 156KB
12.wav 156KB
92.wav 156KB
52.wav 156KB
91.wav 156KB
27.wav 156KB
31.wav 156KB
19.wav 156KB
56.wav 156KB
69.wav 156KB
65.wav 156KB
77.wav 156KB
70.wav 156KB
73.wav 156KB
50.wav 156KB
25.wav 156KB
90.wav 156KB
57.wav 156KB
54.wav 156KB
79.wav 156KB
93.wav 156KB
02.wav 156KB
17.wav 156KB
81.wav 156KB
74.wav 156KB
83.wav 156KB
41.wav 156KB
47.wav 156KB
33.wav 156KB
28.wav 156KB
97.wav 156KB
86.wav 156KB
14.wav 156KB
59.wav 156KB
21.wav 156KB
49.wav 156KB
85.wav 156KB
04.wav 156KB
40.wav 156KB
58.wav 156KB
96.wav 156KB
共 167 条
- 1
- 2
资源评论
Matlab科研辅导帮
- 粉丝: 1w+
- 资源: 7553
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功