function [ Y ] = medfilter(X, n)
%MEDFILTER Median filtering of a vector.

Y = X;
m = floor(n / 2);
for idx = (m + 1):(length(X) - m)
    Y(idx) = median(X((idx - m):(idx + m)));
end

    

end

