1
function [RGB,RGB_nc,RGB_med] = Rendes_RGB(Name)
2
fmin=0.15; % íèæíÿÿ ãðàíèöà - ÷àñòîòíûé äèàïàçîí äûõàòåëüíîé âîëíû
3
dt=1/30; % èíòåðâàë âðåìåííîé äèñêðåòèçàöèè
4
Nmed=1/(dt*fmin); % àïåðòóðà ôèëüòðà
5
zrp="endh/"; % Zero Folder
7
% P1H1_ÁåçÊîìïåíñàöèåéßðêîñòè_RGB
8
% P1H1_ÑÊîìïåíñàöèåéßðêîñòè_RGB
10
RGB=load(Path+Name+"_ÑÊîìïåíñàöèåéßðêîñòè_RGB.txt");
11
RGB_nc=load(Path+Name+"_ÁåçÊîìïåíñàöèåéßðêîñòè_RGB.txt");
12
nc=0:dt:length(RGB)*dt-dt;
14
disp("ERROR: Îøèáêà ïðè ôîðìèðîâàíèè îò÷¸òà ïî "+Name);
15
RGB=[];RGB_nc=[];RGB_med=[];
19
figure('Name','RGB','Position', [0 0 1400 900]); set(gcf,'name',"Ñðàâíåíèå ìåäèàííîé ôèëüòðàöèè äëÿ "+Name); clf;
20
subplot(2,2,1); plot(nc, RGB_nc(:,1),"red", nc, RGB_nc(:,2),"green", nc, RGB_nc(:,3),"blue");
21
title("Âðåìåííîé ðÿä RGB äî êîìïåíñàöèè öâåòà"); grid on;
22
xlabel("Ñåêóíäû"); ylabel("Èíòåíñèâíîñòü öâåòîâûõ êàíàëîâ"); % ylim([40;105]);
24
subplot(2,2,2); plot(nc, RGB(:,1),"red", nc, RGB(:,2),"green", nc, RGB(:,3),"blue");
25
title("Âðåìåííîé ðÿä RGB ïîñëå êîìïåíñàöèè öâåòà"); grid on;
26
xlabel("Ñåêóíäû"); ylabel("Èíòåíñèâíîñòü öâåòîâûõ êàíàëîâ"); % ylim([40;105]);
30
RGB_med(:,1)=RGB_med(:,1)-medfilt1(RGB_med(:,1),Nmed);
31
RGB_med(:,2)=RGB_med(:,2)-medfilt1(RGB_med(:,2),Nmed);
32
RGB_med(:,3)=RGB_med(:,3)-medfilt1(RGB_med(:,3),Nmed);
33
plot(nc, RGB_med(:,1),"red", nc, RGB_med(:,2),"green", nc, RGB_med(:,3),"blue");
34
title("Âðåìåííîé ðÿä RGB ïîñëå êîìïåíñàöèè öâåòà è ìåäèàííîãî ôèëüòðà ñ îêíîì N_m_e_d="+Nmed);
35
xlabel("Ñåêóíäû"); ylabel("Èíòåíñèâíîñòü öâåòîâûõ êàíàëîâ"); grid on; ylim([-4;4]);