Professional Documents
Culture Documents
EE301 Fall2019 Hw1 Solutions
EE301 Fall2019 Hw1 Solutions
1. i. x(t)
−1
−6 −5 −4 −3 −2 1 2 3 4 5 6 t
−1
x(t + 1)
−2
−6 −5 −4 −3 −1 1 2 3 4 5 6 t
−1
ii. x(2t)
−0.5
−6 −5 −4 −3 −2 −1 0.5 1 2 3 4 5 6 t
−1
iii. t−2
x
3
−3 −2 −1 1 2 3 4 5 6 7 8 9 t
−1
iv. 1
xe (t) = Eν {x(t)} = (x(t) + x(−t))
2
xe (t)
0.5
−6 −5 −4 −3 −2 −1 1 2 3 4 5 6 t
1
xo (t) = Od {x(t)} = (x(t) − x(−t))
2
xo (t)
1
0.5
−2 −1
−6 −5 −4 −3 1 2 3 4 5 6 t
−0.5
−1
2. • If a CT signal x(t) is periodic, there exists a positive number T such that x(t + T ) = x(t)
and its fundamental period T0 is the smallest nonzero period T satisfying this relation.
• If a DT signal x[n] is periodic, there exists a positive integer N such that x[n + N ] = x[n]
and its fundamental period N0 is the smallest nonzero period N satisfying this relation.
π
i. x(t) = 3 cos 4t +
3
2π π
is periodic with the fundamental period T0 = = .
4 2
h i
ii. π 2 1 2π
x(t) = cos 2t − = 1 + cos 4t −
3 2 3
2π π
is periodic and its fundamental period is T0 = = .
4 2
iii. x(t) = 2 cos (10t + 1) − sin (4t − 1)
2π π 2π π
cos (10t + 1) is periodic with period = and sin (4t − 1) is periodic with period = .
10 5 π π 4 2
Hence, x(t) is periodic and its fundamental period is T0 = LCM , = π.
5 2
iv. 1 1
x(t) = Eν {cos (4π t) u(t)} = [cos (4π t) u(t) + cos (−4π t) u(−t)] = cos (4π t)
2 2
(Remember that cos (−θ) = cos (θ).)
2π 1
The signal x(t) is periodic and its fundamental period is T0 = = .
4π 2
π
v. x[n] = j n = exp j n
2
π
x[n + N ] = x[n] =⇒ exp j N = 1 = exp (j2πk) for k ∈ Z
2
Then, we obtain N = 4k. Hence, x[n] is periodic and its fundamental period is N0 = 4 (for
k = 1).
√ π n √ n π
vi. x[n] = (1 + j)n = 2 exp j = 2 exp j n
4 4
√ n
Owing to 2 , we cannot find a nonzero N satisfying x[n + N ] = x[n], and the signal x[n]
is not periodic.
vii. 25
x[n] = exp j πn
4
25
x[n + N ] = x[n] =⇒ exp j πN = 1 = exp (j2πk) for k ∈ Z
4
8
Then, we obtain N = k. Hence, x[n] is periodic and its fundamental period is N0 = 8
25
(for k = 25).
3. (1) A system is memoryless (instantaneous) if the output at any time instant depends only on
the value of the input at that particular instant.
(2) A system is causal if its output at any time depends only on the values of the input at present
time and in the past.
(3) A system is stable if bounded inputs lead to bounded outputs (BIBO stable).
(4) A system is time-invariant if a time shift in the input signal causes same amount of time shift
in the output signal.
CT: a x1 (t) + b x2 (t) → a y1 (t) + b y2 (t) ⇐= x1 (t) → y1 (t) and x2 (t) → y2 (t)
DT: a x1 [n] + b x2 [n] → a y1 [n] + b y2 [n] ⇐= x1 [n] → y1 [n] and x2 [n] → y2 [n]
System (1) Memoryless (2) Causal (3) Stable (4) Time-Invariant (5) Linear
iii. 2n
X
y[n] = x[k]
k=−∞
The system is not causal. For instance, when n = 1, we see that y[1] = x[2]+x[1]+x[0]+. . .,
and the current value of the output depends on the future value of the input.
The system is not memoryless since it is not causal.
The system is not time-invariant owing to the upper limit of the summation 2n. Assuming
x2 [n] = x1 [n − n0 ] for x1 [n] → y1 [n] and x2 [n] → y2 [n], we obtain y2 [n] 6= y1 [n − n0 ].
2n 2n 2n−n
X X `,k−n0
X0
y2 [n] = x2 [k] = x1 [k − n0 ] = x2 [`]
k=−∞ k=−∞ `=−∞
=⇒ y2 [n] 6= y1 [n − n0 ]
2n−2n
X0
y1 [n − n0 ] = x1 [k]
k=−∞
and y[n] → ∞ as n → ∞.
iv. dx(t)
y(t) =
dt
The derivative of x(t) can be expressed as
5. We find the output signals for the given input signals and h[n] = αn u[n], where α ∈ C, as follows:
∞
X ∞
X ∞
X 1
y1 [n] = h[n] ∗ x1 [n] = x1 [n − k] h[k] = αk u[k] = αk = , if |α| < 1
1−α
k=−∞ k=−∞ k=0
∞ ∞ n
(n + 1) u[n], α=1
X X X
k k
y2 [n] = x2 [n − k] h[k] = u[n − k] α u[k] = u[n] α = n+1
k=−∞ k=−∞ k=0 1 − α
u[n], α 6= 1
1−α
∞
X ∞
X −1
X
n−k
y3 [n] = x3 [k] h[n − k] = u[−k − 1] α u[n − k] = αn−k u[n − k]
k=−∞ k=−∞ k=−∞
This summation is bounded only for |α| < 1, and it can be computed separately for n < −1 and
n > −1, since u[n − k] is nonzero only when k 6 n.
n ∞
X X 1
α n−k `,n−k
= α `
= , n < −1 and |α| < 1
−1
1−α
X k=−∞ `=0
y3 [n] = αn−k u[n − k] = −1 ∞
X `,−k−1
X αn+1
k=−∞
α n−k
= α n+`+1
= , n > −1 and |α| < 1
1−α
k=−∞ `=0
As x3 [n] = x1 [n] − x2 [n], we have y3 [n] = y1 [n] − y2 [n] owing to the distributive property of LTI
systems shown below.
y3 [n] = h[n] ∗ x3 [n] = h[n] ∗ (x1 [n] − x2 [n]) = h[n] ∗ x1 [n] − h[n] ∗ x2 [n] = y1 [n] − y2 [n]
1
, n < 0 and |α| < 1
1−α
y3 [n] = y1 [n] − y2 [n] =
αn+1
, n > 0 and |α| < 1
1−α
1
n+1 , n < −1 and |α| < 1
α 1 1−α
= =⇒ y3 [n] = y1 [n] − y2 [n] =
1 − α 1−α
αn+1
n=−1 , n > −1 and |α| < 1
1−α
(
6. i. 1, 1 6 n 6 5
x1 [n] = x2 [n] =
0, otherwise
∞
X 5
X
n − 1, 1<n66
y[n] = x1 [n] ∗ x2 [n] = x1 [k] x2 [n − k] = x2 [n − k] = 11 − n, 6 < n 6 10
k=−∞ k=1 0, otherwise
1
0
0 2 4 6 8 10 12
0
0 2 4 6 8 10 12
0
0 2 4 6 8 10 12
To verify our result x1 [n] ∗ x2 [n] in MATLAB, the sample code is given below.
x = @ ( n ) (n >=1 & n <=5)*1; % x [ n ]=1 if 1 <=n <=5 , x [ n ]=0 otherwise
nx = 0:6; % sample index for x1 and x2
ny = 2* min ( nx ):2* max ( nx ); % sample index for the convolution
% obtain x1 and x2
xOne = x ( nx );
xTwo = x ( nx );
% compute the convolution of x1 and x2 by using ’ conv ’ function
y = conv ( xOne , xTwo );
subplot (212); % x2
stem ( nx , xTwo , ’ filled ’ , ’ LineWidth ’ ,2);
set ( gca , ’ XLim ’ ,[ min ( ny ) max ( ny )] , ’ YTick ’ ,[0 1])
xlabel ( ’ $$n$$ ’ , ’ Interpreter ’ , ’ latex ’ );
ylabel ( ’ $$x_2 [ n ] $$ ’ , ’ Interpreter ’ , ’ latex ’)
figure (2); % y
stem ( ny ,y , ’ filled ’ , ’ LineWidth ’ ,2);
title ( ’ The convolution of $$x_1 [ n ] $$ and $$x_2 [ n ] $$ ’ , ...
’ Interpreter ’ , ’ latex ’ );
xlabel ( ’ $$n$$ ’ , ’ Interpreter ’ , ’ latex ’ );
ylabel ( ’ $$y [ n ] $$ ’ , ’ Interpreter ’ , ’ latex ’)
ii. Assuming x1 [n] = 0 for n 6 0 and n > N1 , and x2 [n] = 0 for n 6 0 and n > N2 , we can use
the MATLAB code given below to compute the convolution of x1 [n] and x2 [n].
function [y , ny ] = ee301hw1q6partii ( xOne , xTwo )
% get the length of each input signal
NOne = length ( xOne );
NTwo = length ( xTwo );
% get the sample index for the convolution of the input signals
ny = 2:( NOne + NTwo );
( (
iii. n, 1 6 n 6 20 11 − n, 1 6 n 6 10
x1 [n] = x2 [n] =
0, otherwise 0, otherwise
20
10
0
5 10 15 20 25 30
10
0
5 10 15 20 25 30
1000
500
0
5 10 15 20 25 30
% obtain x1 and x2
% x1 [ n ]= n if 1 <=n <=20 , x1 [ n ]=0 otherwise
xOne = nxOne ;
% x2 [ n ]=11 - n if 1 <=n <=10 , x2 [ n ]=0 otherwise
xTwo = 11 - nxTwo ;
subplot (212); % x2
stem ( nxTwo , xTwo , ’ filled ’ , ’ LineWidth ’ ,2);
set ( gca , ’ XLim ’ ,[ nMin nMax ])
xlabel ( ’ $$n$$ ’ , ’ Interpreter ’ , ’ latex ’ );
ylabel ( ’ $$x_2 [ n ] $$ ’ , ’ Interpreter ’ , ’ latex ’)
figure (2); % y
stem ( ny ,y , ’ filled ’ , ’ LineWidth ’ ,2);
set ( gca , ’ XLim ’ ,[ nMin nMax ])
title ( ’ The convolution of $$x_1 [ n ] $$ and $$x_2 [ n ] $$ ’ , ...
’ Interpreter ’ , ’ latex ’ );
xlabel ( ’ $$n$$ ’ , ’ Interpreter ’ , ’ latex ’ );
ylabel ( ’ $$y [ n ] $$ ’ , ’ Interpreter ’ , ’ latex ’)
iv. x1 [n − 4] ∗ x2 [n + 5] = (x1 [n] ∗ δ[n − 4]) ∗ (x2 [n] ∗ δ[n + 5])
= (x1 [n] ∗ x2 [n]) ∗ (δ[n − 4] ∗ δ[n + 5])
| {z } | {z }
y[n] from part (iii) δ[n+1]
= y[n + 1]
Using commutative After running the code given in part (iii), we use the following lines in
MATLAB to obtain the desired result.
figure (2); % y
stem ( ny -1 ,y , ’ filled ’ , ’ LineWidth ’ ,2);
set ( gca , ’ XLim ’ ,[ nMin nMax ])
title ( ’ The convolution of $$x_1 [n -4] $$ and $$x_2 [ n +5] $$ ’ , ...
’ Interpreter ’ , ’ latex ’ );
xlabel ( ’ $$n$$ ’ , ’ Interpreter ’ , ’ latex ’ );
ylabel ( ’ $$y [ n ] $$ ’ , ’ Interpreter ’ , ’ latex ’)
1000
500
0
5 10 15 20 25 30