PS2Solns - Figure 2 Plot of resulting convolution y wrt...

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

View Full Document Right Arrow Icon
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
Problem 6: Matlab Code: dt=0.1; %time step t1=0:dt:2; t2=0:dt:4; x1=ones(1,length(t1)); x2=ones(1,length(t2)); y=conv(x1,x2); %Note that convolution length: t is the sum of the lengths of t1 and t2 t=0:dt:6; %scale y with time step dt y=y*dt; %Note:you don’t need to use these functions, I just wanted to introduce you %to some new plot properties subplot(1,2,1),plot(t1,x1);title('x1 vs time'),xlabel('t'),ylabel('x1') subplot(1,2,2),plot(t2,x2);title('x2 vs time'),xlabel('t'),ylabel('x2') figure,plot(t,y); Figure 1, Plot and x1 and x2 wrt time
Image of page 5

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

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

Unformatted text preview: Figure 2 , Plot of resulting convolution y wrt time NOTE: This part is not included to homework; I just put these for you so that you can see how the created arrays look like in Matlab. When you convolve x1 and x2(by taking the integral of x1 and x2) what you do is multiplying corresponding x1 and x2 values and the time interval, and then summing up these values. Since Matlab do not multiply the values with the time interval while convolving functions, you need to scale the result by multiplying dt after the convolution....
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