声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1521|回复: 2

[滤波] 求教:EMG信号滤波后,开端和末端部分的值异常

[复制链接]
发表于 2011-2-14 22:07 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
本帖最后由 afflatus_999 于 2011-2-14 22:41 编辑

EMG信号滤波(50HZ notch 和10-200HZ bandpass)后,开端和末端部分的值异常,怎么解决?如图
程序如下(采样率512hz):
%% to read EMG data
rawemg=corr(1:end,1);
subplot(2,4,1)
plot(rawemg)
title('RawEMG')
xlabel('Point')
ylabel('Magnitude')
% to time-domain
leng=size(rawemg,1);
fs=512;
t=1/512:1/fs:leng/fs;
emgts=timeseries(rawemg,t);
subplot(2,4,2)
plot(emgts)
title('time-domain EMG')
xlabel('time (s)')
ylabel('magnitude')
%%notch filter
interval1=[49, 51];
emgtsfilt=idealfilter(emgts,interval1,'notch');
subplot(2,4,3)
plot(emgtsfilt)
title('notch-filtered EMG')
xlabel('time (s)')
ylabel('magnitude')
%%bandpass filter
interval2=[10,200];
emgtsfiltfilt=idealfilter(emgtsfilt,interval2,'pass');
subplot(2,4,4)
plot(emgtsfiltfilt)
title('bandpassed EMG')
xlabel('time (s)')
ylabel('magnitude')
%% filtered and rectfied EMG
filteredemg=squeeze(emgtsfiltfilt.data)';
s=abs(filteredemg);
subplot(2,4,5)
plot(s)
title('filtered and rectified EMG')
xlabel('Point')
ylabel('Magnitude')
%% to rectfy and smooth EMG
%moving average window with 500ms constant
rectemg=abs(filteredemg);
lengrect=length(rectemg);
for i=1:lengrect-256
    smoothemg(i)=sum(rectemg(i:i+255))/256;
end
subplot(2,4,6)
plot(smoothemg)
title('smoothed EMG (average)')
xlabel('Point')
ylabel('Magnitude')
%moving average winodw with 2000ms constant using RMS
for i=1:lengrect-2048
    smoothrmsemg(i)=sqrt(sum(rectemg(i:i+2047).*rectemg(i:i+2047))/2048);
end
subplot(2,4,7)
plot(smoothrmsemg)
title('smoothed EMG (RMS)')
xlabel('Point')
ylabel('Magnitude')

EMG Processing.jpg
回复
分享到:

使用道具 举报

发表于 2011-2-15 20:03 | 显示全部楼层
没听懂,帮不上你没听懂,帮不上你
 楼主| 发表于 2011-2-15 21:55 | 显示全部楼层
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-25 14:05 , Processed in 0.050928 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表