

sum = 0;
ea = zeros(len,1);
wa = zeros(len,1);
y = cell2mat(x4(:,3));
len = size(y,1);
k = 20;
a = 1/k;
b = 1 - a;

for i=1:len
    sum = b*sum + a*y(i);
    ea(i) = sum;
    if i>k
        wa(i) = 1/k*( ones(1,k)*y(i-k+1:i) );
    end
end

plot(1:len,1./abs(ea),1:len,1./abs(y))
figure(2), plot(1:len,1./abs(wa))
% plot(1:len,ea)