如何用matlab读TXT格式的心电信号并画图?心电信号滤波在matlab中一般用什么滤波器?

2025-05-21 13:45:05
推荐回答(1个)
回答1:

clear,clc

SamplingFre=1000; %采样频率(Hz)

[filename,filepath]=uigetfile('E:\实验数据9.29\*.txt');
filename=[filepath,filename];
[t,ecg_pre]=textread(filename,'%f%f','headerlines',1);
plot(t,ecg_pre);

wn=[10 150]/SamplingFre; %巴特沃斯带通滤波器
[b,a]=butter(3,wn);
ecg_post=filter(b,a,ecg_pre);
figure
plot(t,ecg_post);