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

#5 x = zeros(1, 100); x(1) = 1; h0=-0.07568267; h1=-0.06236595; h2=0.09354893; h

ID: 3602791 • Letter: #

Question

#5

x = zeros(1, 100);

x(1) = 1;

h0=-0.07568267;

h1=-0.06236595;

h2=0.09354893;

h3=0.30273069;

h4=0.4;

h5=h3;

h6=h2;

h7=h1;

h8=h0;

y=h0*(x+circshift(x, 8))+h1*(circshift(x, 1))+circshift(x, 7))+h2*(circshift(x, 2)+circshift(x, 6))+h3*(circshift(x, 3)+circshift(x, 5))+h4*ciecshift(x, 4);

stem(X);

hold on;

stem(y);

B)

x(n)=u(n)

t=(-1; 0.01; 1);

u=t>=0;

x=u;


C)

x(n)=cos(0.2*pi*n)*u(n)

x1=linespace(0, 2*pi, 50);

x2=cos(0.2*pi*x1);

u=ones(1, 2*pi);

x=x2*u;

I need help with my Matlab code. #5 please

Exercises For Exercises 4-6, use the discrete system described by the finite impulse response, hn), where h(0)-h(8)=-0.07568267 h(1) = h(7)--0.06236595 h(2)=h(6)=0.09354893 h(3)-h(5)-0.30273069 h(4) = 0.4 4. Dravw a) a Direct Form block diagram of the system b) a transposed Direct Form II block diagram of the system Indicate the number of delays (memory registers), adds and multiplies required to calculate each output sample. 5. Using the circshift function and vector multiplication, write a program for each of the block diagram that you drew in Exercise 4. Using these programs, calculate the system's first 51 outputs when the system's input, x(n), is x(n) - S(n) a) b) x(n)=u(n) x(n) = cos(0.2m) u(n) d) x(n) = cos (0.2mn) u(r) + cos(0.7m) u(n) Plot the inputs and outputs using the stem, title and subplot functions. (You should gener ate 12 plots on 4 pages, that is, three plots per page.) Using MATLAB's built-in conv function, calculate the system's first 51 outputs when the system's input, x(n), is 6. x(n)=3(n) b) a) x(n)=u(n) c) x(n) = cos(0.2m)a(n) d) x(n)=COS (0.2m) u(n) +COS (0.7m) u(n) Plot the inputs and outputs using the stem, title and subplot functions. (You should gener ate 8 plots on 2 pages, that is, four plots per page.)

Explanation / Answer

x = zeros(1, 100);

x(1) = 1;

h0=-0.07568267;

h1=-0.06236595;

h2=0.09354893;

h3=0.30273069;

h4=0.4;

h5=h3;

h6=h2;

h7=h1;

h8=h0;

y=h0*(x+circshift(x, 8))+h1*(circshift(x, 1))+circshift(x, 7))+h2*(circshift(x, 2)+circshift(x, 6))+h3*(circshift(x, 3)+circshift(x, 5))+h4*ciecshift(x, 4);

stem(X);

hold on;

stem(y);