{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Matlab A#01_Solutions - stem(nx,x title'Plot of x[n...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
%Signals & Systems Spring 2007 %Matlab HW #1 Solutions %TA Jonathan Ashdown %1) w = [0 -1 -1 2 2 1 1 0 0]; w = fliplr(w) w = -w nw = [-4:1:4] subplot(3,1,1), stem(nx,x), title( 'signal x[n]' ); subplot(3,1,2), stem(nx_neg,x_neg), title( 'signal x[-n]' ); subplot(3,1,3), stem(nw,w), title( 'signal w[n]' ); % 2
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
x3 = [1 1 1 0]; h3 = [3 1 1]; nx3 = [-3:1:0]; nh3 = [-1 0 1]; y3 = conv(h3,x3); ny3 = [-4 -3 -2 -1 0 1]; subplot(3,1,1), stem(nx3,x3), title( 'signal x3[n]' ); subplot(3,1,2), stem(nh3,h3), title( 'signal h3[n]' ); subplot(3,1,3), stem(ny3,y3), title( 'signal y3[n]' ); %3
Image of page 2
x = [0 -1 -1 2 2 1 1 0 0]; nx = [-3 -2 -1 0 1 2 3 4 5]; ev_x = 0.5*(x +fliplr(x)); od_x = 0.5*(x - fliplr(x)); sum = ev_x + od_x; subplot(411)
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: stem(nx,x) title( 'Plot of x[n]' ) subplot(412) stem(nx,ev_x) title( 'Even Part of x[n]' ) subplot(413) stem(nx,od_x) title( 'Odd Part of x[n]' ) subplot(414) stem(nx,sum) title( 'Sum of Odd and Even part should equal x[n]. ..IT DOES!!' ) % 4 %4(a) By Hand %4(b) figure(1); syms t ; q = (t+2)*heaviside(t+2) - t*heaviside(t) - 2*(t-2)*heaviside(t-2) + 2*(t-3)*heaviside(t-3) subplot(211) ezplot(q,[-5 5]) title( 'x(t)' ) %4(c) d = diff(q) %MATLAB Output: %heaviside(t+2)+(t+2)*dirac(t+2)-heaviside(t)-t*dirac(t)-2*heaviside(t-2)-%(2*t-4)*dirac(t-2)+2*heaviside(t-3)+(2*t-6)*dirac(t-3) %4(d) subplot(212) ezplot(d,[-5 5]) title( 'dx(t)/dt' )...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern