clear; clc; ERR_MAX = zeros(1, 15); ERR_MEAN = ERR_MAX; ERR_MEDIAN = ERR_MAX; for i=1:15 pack = load("ecg/A" + sprintf("%05d", i) + ".mat"); Y = pack.val; X = 1:width(Y); prob_freq = 4; % częstotliwość 300 / prob_freq X1 = 1:prob_freq:width(X); Y1 = Y(X1); close all; hold on; %plot(X, Y); %plot(X1, Y1, 'or', 'LineWidth', 1.5); [~, Yr] = sinc_inter(Y1, prob_freq); % Xr powinien być równy X. %plot(X,Yr, '--b', 'LineWidth', 1.5); [~, Ye] = e_inter(Y1, prob_freq); %plot(X,Ye, ':m', 'LineWidth', 1.5); %grid on; %plot([10 10], [-1.5 1.5], '--k', 'LineWidth', 2); %plot([70 70], [-1.5 1.5], '--k', 'LineWidth', 2); %xlabel("t"); %ylabel("A"); %legend('Sygnał wejściowy', 'Punkty pomiaru', 'sinc-inter', 'e-inter'); disp("SIGNAL A" + sprintf("%05d", i)); disp("sinc_inter max abs error:"); disp(max(abs(Y(10:70)-Yr(10:70)))); disp("sinc_inter mean abs error:"); disp(mean(abs(Y(10:70)-Yr(10:70)))); disp("e_inter max abs error:"); disp(max(abs(Y(10:70)-Ye(10:70)))); disp("e_inter mean abs error:"); disp(mean(abs(Y(10:70)-Ye(10:70)))); end