Ok, I am supposed to find the convolutions of the following functions;
x1(t) = t*u(t) - t*u(t-1);
x2(t) = (10*exp(-4*t))*u(t);
by hand. So, I did it and I found out that;
x1(t)*x2(t) = ((5/8)*exp(-4*t) + (5/2)*t - (5/8))*u(t) - ((5/8)*exp(-4*t) + (5/2)*t - (5/8))*u(t-1)
Now, I have to plot it with MATLAB, so I did it(attachment 1). And I have to compare it to the plot given by MATLAB's conv function(attachment 2).
As you can see the plots are similar, but they have their obvious differences. Why does my first plot go to zero as soon as it reaches one? And the other decreases exponentially? I still can't figure out why, so please help me. ;<
The code to find the conv that I found by hand is here;
And the code to find the conv of the two functions with MATLAB is here;
PS: Heaviside(t) works like u(t).
Edwin
x1(t) = t*u(t) - t*u(t-1);
x2(t) = (10*exp(-4*t))*u(t);
by hand. So, I did it and I found out that;
x1(t)*x2(t) = ((5/8)*exp(-4*t) + (5/2)*t - (5/8))*u(t) - ((5/8)*exp(-4*t) + (5/2)*t - (5/8))*u(t-1)
Now, I have to plot it with MATLAB, so I did it(attachment 1). And I have to compare it to the plot given by MATLAB's conv function(attachment 2).
As you can see the plots are similar, but they have their obvious differences. Why does my first plot go to zero as soon as it reaches one? And the other decreases exponentially? I still can't figure out why, so please help me. ;<
The code to find the conv that I found by hand is here;
Rich (BB code):
syms t
t = 0:.001:4;
y = ((5/8).*exp(-4.*t) + (5/2).*t - (5/8)).*Heaviside(t) - ((5/8).*exp(-4.*t) + (5/2).*t - (5/8)).*Heaviside(t-1)
plot(t,y)
Rich (BB code):
syms t
t = 0:.001:2;
tconv = 0:.001:4;
x1 = t.*Heaviside(t) - t.*Heaviside(t-1);
x2 = (10*exp(-4*t)).*Heaviside(t);
y = conv(x1, x2);
plot(tconv,y)
Edwin
Attachments
-
13.7 KB Views: 21
-
14.6 KB Views: 23