0% found this document useful (0 votes)
12 views8 pages

HW2_solution

Uploaded by

24mattew
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
12 views8 pages

HW2_solution

Uploaded by

24mattew
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

EE202B.

Signals and Systems

Homework 2 Solution
Problem 1. Compute the DT convolution y[n] = x[n] ∗ h[n] of each of the two following pairs of
signals:

(a) x[n] = (−3)n u[2 − n] and h[n] = 12 u[n − 1]


Answer.
∞ ∞
X 1 X 1
y[n] = u[k − 1](−3)−k+n u[2 − (n − k)] = (−3)−k+n u[2 − n + k] (1)
2 2
k=−∞ k=1

The range of u[2 − n + k] is from k = n − 2 through k = ∞. Thus, we sum from either k = 1


or k = n − 2, depending on which is larger. If n − 2 ≥ 1, we sum from k = n − 2. If n − 2 < 1,
we sum from k = 1. Note that n − 2 ≥ 1 implies n ≥ 3.
(P
∞ 1 n−k
k=1 2 (−3) n<3
y[n] = P∞ 1 n−k
k=n−2 2 (−3) n≥3
(
1
(−3)n ∞ −1 k
P
k=1 ( 3 ) n<3
= 12 n
P ∞ −1 k
2 (−3) k=n−2 ( 3 ) n≥3
(
−1
(−3)n n < 3
= 278
8 n≥3

(b) x[n] and h[n] as depicted below:

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:

Since y[n] is given by the formula below,



X
y[n] = x[n] ∗ h[n] = x[k]h[n − k] (2)
k=−∞

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τ
−∞

What is the impulse response h(t) for this system?


Answer.
Z t
y(t) = e−(t−τ ) x(τ − 2) dτ
−∞
Z ∞
= e−(t−τ ) x(τ − 2)u(t − τ ) dτ
Z−∞∞
′ (5)
= e−(t−τ −2) x(τ ′ )u(t − τ ′ − 2) dτ ′ (change of variable,τ − 2− > τ ′ )
Z−∞∞
= h(t − τ ′ )x(τ ′ )dτ ′
−∞
= h(t) ∗ x(t)

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:

Answer. For the given input signal


(
1, −1 ≤ t ≤ 2
x(t) = (7)
0, otherwise

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.

Problem 3. Consider the differential equation:


d2 y(t) 5 dy(t) 3
+ − y(t) = x(t) (12)
dt2 2 dt 2
(a) Show that if x(t) = 0 for all t, then:
1
y(t) = Ae−3t + Be 2 t

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.

x = u(t), ∀t < 0, y(t) = 0,


Particular solution, yp (t) = β (t ≥ 0),
5 3 (16)
0+ ∗0− β = 1,
2 2
2
β=−
3

Apply initial rest y(0) = 0, y (0) = 0.
2 −3t 4 1 t 2
y(t) = ( e + e 2 − )u(t) (17)
21 7 3
(c) Suppose the differential equation describes a causal system. Find the impulse response.
Answer.
To obtain the impulse response of the system, we set x(t) = δ(t),
d2 h(t) 5 dh(t) 3
+ − h(t) = δ(t), (18)
dt2 2 dt 2
t
h(t) = (Ae−3t + Be 2 )u(t) + Cδ(t),
d B t
h(t) = (A + B)δ(t) + (−3Ae−3t + e 2 )u(t) + C δ̇(t), (19)
dt 2
d 2 B B t
h(t) = (A + B)δ̇(t) + (−3A + )δ(t) + (9Ae−3t + e 2 )u(t) + C δ̈(t)
dt2 2 4

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

Now, consider the difference equation:


5 3
y[n] + y[n − 1] − y[n − 2] = x[n] (22)
2 2
(d) Show that if x[n] = 0 for all n, then:
 n
1
y[n] = A(−3)n + B
2

satisfies Eq. (2) for any constant values of A and B.


Answer.
Consider y[n] = Kz n where z n is the eigenfunction for a DT LTI system. Plugging this in,
we obtain:
5 3
Kz n + Kz n−1 − Kz n−2 = 0,
2 2  (23)
n 5 −1 3 −2
Kz 1 + z − z =0
2 2

Since z n is non-zero and assuming K ̸= 0, we can divide both sides by z n .


5 3
1 + z −1 − z −2 = 0 (24)
2 2

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

You might also like