function [ryx, yn] = dsp_hw(xn, sigma)
a = 0.9; D = 20; mean = 0;
xn = [xn zeros(1,200-length(xn))];
vn = mean + sigma * randn(1,200);
yn = [zeros(1,D) xn(1:200-D)];
yn = a*yn + vn;
y_n=fliplr(yn);
ryx=conv(xn,y_n);
n=1:200;
figure;stem(n,xn);hold on;stem(n,yn,'r');
axis([0 201 -1.5 1.5]);grid on;
title('Do thi x(n) va y(n)'); legend('x(n)','y(n)');
figure;stem(ryx); grid on;
title('Do thi tuong quan cheo rxy(n)');