【毕业设计系列】017:语音信号的分帧加窗及其Matlab实现
Date: 2019-5-11
本人提供付费咨询服务并长期承接各类毕设项目以及外包项目。联系QQ: 2963033731 加Q备注:CSDN 外包
1、参考
语音信号的分帧加窗
什么是窗函数?
几种常见窗函数
Spectral leakage(谱泄漏)
2、语音信号的分帧加窗
语音信号具有短时平稳性。
分帧是为了将无限长的语音信号,分成一段一段的,因为语音信号具有短时平稳性,方便处理,加窗是为了使分帧后的语音信号更加平稳。窗函数主要有矩形窗和汉明窗。加窗主要是为了使时域信号似乎更好地满足FFT处理的周期性要求,减少泄漏。
3、Matlab实现(部分)
function varargout = Shiyufenxi(varargin)
% SHIYUFENXI MATLAB code for Shiyufenxi.fig
% SHIYUFENXI, by itself, creates a new SHIYUFENXI or raises the existing
% singleton*.
%
% H = SHIYUFENXI returns the handle to a new SHIYUFENXI or the handle to
% the existing singleton*.
%
% SHIYUFENXI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SHIYUFENXI.M with the given input arguments.
%
% SHIYUFENXI('Property','Value',...) creates a new SHIYUFENXI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Shiyufenxi_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Shiyufenxi_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 Shiyufenxi
% Last Modified by GUIDE v2.5 07-May-2019 07:50:18
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Shiyufenxi_OpeningFcn, ...
'gui_OutputFcn', @Shiyufenxi_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 Shiyufenxi is made visible.
function Shiyufenxi_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 Shiyufenxi (see VARARGIN)
% Choose default command line output for Shiyufenxi
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Shiyufenxi wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Shiyufenxi_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)
[filename,pathname]=uigetfile({'*.wav','All Wav Files'},'选择语音文件');
if filename ==0
return;%如果没有选择新的文件,则返回
end
file=fullfile(pathname,filename);%文件名
[signal,fs]=audioread(file);%读取选择的语音数据
axes(handles.axes1)
plot(signal)%显示波形
title('原始语音波形')
handles.wavsignal=signal;
handles.fs=fs;
%Update handles structure
guidata(hObject,handles);
4、实验效果图
作者:SoaringLee_fighting
来源:CSDN
原文:https://blog.csdn.net/SoaringLee_fighting/article/details/89853323
版权声明:本文为博主原创文章,转载请附上博文链接!
THE END!
本文为博主原创文章,未经博主允许不得转载。若允许转载,请注明来源https://www.cnblogs.com/SoaringLee/,否则保留追究法律责任的权利!
另外,本人提供付费咨询服务并长期承接各类毕设以及外包项目。联系QQ:2963033731。加Q备注:CNBLOG外包