ssa
1function [NS,w_avr,w_med,w_iqr] = wav(N,S,W,res,sET)
2ET = zeros(N,S);
3for j=1:S % öèêë ïî ñåãìåíòàì
4for i=1:W
5k = (j-1)*res;
6ET(i+k,j) = sET(i,j); % ñäâèíóòûé ñåãìåíò ET(:,j)
7end
8end
9TS = zeros(S);
10for i=1:N % öèêë ïî îòñ÷åòàì ET
11nSi = 0;
12for j=1:S % öèêë ïî ñåãìåíòàì ET
13if ET(i,j)~=0
14nSi = nSi+1; % òåêóùèé íåíóëåâîé îòñ÷åò ET(i,j)
15Smp(nSi) = ET(i,j);
16end
17end
18NS(i) = nSi; % êîë-âî ñåãìåíòîâ äëÿ òåêóùåãî i
19w_avr(i) = mean(Smp(1:nSi)); % âûáîðî÷íàÿ ñðåäíÿÿ
20w_med(i) = median(Smp(1:nSi)); % ìåäèàíà
21w_iqr(i) = (prctile(Smp(1:nSi),75)-prctile(Smp(1:nSi),25))/2.0;
22end
23NS = NS';
24w_avr = w_avr'; % î÷èùåííàÿ ïóëüñîâàÿ âîëíà
25w_med = w_med';
26w_iqr = w_iqr'; % ïîëîâèíà èíòåðêâàðòèëüíîãî äèàïàçîâà
27end