
Добавил:
Вуз:
Предмет:
Файл:
Лабы_Вариант 4_5 сем / ЛР_1 / Ч3. Эффект наложения на сигнале ЭКГ / untitled
.m clc;
clear all;
Y=load('W1_04.txt');
LY=length(Y);
Fs=1200;
T=1/Fs;
tmax=LY*T;
t=0:T:tmax-T;
K1=5;
Fs1=Fs/K1;
T1=1/Fs1;
t1=0:T1:tmax-T1;
LY1=LY/K1;
for i=1:LY1
Y1 (i) = Y((i-1)*K1+1);
end
figure
subplot(3,1,1)
plot(t,Y)
title('Исходный сигнал')
subplot(3,1,2)
plot(t1,Y1)
title('при K1=5')
set(gca,'YLim',[-500 1500])
K2=16;
Fs2=Fs/K2;
T2=1/Fs2;
t2=0:T2:tmax-T2;
LY2=LY/K2;
for i=1:LY2
Y2 (i) = Y((i-1)*K2+1);
end
hold on
subplot(3,1,3)
plot(t2,Y2)
title('при K2=16')
set(gca,'YLim',[-500 1500])
clear all;
Y=load('W1_04.txt');
LY=length(Y);
Fs=1200;
T=1/Fs;
tmax=LY*T;
t=0:T:tmax-T;
K1=5;
Fs1=Fs/K1;
T1=1/Fs1;
t1=0:T1:tmax-T1;
LY1=LY/K1;
for i=1:LY1
Y1 (i) = Y((i-1)*K1+1);
end
figure
subplot(3,1,1)
plot(t,Y)
title('Исходный сигнал')
subplot(3,1,2)
plot(t1,Y1)
title('при K1=5')
set(gca,'YLim',[-500 1500])
K2=16;
Fs2=Fs/K2;
T2=1/Fs2;
t2=0:T2:tmax-T2;
LY2=LY/K2;
for i=1:LY2
Y2 (i) = Y((i-1)*K2+1);
end
hold on
subplot(3,1,3)
plot(t2,Y2)
title('при K2=16')
set(gca,'YLim',[-500 1500])
Соседние файлы в папке Ч3. Эффект наложения на сигнале ЭКГ