Using Matlab to obtain the output squence that results when you use k(n) = cos(pi*n/4) as the input.
y(n) = x(n) + 2x(n-1) + x(n-2) + 0.8y(n-1) - 0.64y(n-2)
Plot (stem) the resulting output. n=255
Amplitude? Was the signal amplified through the system? By how much?
Matlab Code:
w = pi/4;
H = (1+2*exp(-j*w) + exp(-2*j*w))/(1-0.8*exp(-j*w) +
0.64*exp(-2*j*w))
magnH = abs(H);
angleH = rad2deg(angle(H));
for n = 1:255
x(n) = cos(pi/4*n);
y(n) = magnH*cos(pi/4*n + angleH);
end
n = 1:255;
subplot(2,1,1)
stem(n,x)
ylabel('x(n)')
xlabel('time index n')
subplot(2,1,2)
stem(n,y)
ylabel('y(n)')
xlabel('time index n')
Output:
Get Answers For Free
Most questions answered within 1 hours.