Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

using matlab to answer all questions! thanks! 1) Create the following signals xl

ID: 2249358 • Letter: U

Question

using matlab to answer all questions! thanks!

1) Create the following signals xl-cos(0.08*pi*nn) where nn is a 100 point vector from 0 to 99. Use 'firfilt' to filter xl with a causal three point moving average filter. Make a grid of 2x2 for four plots. In the grid, stem plot the input and output and transfer function magnitude and phase of the filter 2) Theoretically find the expression for the system function. Verify the magnitude and phase at wo by using a cursor. 3) Repeat with a 10 point moving average filter. This time the input to be tested is x2-2+cos(0.08*pi*nn) where nn is 100 point vector. Explain what component is filtered out if any 4) Create the function defined by the expression x2-255*(rem(1:159,30)>19); 5) Pass this signal through a first difference filter and subplot the input and output as stem along with the magnitude and phase of the filter. Explain why the input and output appear the way they do. Note the length of the input and output vectors

Explanation / Answer

MATLAB CODE :

x1=cos(0.08*pi*nn);

nn=0:99;

first=3;

last=length(x1)

nn = first:last;

bb=1/3*ones(1,3);

yy=firfilt(bb,x1);

subplot(2,1,1);

stem(nn,x1(nn))

subplot(2,1,2);

stem(nn,yy(nn),’filled’)

subplot(2,2,3);

plot(nn,abs(x1))

subplot(2,2,4);

plot(nn,abs(yy))

subplot(2,2,5);

plot(nn,angle(x1))

subplot(2,2,6);

plot(nn, angle (yy))