HW2_solution
HW2_solution
Homework 2 Solution
Problem 1. Compute the DT convolution y[n] = x[n] ∗ h[n] of each of the two following pairs of
signals:
Answer. To do this convolution, we should first calculate x[k] and h[−k + n]:
1
We then want to shift h[−k] over by enough units to the left so that it has just begun to overlap
with x[k]. In this case, this happens at n = −5. See figure below:
we can see that for each n value, y[n] will be the sum of the products of each overlapping sections of
x[k] and h[−k + n]. As mentioned above, the first non-zero y[n] value will occur at n = −5, which
can be seen by the fact that if h[−k] is shifted any further to the left, there will be no overlapping
sections with x[k]. Thus, y[−5] = 1 ∗ 2 = 2. Similarly, for other values of n, we shift h[−k] by n
units (to the left if n is negative and to the right if n is positive), multiply each of the overlapping
2
points and sum them up.
y[−5] = 1 ∗ 2 = 2
y[−4] = (−1) ∗ 1 + 2 ∗ 0 = −1
y[−3] = 1 ∗ 1 + (−1) ∗ 0 + 2 ∗ 1 = 3
y[−2] = 0 ∗ 1 + 1 ∗ 0 + (−1) ∗ 1 + 2 ∗ 2 = 3
y[−1] = 2 ∗ 1 + 0 ∗ 0 + 1 ∗ 1 + (−1) ∗ 2 + 2 ∗ 1 = 3
(3)
y[0] = (−1) ∗ 1 + 2 ∗ 0 + 0 ∗ 1 + 1 ∗ 2 + (−1) ∗ 1 = 0
y[1] = (−1) ∗ 0 + 2 ∗ 1 + 0 ∗ 2 + 1 ∗ 1 = 3
y[2] = (−1) ∗ 1 + 2 ∗ 2 + 0 ∗ 1 = 3
y[3] = (−1) ∗ 2 + 2 ∗ 1 = 0
y[4] = (−1) ∗ 1 = −1
Eventually, we get to y[4], which is the last possible n value for which there is overlap between x[k]
and h[−k + n], as seen below:
Thus, all y[n] values beyond n = 4 are zero and y[4] = −1. Thus,
0, n < −5
2, n = −5
−1, n = −4
3, n = −3
3, n = −2
3, n = −1
y[n] = (4)
0, n=0
3, n=1
3, n=2
0,
n=3
−1,
n=4
0, n>4
3
Problem 2.
(a) Consider an LTI system with input and output related through the equation
Z t
y(t) = e−(t−τ ) x(τ − 2) dτ
−∞
where h(t) = e−(t−2) u(t − 2) is clearly the impulse response of the system.
Alternative Solution: The impulse response h(t) is the output of the system, for a delta
function input x(t) = δ(t). So, we have
Z t
h(t) = e−(t−τ ) δ(τ − 2) dτ
−∞
Zt
= e−(t−2) δ(τ − 2) dτ
−∞ (6)
Z t
= e−(t−2) δ(τ − 2) dτ
−∞
= e−(t−2) u(t − 2)
(b) Determine the response of the system when the input x(t) is as shown in the following figure:
4
Z ∞
y(t) = h(τ )x(t − τ )dτ
−∞
(τ −2)
h(τ ) = e u(τ − 2), (8)
(
1, −2 + t ≤ r ≤ 1 + t
x(t − τ ) =
0, otherwise
Case 1: 1 + t < 2. There is no overlap between h(τ ) and x(t − τ ). Hence, y(t) = 0 for t < 1.
Case 2: 1 + t ≥ 2, and −2 + t < 2. The convolution integral above is non-zero in the region
τ ∈ [2, 1 + t]. And x(t − τ ) = 1 wherever x(t) is non-zero. Hence
Z t+1
y(t) = h(τ )dτ
2
Z t+1
(9)
= e−(τ −2) dτ
2
= 1 − e−(t−1) (for, 1 ≤ t < 4).
Case 3: −2 + t ≥ 2. In this case, the convolution integral is non-zero in the region τ ∈ [−2 + t, 1 + t].
Hence,
Z t+1
y(t) = h(τ )dτ
t−2
Zt+1
(10)
= e−(τ −2) dτ
t−2
= (1 − e−3 )e−(t−4) (for, t ≥ 4).
So, the output of the LTI system given by impulse response h(t), for given input x(t), is
0,
t<1
y(t) = 1 − e −(t−1) , 1 ≤ t < 4, (11)
−3
(1 − e )e −(t−4) , t≥4
Notice that the output y(t) remains zero until the input starts overlapping with the impulse re-
sponse, then rises exponentially to 1 − e−3 till the overlap between the input and the impulse
response keeps increasing, and thereafter, the exponential decay of the impulse response makes the
output decay exponentially with time.
5
satisfies Eq. (1) for any constant values of A and B.
Answer.
The homogeneous solution to the differential equation are of the form
y(t) = Aest ,
d2 5d 3
2
{Aest } + {Aest } − Aest = 0,
dt 2 dt 2
5 3 (13)
s2 Aest + s{Aest } − Aest = 0,
2 2
st 2 5 3
Ae {s + s − } = 0
2 2
Since est can never be 0 and we assume A ̸= 0, we can divide both sides of this equation by
Aest
5 3
s2 + s − = 0 (14)
2 2
Solving this quadratic equation gives s1 = −3, s2 = 12 . Thus,
1
y(t) = Ae−3t + Be 2 t (15)
(b) Suppose the differential equation describes a causal system. When x(t) is the unit step func-
tion u(t), find the solution y(t).
Answer.
6
It is worth noting that the product of any arbitrary smooth function and a delta function
is a delta function scaled by the value of the function at that point. Thus, when taking the
derivative of a function multiplied by a delta, one should regard the function as a scalar and
the result is that same scalar multiplied by a doublet.
We now determine A, B, and C by singularity matching. We immediately see that C = 0
since there are no δ̈(t). Substituting back into the original differential equation we get
B B t
(A + B)δ̇(t)+(−3A + )δ(t) + (9Ae−3t + e 2 )u(t)
2 4 (20)
5 5 −3t B t 3 t
+ (A + B)δ(t) + (−3Ae + e 2 )u(t) − (Ae−3t + Be 2 )u(t) = δ(t)
2 2 2 2
Noting that the u(t) terms cancel, we have
A + B = 0 −→ A = −B,
B 5A 5B A (21)
−3A + + + = 1 −→ − + 3B = 1
2 2 2 2
Solving gives A = − 27 B = 2
7 and
2 2 t
h(t) = (− e−3t + e 2 )u(t)
7 7
7
Note that this equation is a quadratic eqn in z −1 with roots.
1 1
z1−1 = 2, z2−1 = − , z1 = , z2 = −3, (25)
3 2
Hence
y[n] = K1 z1n + K2 z2n ,
1 (26)
y[n] = A(−3)n + B( )n
2
(e) Suppose the difference equation describes a causal system. Find the impulse response.
Answer.
If we set x[n] = δ[n], we can find y[n] = h[n] where h[n] is the impulse response:
5 3
h[n] + h[n − 1] − h[n − 2] = δ[n] (27)
2 2
If we assume the condition of initial rest, i.e.x[n] = 0, ∀n < 0 implies y[n] = 0, ∀n < 0, then
we have a causal system where h[n] = 0, ∀n < 0. Thus,
1
h[n] = [A(−3)n + B( )n ]u[n] + Cδ[n],
2
h[0] = A + B + C = 1,
B 5
h[1] = −3A + = − −→ B = 6A − 5,
2 2
B 31 (28)
h[2] = 9A + = ,
4 4
6A − 5 31
= 9A + = ,
4 4
6
∴ 42A = 36 −→ A =
7
Therefore,
6
A= ,
7
6 1
B = 6( ) − 5 = ,
7 7 (29)
C = 0,
6 1 1 n
h[n] = (−3)n + ( ) u[n]
7 7 2