% file: task12.m
% Moving Average 2 - taking average
% of two samples:
%   y[n] = 0.5 * (x[n] + x[n-1])
% where x is original signal
% and   y is filtered/averaged signal

y2  = zeros(length(y), 1);
for k = 2 : length(y)
    y2(k) = 0.5 * (y(k) + y(k-1));
end;
soundsc(y2, Fs);  % filtered signal
