MAE143A Signals & Systems - Homework 1, Winter 2015
— due by the end of class Friday January 23, 2014.
Question 1 — Scaling and shifting signals
The support of a function of time, f (t), is the set of time values for which the function has non-zero
value. Graph the following functions over their entire support, where that support is finite. Otherwise
just graph them over a sensible range. Then use matlab to confirm that your answers are correct.
i) f (t) = 1(t) − 1(t − 3).
ii) f (t) = −4 ramp(t) 1(t − 2).
iii) f (t) = 6 rect(t/4) tri(2t − 1).
2
iv) f (t) = sinc2 (t) = sint t .
v) f (t) = −4 ramp(5t) rect[(t − 2)/2].
[Hint: It helps to use matlab functions such as myOne.m, myTri.m, myRamp.m etc from the
website and to enhance this set with your own mySinc.m, myRect.m.]
i)
(
1, 0 ≤ t ≤ 3
f (t) = 1(t) − 1(t − 3) =
0, else
Matlab plot: Part(i)
1
0.9
0.8
Signal (units)
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
0.5
1
1.5
2
Time (units)
2.5
3
Figure 1: Part (i): manual sketch and matlab plot.
3.5
4
ii)
(
−4t, t ≥ 2
f (t) = −4 ramp(t)1(t − 2) =
0,
else
Matlab plot: Part(ii)
0
-2
-4
Signal (units)
-6
-8
-10
-12
-14
-16
0
0.5
1
1.5
2
Time (units)
2.5
3
3.5
4
Figure 2: Part (ii): manual sketch and matlab plot.
iii) Consider individual parts of the function first
6, −2 < t < 2
6 rect(t/4) = 3, t = ±2
0, else
0 < t < 1/2
2t,
tri(2t − 1) = 2 − 2t, 1/2 < t < 1
0,
else
So then
0 < t < 1/2
12t,
f (t) = 6 rect(t/4) tri(2t − 1) = 12 − 12t, 1/2 < t < 1
0,
else
iv) Following class notes, we have limt→0 sinc2 (t) = 1. Compute some values of f (t) at various
values of t and sketch the graph manually.
v)
(
−20t,
−4 ramp(5t) =
0,
t>0
else
Matlab plot: Part(iii)
6
5
Signal (units)
4
3
2
1
0
-1
-0.5
0
0.5
Time (units)
1
1.5
2
Figure 3: Part (iii): manual sketch and matlab plot.
Matlab plot: Part(iv)
1
0.9
0.8
Signal (units)
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-8
-6
-4
-2
0
Time (units)
2
4
6
Figure 4: Part (iv): manual sketch and matlab plot.
1<t<3
1,
rect[(t − 2)/2] = 1/2, t ∈ {1, 3}
0,
else
0,
t < 1 or t > 3
−20t, 1 < t < 3
f (t) = −4 ramp(5t) rect[(t − 2)/2] =
−10, t = 1
−30, t = 3
Question 2 – Periodic signals and power
[Chaparro 1.10 revised]
8
Matlab plot: Part(v)
0
-10
Signal (units)
-20
-30
-40
-50
-60
0
0.5
1
1.5
2
Time (units)
2.5
3
3.5
4
Figure 5: Part (v): manual sketch and matlab plot.
i) Determine the period, T0 , of x(t). Compute the power, Px , of x(t) and verify that the power
Px is the sum of the power P1 of the signal x1 (t) = cos(2πt) and the power P2 of the signal
x2 (t) = 2 cos(πt). [In this case, because the signal frequencies are integer multiples of the same
base frequency, they are said to be harmonically related.]
ii) Next consider the signal γ(t) = cos(t) + cos(πt), where the frequencies are not harmonically
related. Determine whether γ(t) is periodic. Write down the integral for the power Pγ and use it
to show that Pγ = P1 + P2 , where P1 and P2 are the powers for each of the signal components.
iii) [Bonus] Can you explain the subjective difference between the periodic signal property that
Px = P1 + P2 and the non-periodic signal property that Pγ = P1 + P2 ?
[Answers: (i) T0 =2 sec, Px = 2.5, (ii) γ(t) is not periodic.]
Part (i): x1 (t) has period T1 = 2π/2π = 1s. x2 (t) has period T2 = 2π/π = 2s. x(t) is periodic
because T2 /T1 = 2 is rational. The period of x(t) is T0 = 2T1 = 1T2 = 2s.
Z T0
1
Px =
x2 (t)dt.
T0 0
x2 (t) = cos2 (2πt) + 4 cos2 (πt) + 4 cos(2πt) cos(πt)
= 2.5 + 2 cos(πt) + 2 cos(2πt) + 2 cos(3πt) +
1
cos(4πt),
2
and so Px = 2.5
RT
R1
Now P1 = T11 0 1 x21 (t)dt = 0 21 + 12 cos(4πt)dt = 0.5 and similarly P2 = 2. So then Px = P1 + P2 .
Part (ii): T1 /T2 = 2π/2 = π which is irrational. So, γ(t) is aperiodic.
1
Pγ = lim
T →∞ 2T
Z
T
cos2 (t) + cos2 (πt) + 2 cos(t) cos(πt) dt
−T
Z T
1
= P1 + P2 + lim
cos[(1 + π)t] + cos[(1 − π)t]dt
T →∞ 2T −T
sin[(1 + π)]T
= P 1 + P2 .
= P1 + P2 + lim
T →∞
(1 + π)T
Part (iii): The average power is defined as the average of the instantaneous power, x2 (t), over the
whole time axis
To compute the power of the periodic signal we note that x2 (t) is also a periodic signal comprised
of components of period 2 seconds: 2.5 + 2 cos(πt) + 2 cos(2πt) + 2 cos(3πt) + 21 cos(4πt). So the
average power over the whole time is the same as the average power over one period.
For the non-periodic signal, γ 2 (t) is also non-periodic and we need to compute the average power
over the entire time axis and not just over one period.
Question 3 – Analog system properties
[Chaparro 2.8] An analog system has the following input-output relation.
Z t
e−(t−τ ) x(τ ) dτ , t ≥ 0,
γ(t) =
0
0,
else.
The input is x(t) and the output is γ(t).
i) Is the system LTI (linear time-invariant)? If so, can you determine the impulse response of
the system? [If you can, try to do this by observation ... after we study convolution in class.]
Explain.
ii) Is the system causal? Explain.
iii) Find the unit step response of the system and from it determine the impulse response. Is this a
BIBO stable system? Explain.
iv) Find the response due to a pulse x(t) = 1(t) − 1(t − 1).
[Answers: Yes, LTI with h(t) = e−t 1(t); causal and BIBO stable.]
Part (i): Check linearity: let x(t) = a1 x1 (t) + a2 x2 (t). The output with input x(t) for t ≥ 0 is
Z t
e−(t−τ ) [a1 x1 (τ ) + a2 x2 (τ )]dτ
γ(t) =
0
Z t
Z t
−(t−τ )
= a1
e
x1 (τ )dτ + a2
e−(t−τ ) x2 (τ )dτ = a1 γ1 (t) + a2 γ2 (t),
0
0
where γ1 (t) and γ2 (t) are outputs due to x1 (t) and x2 (t) respectively. And so, the system is linear.
Rt
Check time-invariance: let the output due to input x(t − t0 ) be γ 0 (t) = 0 e−(t−τ ) x(τ − t0 )dτ . The
R t−t
system is time-invariant if γ 0 (t) = γ(t − t0 ) = 0 0 e−(t−t0 −τ ) x(τ )dτ . Let t1 = τ − t0 . We have
Z t−t0
Z 0
−(t−t1 −t0 )
0
e−(t−t1 −t0 ) x(t1 )dt1
e
x(t1 )dt1 +
γ (t) =
0
−t0
Z t−t0
e−(t−t1 −t0 ) x(t1 )dt1 because the system has 0 output for t < 0
=0+
0
= γ(t − t0 ),
and we have time-invariance. In conclusion, the system is LTI.
Rt
The impulse response can be determined by h(t) = 0− e−(t−τ ) δ(τ )dτ = e−t 1(t). Alternatively, by
observation, this equation is the convolution of e−t and δ(t) and we get the same result.
Part (ii): Because the system is LTI, and its impulse response is h(t) = e−t 1(t) = 0 for t < 0, the
system is causal.
Part (iii): Unit step response
Z t
Z t
−(t−τ )
s(t) =
e
u(τ )dτ =
e−(t−τ ) dτ = 1 − e−t for t < 0
0
0
The impulse response is the derivative of the step response.
So for t >R 0, h(t) = e−t and so,
R
∞
∞
h(t) = e−t 1(t) for all t. The system is BIBO stable because −∞ h(t)dt = 0 e−t dt = 1 < ∞.
Part (iv): The response of the system to input x(t) can be computed by the convolution y(t) =
h(t) ∗ x(t). Here we keep h(t) fixed and moving x(t) from left to right. The result is
Z 1
Z t
−τ
y(t) = 0 +
e dτ +
e−τ dτ = (e − 1)(e−t + e−1 ).
0
t−1
Question 4 — AM envelope detector
[Chaparro 2.28 revised] Consider an envelope detector that is used to detect the message sent in
an AM (Amplitude Modulated) radio system. The envelope detector is a system of two cascaded
systems: one which computes the absolute value of the input signal (this is called a rectifier) and a
second that low-pass filters its input (a low-pass filter like the RC circuit). We shall implement this in
matlab .
Let the input signal (which is the information we are sending over the AM radio) be
x(t) = [p(t) + P ] cos(Ω0 t),
with
p(t) = 10[1(t) − 1(t − 40)] − 10[1(t − 40) − 1(t − 60)],
Ω0 = 2π c /sec,
P = 1.1 × |min(p(t)| .
Here the signal p(t) should be considered our message.
i) Generate a time base, t in matlab , of 0 ≤ t ≤ 100 sampled every Ts = 0.01. Generate the
corresponding signal values for p(t) and x(t).
ii) Consider the subsystem which computes the absolute value of the input x(t). Call this new
rectified signal γ(t) or vector gamma in matlab .
iii) Generate a continuous-time low-pass system with the matlab command
>> sys = tf(1, [1 0.8])
and pass your rectified signal γ(t) through this system.
>> w = lsim(sys,gamma,t);
iv) Plot: message p(t), modulated signal x(t), rectified signal γ(t), and recovered signal z(t) =
w(t) − P . Does z(t) looks like p(t)?
v) [Bonus] Repeat this process with message signal p(t) = 2 cos(0.2πt), Ω0 = 10π, and P =
| min(p(t))|. Scale the signal to get the original p(t).
Part (iv): The recovered signal z(t) is a periodic representation of the message signal p(t). It greatly
resembles p(t) in shape with an offset in magnitude.
Part (v): The recovered signal z(t) is scaled by subtracting its mean and multiplying by a factor to
be similar to the original message p(t). The result is plotted in Figure 8. However, there is a delay in
z(t) due to the phase in the low pass filter.
matlab code for Question 4:
t = [0:0.01:100]’;
n = length(t);
omega = 2*pi;
Message p(t)
8
20
6
15
4
10
2
5
0
-2
0
-5
-4
-10
-6
-15
-8
-20
-10
Modulated signal x(t)
25
Signal (units)
Signal (units)
10
0
10
20
30
40
50
60
70
80
90
100
-25
Time (sec)
0
10
20
30
50
60
70
80
90
100
Time (sec)
Rectified signal . (t)
25
40
Recovered signal z(t)
8
6
20
4
15
Signal (units)
Signal (units)
2
10
0
-2
-4
-6
5
-8
-10
0
0
10
20
30
40
50
60
Time (sec)
70
80
90
100
-12
0
10
20
30
40
50
60
70
80
90
100
Time (sec)
Figure 6: Message, modulated, rectified and recovered AM signals for Part (iv).
pt = 10*(myOne(t) - myOne(t-40)) - 10*(myOne(t-40) - myOne(t-60));
P = 1.1*abs(min(pt));
xt = zeros(n,1);
gamma = zeros(n,1);
for i = 1:n
xt(i) = (pt(i)+P)*cos(omega*t(i));
end
gamma = abs(xt);
sys = tf(1, [1 0.8]);
w = lsim(sys,gamma,t);
zt = w - P;
figure(1);plot(t,pt);
title(’Message p(t)’);
Message p(t) - Part(v)
2
3
1.5
2
1
1
Signal (units)
Signal (units)
0.5
0
0
-1
-0.5
-2
-1
-3
-1.5
-2
Modulated signal x(t) - Part(v)
4
-4
0
10
20
30
40
50
60
70
80
90
100
0
10
20
30
40
Rectified signal . (t) - Part(v)
4
50
60
70
80
90
100
Time (sec)
Time (sec)
Recovered signal z(t) - Part(v)
1
3.5
0.5
3
0
Signal (units)
Signal (units)
2.5
2
-0.5
1.5
-1
1
-1.5
0.5
0
0
10
20
30
40
50
60
70
80
90
100
-2
0
10
20
30
Time (sec)
40
50
60
70
80
Time (sec)
Figure 7: Message, modulated, rectified and recovered AM signals for Part (v).
xlabel(’Time (sec)’);ylabel(’Signal (units)’);
figure(2);plot(t,xt);
title(’Modulated signal x(t)’)
xlabel(’Time (sec)’);ylabel(’Signal (units)’);
figure(3);plot(t,gamma);
title(’Rectified signal \gamma(t)’)
xlabel(’Time (sec)’);ylabel(’Signal (units)’);
figure(4);plot(t,zt);
title(’Recovered signal z(t)’)
xlabel(’Time (sec)’);ylabel(’Signal (units)’);
clear pt omega P xt gamma zt w
90
100
Original signal p(t) and recovered signal z(t) scaled to look like p(t) - Part(v)
2
1.5
1
Signal (units)
0.5
0
-0.5
-1
-1.5
-2
Original message
Recovered signal
-2.5
0
10
20
30
40
50
60
70
80
90
100
Time (sec)
Figure 8: Part (v): Recovered signal scaled to resemble the original message p(t).
pt = 2*cos(.2*pi*t);
omega = 10*pi;
P = abs(min(pt));
xt = zeros(n,1);
gamma = zeros(n,1);
for i = 1:n
xt(i) = (pt(i)+P)*cos(omega*t(i));
end
gamma = abs(xt);
w = lsim(sys,gamma,t);
zt = w - P;
figure(5);plot(t,pt);
title(’Message p(t) - Part(v)’)
xlabel(’Time (sec)’);ylabel(’Signal (units)’);
figure(6);plot(t,xt);
title(’Modulated signal x(t) - Part(v)’)
xlabel(’Time (sec)’);ylabel(’Signal (units)’);
figure(7);plot(t,gamma);
title(’Rectified signal \gamma(t) - Part(v)’)
xlabel(’Time (sec)’);ylabel(’Signal (units)’);
figure(8);plot(t,zt);
title(’Recovered signal z(t) - Part(v)’)
xlabel(’Time (sec)’);ylabel(’Signal (units)’);
zt = zt - mean(zt);
zt = zt*2/max(zt);
figure(9);plot(t,[pt zt]);
title(’Original signal p(t) and recovered signal z(t) scaled to look like p(
xlabel(’Time (sec)’);ylabel(’Signal (units)’);
legend(’Original message’,’Recovered signal’)
© Copyright 2026 Paperzz