function varargout = signal(varargin)
% SIGNAL M-file for signal.fig
% SIGNAL, by itself, creates a new SIGNAL or raises the existing
% singleton*.
%
% H = SIGNAL returns the handle to a new SIGNAL or the handle to
% the existing singleton*.
%
% SIGNAL('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SIGNAL.M with the given input arguments.
%
% SIGNAL('Property','Value',...) creates a new SIGNAL or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before signal_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to signal_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 signal
% Last Modified by GUIDE v2.5 11-May-2006 15:33:30
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @signal_OpeningFcn, ...
'gui_OutputFcn', @signal_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(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 signal is made visible.
function signal_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 signal (see VARARGIN)
% Choose default command line output for signal
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes signal wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = signal_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)
a=wavread('neng.wav');
figure(1);
plot(a);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=wavread('neng.wav');
n=length(a);
N=320;
figure(2);
subplot(3,1,1),plot(a);
h=linspace(1,1,N);%形成一个矩形窗,长度为N
En=conv(h,a.*a);%求卷积得其短时能量函数En
subplot(3,1,2),plot(En);
b=[];
b(1)=0;
for i=2:n
if a(i)*a(i-1)>0
b(i)=0;
else
b(i)=1;
end
end
w=[];
w(1:N-1)=0;
for i=N:n
w(i)=0;
for j=i-N+1:i
w(i)=w(i)+b(j);
end
w(i)=w(i)/N;
end
subplot(3,1,3),plot(w);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=wavread('neng.wav');
n=length(a);
N=320;
d=[];
for i=0:N-1
d(i+1)=0;
for j=1000-N+1:1000-i
d(i+1)=d(i+1)+a(j)*a(j+i);
end
end
figure(3);
plot(d);
没有合适的资源?快使用搜索试试~ 我知道了~
duandianjiance.zip_The First
共3个文件
fig:1个
m:1个
wav:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 190 浏览量
2022-09-14
18:32:18
上传
评论
收藏 188KB ZIP 举报
温馨提示
First to be discussed within the paper are general linear time-invariant systems, along with its theory and mathematics, before moving into a general description of linear prediction models
资源推荐
资源详情
资源评论
收起资源包目录
duandianjiance.zip (3个子文件)
duandianjiance
signal.fig 8KB
neng.wav 216KB
signal.m 4KB
共 3 条
- 1
资源评论
小波思基
- 粉丝: 85
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功