1
function [out, lower_prct, upper_prct] = ProcentileFilter(signal, threshold)
5
signal = signal-medfilt1(signal, Nmed);
7
disp("Àïåðòóðà ôèëüòðà äëÿ insFrc_AcfNrm äëÿ ôèëüòðà ïðîöåíòèëåé: " + Nmed);
8
prct = prctile(signal, threshold);
13
% lower_prct = prctile(signal-medfilt1(signal, Nmed), 30);
14
% upper_prct = prctile(signal-medfilt1(signal, Nmed), 30);
16
disp("lower_prct " + lower_prct);
17
disp("upper_prct " + upper_prct);
19
% line('XData', [0 200], 'YData', [lower_prct lower_prct], 'Color','red','LineStyle','--');
20
% line('XData', [0 200], 'YData', [upper_prct upper_prct],'Color','red','LineStyle','--');
23
signal=signal-medfilt1(signal, Nmed);
27
MemoryValue = signal(1);
29
% Öèêë ïî âñåìó ñèãíàëó
32
if (value < lower_prct || value > upper_prct)
33
out(index) = MemoryValue;
36
MemoryValue=out(index);