• 大小: 512KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-12
  • 语言: Matlab
  • 标签: ecg  

资源简介

国外网站下载的MATLAB心电图去噪程序,有图和文章

资源截图

代码片段和文件信息


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Isfahan University
%Mehdi Nasri
%june 2003
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
beepbeepclearclcclose all
disp(‘DSP Project ‘);
str=datestr(now‘dd-mmm-yyyy HH:MM:SS‘0);
disp(str);
disp(‘Executing program .... ‘);
count=3000;
load x_100 ;%The ECG data MAT file
END=length(sig);
x=sig(1:end1);     %Time   
y=sig(1:end2);     %ECG data #1
z=sig(1:end3);      %ECG data #2

count=4000;
y2=y ;%temp variable
temp=y;
disp(‘%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%‘)
TS=x(2)-x(1)Freq=1/TS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%DCT Compression
%
disp(‘%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%‘)
disp(‘DCT Compression‘);
scrsz = get(0‘ScreenSize‘);
figure(‘MenuBar‘‘none‘‘Name‘‘DCT Compression ‘...
    ‘Numbertitle‘‘off‘‘Position‘[1 1 800 600])
subplot(511)plot(x(1:count)y(1:count))axis([0 12 4 6.5]) title(‘DCT Compression‘);       %Plot base ECG signal 
dcty=dct(y);       %Discrete Cosin Transform of ECG   
subplot(512)stem(dcty)    axis([0 3000 -2 2]) ;    %Plot DCT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
counterB_DCT=0;
for index=1:1:END
    if (dcty(index)~=0)
        counterB_DCT=counterB_DCT+1;
    end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dcty1=dcty;

for index = 1:1:END
    if (dcty(index)<.22)&(dcty(index)>-0.22)
        dcty1(index)=0;
    end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
counterA_DCT=0;
for index1=1:1:END
    if (dcty1(index1)~=0)
        counterA_DCT=counterA_DCT+1;     
    end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%CounterA:Data Not ZERO after Compression
%CounterB:Data Not ZERO befor Compression
%CounterA-CounterB :Data set to Zero in COmpression Process

CompRatio_DCT=( (counterB_DCT-counterA_DCT)/counterB_DCT)*100
subplot(513)stem(dcty1) axis([0 3000 -2 2]);  

aftercomp_DCT=idct(dcty1);

subplot(514)plot(x(1:count)aftercomp_DCT(1:count))axis([0 12 4 6.5])

error_DCT=y-aftercomp_DCT;

PRD_DCT=sqrt(sum(error_DCT.^2)/sum(y.^2))*100
subplot(515)plot(error_DCT)pause(5)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%FFT Comperession 
disp(‘%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%‘)
disp(‘FFT Compression .‘);
figure(‘MenuBar‘‘none‘‘Name‘‘FFT Compression ‘...
    ‘Numbertitle‘‘off‘‘Position‘[1 1 800 600])
subplot(511)plot(x(1:count)y(1:count))axis([0 12 4 6.5])title(‘FFT Compression‘);        %Plot base ECG signal 
ffty=fft(y);       %FFT Transform of ECG   
subplot(512)stem(abs(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     682583  2003-06-21 21:43  ecg\DSPecg\1.pdf

     文件      10860  2003-06-25 20:20  ecg\DSPecg\CompFinal.m

     文件        733  2011-04-28 18:42  ecg\DSPecg\esg_dsp.asv

     文件       1184  2011-04-28 18:46  ecg\DSPecg\esg_dsp.m

     文件     240184  2001-05-14 16:43  ecg\DSPecg\X_100.MAT

     目录          0  2011-04-28 18:37  ecg\DSPecg

     目录          0  2011-04-27 21:58  ecg

----------- ---------  ---------- -----  ----

               935544                    7


评论

共有 条评论