資源簡介
能實現心電信號漢寧窗平滑濾波、多點拋物線擬合平滑濾波
兩點差分求導、三點差分求導、最小二乘多項式求導
中值濾波
數字陷波器設計
積分功能
代碼片段和文件信息
clcclearclose?all
%%
%1、cardiac?hemodynamic?analysis?
%?ICG?signals?-?5?channels?include?heart?sound?signal?ECG?delta?Z?and?dzdt?signal?base?z?signal.?
%?Fs=1000Hz?
%?fr=fopen(‘F:\matlab學習\signals\ICG?with?noise\170227068820170308092718.icg‘‘r‘);?%?change?the?path?based?on?your?computer
fr=fopen(‘170227068820170308092718.icg‘‘r‘);
%‘r‘以只讀方式打開文件,該文件必須存在
[Als]=fread(fr‘double‘);
fclose(fr);
%%
Length=10000;%length?is?the?length?of?every?channel
for?i=1:Length
????pcg(i)=A(5*(24000+i-1)+1);??
????ecg(i)=A(5*(24000+i-1)+2);
????dz(i)=-A(5*(24000+i-1)+3);
????dzdt(i)=A(5*(24000+i-1)+4);
????z(i)=A(5*(24000+i-1)+5);
end
%%%%??output?the?signals?of?5?channels
figure(1);
subplot(511);plot(pcg);title(‘pcg?signal‘);
subplot(512);plot(ecg);title(‘ecg?signal?‘);
subplot(513);plot(dz);title(‘delta?z?signal?‘);
subplot(514);plot(dzdt);title(‘dzdt?signal‘);
subplot(515);plot(z(1:200));title(‘base?z‘);
%%?使用Hanning濾波
sig=ecg;
n=size(sig2);
for?i=1:n-2
????sig_h(i)=(sig(i)+2*sig(i+1)+sig(i+2))/4;
end
sig_h(n)=sig_h(n-2);
sig_h(n-1)=sig_h(n-2);
%%?使用最小均方多項式平均(5點)
for?i=1:n-4
????sig_min(i)=((-3)*sig(i)+12*sig(i+1)+17*sig(i+2)+12*sig(i+3)+(-3)*sig(i+4))/35;
end
figure
xmin=0;
xmax=n;
%?xmax=2000;
ymin=-1;
ymax=1;
figure(2)
subplot(311);plot(sig);title(‘原始信號‘);axis([xminxmaxyminymax]);
subplot(312);plot(sig_h);title(‘Hanning濾波‘);axis([xminxmaxyminymax]);
subplot(313);plot(sig_min);title(‘最小均方多項式平均濾波‘);axis([xminxmaxyminymax]);
%%?求導兩點差分
sig=sig_h;%處理目標信號
fs=1000;%采樣率
T=1/fs;%周期
for?i=2:n
????sig_d2(i)=(sig(i)-sig(i-1))/T;
end
figure
subplot(311);plot(sig);title(‘原始信號‘);axis([010000-11]);
subplot(312);plot(sig_h);title(‘Hanning濾波‘);axis([010000-
- 上一篇:輪轂電機驅動電動汽車電子差速器仿真研究.rar
- 下一篇:最小二乘法進行系統辨識
評論
共有 條評論