在用MATLAB对心电信号去噪处理时得到的结果很差,下面是我的程序,请高手指点下,谢谢了!! ecg1 = ReadMITdatafun('D:\data','103.hea','103.atr','103.dat',6500); ecg2 = resample(ecg1,250,360); ecg = ecg2'; ecg=ecg(1:4512); subplot(221);plot(ecg); title('原心电信号'); r=ecg+0.04*randn(size(ecg)); subplot(222);plot(r); title('加入肌电干扰后信号'); n=0.04*randn(size(ecg)); subplot(224);plot(n); axis([0 5000 -2 3]); title('去除的肌电干扰信号'); [C,L]=wavedec(r,3,'coif4'); S3=appcoef(C,L,'coif4',3); WT1=detcoef(C,L,1); WT2=detcoef(C,L,2); WT3=detcoef(C,L,3); for i=1:2267 th1=0.04*sqrt(2*log(2267))/log(2); if WT1(i)0 p=1; elseif WT1(i)<0 p=-1; else p=0; end WT11(i)=p*(abs(WT1(i))-th1); end end for i=1:1145 th2=0.04*sqrt(2*log(1145))/log(2); if WT2(i)0 p=1; elseif WT2(i)<0 p=-1; else p=0; end WT21(i)=p*(abs(WT2(i))-th2); end end for i=1:584 th3=0.04*sqrt(2*log(584))/log(2); if WT3(i)0 p=1; elseif WT3(i)<0 p=-1; else p=0; end WT31(i)=p*(abs(WT3(i))-th3); end end C1=[S3,WT31,WT21,WT11]; x=waverec(C1,L,'coif4'); subplot(223);plot(x); title('去除肌电干扰后信号'); norm(ecg-x)