云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 肌电信号的时域和频域分析

肌电信号的时域和频域分析

  • 62 次阅读
  • 3 次下载
  • 2025/5/5 3:11:49

% Update handles structure guidata(hObject, handles);

% UIWAIT makes a1fig wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line. function varargout = a1fig_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 global s; global a; global t;

[filename,filepath]=uigetfile('*.txt','选择文件');%选择数据文件 str=[filepath filename]; s=load(str); a=s(:,7); t=s(:,1);

% --- 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) try

delete(allchild(handles.axes1)); end

21

% --- 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) global a; global t;

plot(handles.axes1,t,a);title('信号1');

% --- Executes on button press in pushbutton4.

function pushbutton4_Callback(hObject, eventdata, handles) % hObject handle to pushbutton4 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global a; global t; global y;

%a=EMG3(1:points,2);

y=fft(a,20000); %对信号进行快速Fourier变换 fs=2000;

N=length(y);

mag=abs(y);%求得Fourier变换后的振幅 f=(0:N-1)/N*fs; %频率序列

plot(handles.axes1,f,mag);%绘制图形

% --- Executes on button press in pushbutton5.

function pushbutton5_Callback(hObject, eventdata, handles) % hObject handle to pushbutton5 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global a; global t; global y; fs=2000;

N=length(y); f=(0:N-1)/N*fs;

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

% --- Executes on button press in pushbutton6.

function pushbutton6_Callback(hObject, eventdata, handles)

22

% hObject handle to pushbutton6 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %小波去噪 global a; global t; global s; global y; % global IR; % global SORH; M =length (a) ; N=length(y); p=size(a); s=a(1:20000);

[C L]=wavedec(a,4,'db5'); cA3=appcoef(C,L,'db5',4); cD1=detcoef(C,L,1); cD2=detcoef(C,L,2); cD3=detcoef(C,L,3); cD4=detcoef(C,L,4);

thr1=thselect(cD1,'rigrsure'); thr2=thselect(cD2,'rigrsure'); thr3=thselect(cD3,'rigrsure'); thr4=thselect(cD4,'rigrsure'); TR=[thr1,thr2,thr3,thr4]; SORH='s';

[XC,CXC,LXC,PERFO,PERF2]=wdencmp('lvd',a,... 'db5',4,TR,SORH); L=p(2); x=a; h=XC; F=0; M=0;

for ii=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; % K=length(d);

23

% t1=(0:K-1)/2000;

plot(handles.axes5,XC(1:20000));

% --- Executes on button press in pushbutton7.

function pushbutton7_Callback(hObject, eventdata, handles) % 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) %去噪后幅频 global a; global t; %global h;

[C L]=wavedec(a,3,'db5'); cA3=appcoef(C,L,'db5',3); cD1=detcoef(C,L,1); cD2=detcoef(C,L,2); cD3=detcoef(C,L,3);

thr1=thselect(cD1,'rigrsure'); thr2=thselect(cD2,'rigrsure'); thr3=thselect(cD3,'rigrsure'); TR=[thr1,thr2,thr3]; SORH='s';

[XC,CXC,LXC,PERFO,PERF2]=wdencmp('lvd',a,... 'db5',3,TR,SORH); y1=fft(XC,20000); fs=2000;

N=length(y1); mag1=abs(y1); f=(0:N-1)/N*fs;

plot(handles.axes5,f,mag1);

% --- 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 handles and user data (see GUIDATA) %去噪后相频 global a; global t;

[C L]=wavedec(a,3,'db5'); cA3=appcoef(C,L,'db5',3);

24

搜索更多关于: 肌电信号的时域和频域分析 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

% Update handles structure guidata(hObject, handles); % UIWAIT makes a1fig wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = a1fig_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com