E12 Assignment 05



1. Impulse as limiting case of pulse, Laplace Domain

a)  Write an expression for the function, f(t), shown below (a rectangular pulse with area=1).

b)  Write an expression for F(s).

c) As T→0 in the function above, it becomes a unit impulse (i.e., the width is zero and the area is one).  Use your previous result to show that the Laplace Transform of the function is that of a unit impulse. Recall or invoke L'Hôpital as necessary.

d) Repeat a, b, and c for the function shown below (a triangular pulse with area=1).




As T→0, F(s) goes to 0/0, so invoke L'Hôpital.


d)  Slope going up is 4/T².  So function is one slope going up, minus 2 going down at T/2, plus one going up at T.

Again as T→0, F(s) goes to 0/0.

This still results in 0/0, so L'Hôpital again.

2. Complicated Partial Fraction, Laplace (Using MATLAB)

a) Find the Inverse Laplace Transform of the following function using partial fraction expansion and Matlab's "residue" command.

b) Compare your Matlab result to the result obtained when doing the partial fraction expansion by hand. 


a) (Note in the second line I create the denominator polynomial by convolving a polynomial with roots at [0 -2 -2] (this corresponds to the "s(s+2)²" term - note the two roots at s=-2) with the polynomial "s²+2s+10."

>> N=[5 25 76 132 40];  
>> D=conv(poly([0 -2 -2]),[1 2 10]);
>> [r,p,k]=residue(N,D)
r =
   0.5000 - 0.0000i
   0.5000 + 0.0000i
p =
  -1.0000 + 3.0000i
  -1.0000 - 3.0000i
k =    []

>> abs(r(1))
ans =    0.5000
>> angle(r(1))*180/pi  %Phase angle in degrees (approx zero in this case).
ans = -3.1755e-013


b)  From class we know that the complex terms (r(1) and r(2)) combine into a single damped cosine with magnitude=2*abs(r(1)), phase=angel(r(1)), decay coefficient=-real(p(1)), omega=image(p(1))

3. MATLAB Element by Element multiplication

The following MATLAB code defines a time vector (row vector) and then a decaying exponential as a row vector (f_r) and a column vector (f_c). 

>> t=linspace(-1,4,51);        % t is a row vector with 51 elements (1x51) from -1 to 4.
>> f_r = exp(-t);              % f_r is a decaying exponential (row vector, 1x51).
>> f_c = exp(transpose(-t));   % f_c is a decaying exponential (column vector 51x1).

We wish to display .  For each of the following lines of MATLAB code determine which ones will

i) Generate an error?  If there is an error, explain what the error is.
ii) If no error, what is the size of y?
iii) Does it generate an appropriate looking plot?  If the plot is incorrect, explain why.

a)   >> y = heaviside(t)*f_r; plot(t,y)

b)  >> y = heaviside(t).*f_r; plot(t,y);

c)  >> y = f_r.*heaviside(t); plot(t,y);

d)   >> y = heaviside(t)*f_c; plot(t,y);

e)  >> y = heaviside(t).*f_c; plot(t,y);

f) >> y = f_c*heaviside(t); plot(t,y);

g)  >> y = f_c.*heaviside(t'); plot(t,y);

Note: instead of "heaviside(t)" you could use "(t>=0)". The only difference is that heaviside(0) evaluates to 0.5 instead of 1 (this is not important for our purposes).


a) Error, inner dimensions don't agree (can't multiply two row vectors).

b) All is good, y is 1x51

c)  All is good, y is 1x51

d) No error, but y is 1x1 (a scalar) and plot is wrong (a constant value at 9.8342).

e) Error, dimensions must agree to use element-by-element multiplication (we have one row vector, one column vector).

f)  No error, but y is 51x51 (square matrix).The nth row in y is filled by zeros (for indices equivalent to t<0) , 0.5*y(n) for t=0, and y(n) for t>0). There are 51 columns, and the plot command plots each column as a separate plot so we either get all zeros (for columns with indices equivalent to t<0), a single plot for the column with t=0, and the rest of the plots are for t>0.   There are actually 51 plots, but only three are unique.

g) All is good, y is 51x1.

4. Convolution Ramp with Pulse, Laplace

Derive an expression to verify the result depicted in the image below.  Click here for animation. Animation with h(t) and f(t) switched.  A piecewise description of the output is fine.

a) Find expressions for f(t), h(t), F(s) and H(s)  (Don't use the expression for f(t) that is in the image above, develop your own function that is the sum of ramps and steps).

b) Use the convolution property of the Laplace transform to find G(s) and g(t)=f(t)*h(t)=convolution of f(t) and h(t).

c) The answer, described piecewise, is given by

Region Convolution
t<0  0
3<t 0  

Verify that this is equivalent to your answer.

d) Plot f(t), h(t) and g(t) on the same set of axes with a legend.  Include your printout and your (well commented) code.  It is easiest to use your result from "b" and (element-by-element) multiplication with shifted versions of the heaviside (unit step) function.


a) The function f(t) is the sum of a ramp starting at t=0, minus a ramp at t=1 (to get slope to zero), minus a step at t=1 (to get discontinuity)



Collect like exponentials and take inverse transform





% E12 Homework Problem - Convolution of two signals.
t=linspace(-1,4,1000);  %Define time vector
% Define f(t) with (t>=T) as a step delayed by T seconds.

% Define h(t) with a logical function.
h=0.5*((t>=0) & (t<2));

% Define y(t) using heaviside function for step.
    -( ((t-1).^2) / 2 + (t-1) ).*heaviside(t-1)...
    -( ((t-2).^2) / 2 ).*heaviside(t-2)...
    +( ((t-3).^2) / 2 + (t-3) ).*heaviside(t-3));

% Plot all three functions with different colors, then label x-axis, add
% title and add legend.
hold on;
hold off;
grid on; 
xlabel('time');  title('Convolution: y(t)=f(t)*h(t)'); 

5. Laplace Domain Impulse Response / System Response

The differential equation below describes a physical system with y(t) as output and f(t) as input.


 a) Write an expression for H(s), the Laplace Transform of the impulse response of the system (recall that the impulse response is a zero state solution so all initial conditions are zero at t=0-).  In other words, if the input is the unit impulse, f(t)=δ(t), then the output of the system y(t), is equal to the impulse response, h(t)=y(t); find H(s).

b) If the input of the system is f(t)=γ(t), write an expression for Y(s) in terms of H(s). No need to simplify or do partial fractions.

c) If the input of the system is f(t)=sin(ω0t)γ(t), write an expression for Y(s) in terms of H(s).  No need to simplify.

d) Write a general expression for Y(s) in terms of H(s) and F(s).

e) Write a general expression for y(t) in terms of h(t) and f(t).


a) Initial conditions are zero, so they need not be considered




e) (Generally easier in Laplace)

6. Xfer Funcadelic

Answer the following:

a) If is , what is the system differential equation (input=f(t), output=y(t))?

b) If the step response of a system is , what is Hb(s) (as a ratio of polynomials in s)?

c) If the system has , find yZI(t) if .

d) If  , what is H(s) (as a ratio of polynomials in s)?



b) Find Y(s), get over a common denominator, multiply by s.

c) We have differential equation (part a), so take Laplace (w/ zero input) and use given I.C.'s

d) Take inverse Laplace of h(t) to get H(s) and then get over common denominator.

7. Some Convolution Examples in Laplace

For each of the examples below y(t)=f(t)*h(t) (y is the convolution of f and h).  All functions are implicitly zero for t<0.

  1. Write the convolution integral in time (don't solve it - it is just there to remind you how much easier these problems are in t).
  2. Find F(s), H(s) and Y(s)
  3. Find y(t)






Note: in all of your solutions there was no guessing forms of solutions, or hard integration.  In particular, part e would require integration by parts.