2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > 【语音处理】基于matlab GUI录音信号时域频域分析(带面板)【含Matlab源码 064期】

【语音处理】基于matlab GUI录音信号时域频域分析(带面板)【含Matlab源码 064期】

时间:2020-05-11 19:45:40

相关推荐

【语音处理】基于matlab GUI录音信号时域频域分析(带面板)【含Matlab源码 064期】

一、语音处理简介

MATLAB GUI是用户与计算机或计算机程序的接触点或交互方式,是用户与计算机进行信息交流的方式。图形用户界面(Graphical User Interfaces,GUI)则是由窗口、光标、按键、菜单、文字说明等对象(Object)构成的一个用户界面。用户通过一定的方法(如鼠标或键盘)选择、激活这些图形对象,使计算机产生某种动作或变化,比如实现计算、绘图等。本设计基于MATLAB GUI技术,完成了语音信号处理的界面平台,可进行语音的选取、线性预测分析(LPC)、语谱图、频谱等相关波形的显示。这样可以更直观、更方便地分析和处理语音信号,得到用户需要的实验结果。

具体理论知识参考:基于MATLAB GUI的语音处理界面设计

二、部分源代码

function varargout = music_show1(varargin)% MUSIC_SHOW1 MATLAB code for music_show1.fig%MUSIC_SHOW1, by itself, creates a new MUSIC_SHOW1 or raises the existing%singleton*.%%H = MUSIC_SHOW1 returns the handle to a new MUSIC_SHOW1 or the handle to%the existing singleton*.%%MUSIC_SHOW1('CALLBACK',hObject,eventData,handles,...) calls the local%function named CALLBACK in MUSIC_SHOW1.M with the given input arguments.%%MUSIC_SHOW1('Property','Value',...) creates a new MUSIC_SHOW1 or raises the%existing singleton*. Starting from the left, property value pairs are%applied to the GUI before music_show1_OpeningFcn gets called. An%unrecognized property name or invalid value makes property application%stop. All inputs are passed to music_show1_OpeningFcn via varargin.%%*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 music_show1% Last Modified by GUIDE v2.5 07-Jan- 12:02:06% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ...'gui_Singleton', gui_Singleton, ...'gui_OpeningFcn', @music_show1_OpeningFcn, ...'gui_OutputFcn', @music_show1_OutputFcn, ...'gui_LayoutFcn', [] , ...'gui_Callback', []);if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});elsegui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before music_show1 is made visible.function music_show1_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 command line arguments to music_show1 (see VARARGIN)% Choose default command line output for music_show1handles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes music_show1 wait for user response (see UIRESUME)% uiwait(handles.figure1);clear global variablesglobal hmwarning offA=linspace(0,6.3,1000);xk=9*cos(pi/2);yk=9*sin(pi/2);plot([xk/9*8 xk/9*7],[yk/9*8 yk/9*7],'k')hold ontext(xk-0.3,yk,'0')for k=1:5;xk=9*cos(-pi/20*(2*k-1)+pi/2);yk=9*sin(-pi/20*(2*k-1)+pi/2);plot([xk/9*7.5 xk/9*7],[yk/9*7.5 yk/9*7],'k')xk=9*cos(-pi/20*(2*k)+pi/2);yk=9*sin(-pi/20*(2*k)+pi/2);plot([xk/9*8 xk/9*7],[yk/9*8 yk/9*7],'k')text(xk,yk,num2str(2*k))endfor k=1:5;xk=9*cos(pi/20*(2*k-1)+pi/2);yk=9*sin(pi/20*(2*k-1)+pi/2);plot([xk/9*7.5 xk/9*7],[yk/9*7.5 yk/9*7],'k')xk=9*cos(pi/20*(2*k)+pi/2);yk=9*sin(pi/20*(2*k)+pi/2);plot([xk/9*8 xk/9*7],[yk/9*8 yk/9*7],'k')if k<5text(xk-1,yk,num2str(-2*k))elsetext(xk-1,yk,num2str(-2*k))endendtm=pi/2;xm3=6.0*cos(tm);ym3=6.0*sin(tm);xm2=xm3/2+0.5*cos(tm-pi/2);ym2=ym3/2+0.5*sin(tm-pi/2);xm4=xm3/2-0.5*cos(tm-pi/2);ym4=ym3/2-0.5*sin(tm-pi/2);hm=fill([0 xm2 xm3 xm4 0],[0 ym2 ym3 ym4 0],'k');axis offaxis([-10 10 -8 10])axis equal% --- Outputs from this function are returned to the command line.function varargout = music_show1_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 structurevarargout{1} = handles.output;function edit6_Callback(hObject, eventdata, handles)% hObject handle to edit6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit6 as text% str2double(get(hObject,'String')) returns contents of edit6 as a double% --- Executes during object creation, after setting all properties.function edit6_CreateFcn(hObject, eventdata, handles)% hObject handle to edit6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');end% --- Executes on button press in pushbutton10.function pushbutton10_Callback(hObject, eventdata, handles)% hObject handle to pushbutton10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%% 进行播放global music_pathif isempty(music_path)warndlg('请进行声音的录入,再进行播放');return;end[h, Fs] = audioread(music_path);h = h * 10;sound(h,Fs);% --- Executes on button press in pushbutton11.function pushbutton11_Callback(hObject, eventdata, handles)% hObject handle to pushbutton11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% 把录入的相关音频进行保存global Rglobal music_pathmyvoice=getaudiodata(R);audiowrite('myvoice.wav',myvoice,44100); % 保存相关音频数据set(handles.edit1,'String','myvoice.wav');music_path = 'myvoice.wav';set(handles.edit1,'enable','off')% --- Executes during object creation, after setting all properties.function axes4_CreateFcn(hObject, eventdata, handles)% hObject handle to axes4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: place code in OpeningFcn to populate axes4

三、运行结果

四、matlab版本及参考文献

1 matlab版本

a

2 参考文献

[1]韩纪庆,张磊,郑铁然.语音信号处理(第3版)[M].清华大学出版社,.

[2]柳若边.深度学习:语音识别技术实践[M].清华大学出版社,.

[3]宋云飞,姜占才,魏中华.基于MATLAB GUI的语音处理界面设计[J].科技信息. ,(02)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。