基于matlab的肌电信号处理程序Word格式.docx

上传人:b****7 文档编号:21972195 上传时间:2023-02-02 格式:DOCX 页数:23 大小:17.92KB
下载 相关 举报
基于matlab的肌电信号处理程序Word格式.docx_第1页
第1页 / 共23页
基于matlab的肌电信号处理程序Word格式.docx_第2页
第2页 / 共23页
基于matlab的肌电信号处理程序Word格式.docx_第3页
第3页 / 共23页
基于matlab的肌电信号处理程序Word格式.docx_第4页
第4页 / 共23页
基于matlab的肌电信号处理程序Word格式.docx_第5页
第5页 / 共23页
点击查看更多>>
下载资源
资源描述

基于matlab的肌电信号处理程序Word格式.docx

《基于matlab的肌电信号处理程序Word格式.docx》由会员分享,可在线阅读,更多相关《基于matlab的肌电信号处理程序Word格式.docx(23页珍藏版)》请在冰豆网上搜索。

基于matlab的肌电信号处理程序Word格式.docx

%Edittheabovetexttomodifytheresponsetohelpuntitled

%LastModifiedbyGUIDEv2.508-Nov-201412:

45:

18

%Begininitializationcode-DONOTEDIT

gui_Singleton=1;

gui_State=struct('

gui_Name'

mfilename,...

'

gui_Singleton'

gui_Singleton,...

gui_OpeningFcn'

@untitled_OpeningFcn,...

gui_OutputFcn'

@untitled_OutputFcn,...

gui_LayoutFcn'

[],...

gui_Callback'

[]);

ifnargin&

&

ischar(varargin{1})

gui_State.gui_Callback=str2func(varargin{1});

end

ifnargout

[varargout{1:

nargout}]=gui_mainfcn(gui_State,varargin{:

});

else

gui_mainfcn(gui_State,varargin{:

%Endinitializationcode-DONOTEDIT

%---Executesjustbeforeuntitledismadevisible.

functionuntitled_OpeningFcn(hObject,eventdata,handles,varargin)

%Thisfunctionhasnooutputargs,seeOutputFcn.

%hObjecthandletofigure

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%varargincommandlineargumentstountitled(seeVARARGIN)

%Choosedefaultcommandlineoutputforuntitled

handles.output=hObject;

%Updatehandlesstructure

guidata(hObject,handles);

%UIWAITmakesuntitledwaitforuserresponse(seeUIRESUME)

%uiwait(handles.figure1);

%---Outputsfromthisfunctionarereturnedtothecommandline.

functionvarargout=untitled_OutputFcn(hObject,eventdata,handles)

%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);

%Getdefaultcommandlineoutputfromhandlesstructure

varargout{1}=handles.output;

%---Executesonbuttonpressinpushbutton1.

functionpushbutton1_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton1(seeGCBO)

globals;

globala;

globalt;

globalcount;

%count=1;

[filename,filepath]=uigetfile('

*.txt'

Ñ

¡

Ô

ñ

Î

Ä

¼

þ

'

);

Ê

ý

¾

Ý

str=[filepathfilename];

s=load(str);

a=s(:

7);

t=s(:

1);

axes(handles.axes1);

plot(t,a);

xlabel('

±

ä

ylabel('

Á

¿

title('

Ð

Å

º

ifcount==2

globals2;

globala2;

globalt2;

[filename,filepath]=uigetfile('

s2=load(str);

a2=s2(:

t2=s2(:

plot(handles.axes2,t2,a2);

end

count=1;

%---Executesonbuttonpressinpushbutton2.

functionpushbutton2_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton2(seeGCBO)

globaly;

%globalIR;

%globalSORH;

y=fft(a,20000);

M=length(a);

N=length(y);

p=size(a);

%s1=a(1:

20000);

[CL]=wavedec(a,3,'

db5'

cA3=appcoef(C,L,'

3);

cD1=detcoef(C,L,1);

cD2=detcoef(C,L,2);

cD3=detcoef(C,L,3);

thr1=thselect(cD1,'

rigrsure'

thr2=thselect(cD2,'

thr3=thselect(cD3,'

TR=[thr1,thr2,thr3];

SORH='

s'

;

[XC,CXC,LXC,PERFO,PERF2]=wdencmp('

lvd'

a,...

3,TR,SORH);

L=p

(2);

x=a;

h=XC;

F=0;

M=0;

forii=1:

L

m(ii)=(x(ii)-y(ii))^2;

t(ii)=y(ii)^2;

f(ii)=t(ii)/m(ii);

F=F+f(ii);

M=M+m(ii);

end;

SNR=10*log10(F);

MSE=M/N;

SM=SNR/MSE;

axes(handles.axes2);

plot(XC(1:

10000));

È

¥

ë

ó

%plot(handles.axes2,XC(1:

20000));

%---Executesonbuttonpressinpushbutton3.

functionpushbutton3_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton3(seeGCBO)

%a=EMG3(1:

points,2);

½

ø

ì

Ë

Ù

Fourier±

»

fs=2000;

mag=abs(y);

µ

Ã

Õ

·

ù

f=(0:

N-1)/N*fs;

Â

ò

axes(handles.axes1);

plot(f,mag);

%plot(handles.axes1,f,mag);

æ

Ö

Æ

Í

xlabel('

ç

N=20000'

ifcount==2

globaly2;

y2=fft(a2,20000);

N=length(y2);

mag=abs(y2);

end

count=1;

%---Executesonbuttonpressinpushbutton4.

functionpushbutton4_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton4(seeGCBO)

y1=fft(XC,20000);

N=length(y1);

mag1=abs(y1);

plot(f,mag1);

%---Executesonbuttonpressinpushbutton5.

functionpushbutton5_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton5(seeGCBO)

plot(f,angle(y));

Ï

à

%plot(handles.axes1,f,angle(y));

Ì

Ø

plot(f,angle(y2));

%---Executesonbuttonpressinpushbutton6.

functionpushbutton6_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton6(seeGCBO)

plot(f,angle(y1));

%---Executesonbuttonpressinpushbutton7.

functionpushbutton7_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton7(seeGCBO)

try

delete(allchild(handles.axes1));

delete(allchild(handles.axes2));

set(handles.edit1,'

string'

set(handles.edit3,'

set(handles.edit4,'

set(handles.edit5,'

set(handles.edit6,'

%---Executesonbuttonpressinpushbutton8.

functionpushbutton8_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton8(seeGCBO)

power1=(mag.^2)/20000;

plot(f,power1);

¹

¦

×

globals2;

%---Executesonbuttonpressinpushbutton9.

functionpushbutton9_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton9(seeGCBO)

s=fft(a,2000);

mag=abs(y1);

power1=(mag.^2)/20

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 农学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1