ecg_struct = load('test.mat');
fn = fieldnames(ecg_struct);
fprintf(2, 'Warning: file contains %d different variables, arbitrarily picking the first: %s\n', length(fn), fn{1});
ecg_i = ecg_struct.(fn{1});
FIR_c1=[0.0041,0.0053,0.0068,0.0080,0.0081,0.0058,-0.0000,-0.0097,-0.0226,...
-0.0370,-0.0498,-0.0577,-0.0576,-0.0477,-0.0278,0,0.0318,0.0625,0.0867,...
0.1000,0.1000,0.0867,0.0625,0.0318,0,-0.0278,-0.0477,-0.0576,-0.0577,...
-0.0498,-0.0370,-0.0226,-0.0097,-0.0000,0.0058,0.0081,0.0080,0.0068,...
FIR_c2=[0.0070,0.0094,0.0162,0.0269,0.0405,0.0555,0.0703,0.0833,0.0928,...
0.0979,0.0979,0.0928,0.0833,0.0703,0.0555,0.0405,0.0269,0.0162,0.0094,...
ECG_l=[ones(1,l1)*ECG(1) ECG ones(1,l1)*ECG(N)];
ECG=filter(FIR_c1,1,ECG_l);