Uploaded by 정우박

Solution Manual for SIGNALS AND SYSTEMS USING MATLAB Luis F. Chaparro

advertisement
Solution Manual for
SIGNALS AND SYSTEMS
USING MATLAB
Luis F. Chaparro
Copyright 2014, Elsevier, Inc. All rights reserved.
Chapter 0
From the Ground Up
0.1
0.1
Basic Problems
(a)
i. Re(z) + Im(v) = 8
ii. |z + v| = |17 + j1| =
iii. |zv| = |72
1
v. |v/z| = |v|/|z| =
(b)
i.
ii.
iii.
iv.
v.
p
172 + 1
j16 + j27 + 6| = |78 + j11| =
iv. \z + \v = tan
vi. \(v/z) =
2=6
(3/8)
p
tan
1
p
782 + 112
(2/9)
p
85/ 73
(2/9) tan 1 (3/8)
p
1
z + v = 17 + j = 172 + 1ej tan (1/17)
p
1
zv = 78 + j11 = 782 + 112 ej tan (11/78)
p
p
1
z ⇤ = 8 j3 = 64 + 9(e j tan (3/8) )⇤ = 73ej tan
zz ⇤ = |z|2 = 73
p
1
z v = 1 + j5 = 1 + 25e j tan (5)
tan
1
1
1
(3/8)
Chaparro — Signals and Systems using MATLAB
0.2
(a) z = 6ej⇡/4 = 6 cos(⇡/4) + j6 sin(⇡/4)
p
i. Re(z) = 6 cos(⇡/4) = 3 2
p
ii. Im(z) = 6 sin(⇡/4) = 3 2
(b)
i.
ii.
iii.
iv.
Yes, Re(z) = 0.5(z + z ⇤ ) = 0.5(2Re(z)) = Re(z) = 8
Yes, Im(v) = 0.5j(v v ⇤ ) = 0.5j(2jIm(v)) = Im(v) = 2
Yes, Re(z + v ⇤ ) = Re(Re(z) + Re(v ⇤ ) + Im(z) Im(v)) = Re(z + v) = 17
Yes, Im(z + v ⇤ ) = Im(17 + j5) = Im(z v) = Im( 9 + j5) = 5
Copyright 2014, Elsevier, Inc. All rights reserved.
0.2
Chaparro — Signals and Systems using MATLAB
0.3
0.3 (a) Representing the complex number z = x + jy = |z|ej✓ then |x| = |z|| cos(✓)| and since | cos(✓)|  1
then |x|  |z|, the equality holds when ✓ = 0 or when z = x, i.e., it is real.
(b) Adding two complex numbers is equivalent to adding two vectors to create a triangle with two sides
the two vectors being added and the other side the vector resulting from the addition. Unless the two
vector being added have the same angle, in which case |z| + |v| = |z + v|, it holds that |z| + |v| > |z + v|.
⇥z + ⇥v
v
z
Figure 1: Addition of two vectors illustrating the triangular inequality.
(c) The answer to both is yes. Indeed,
p
p
p
(a) |z + v| = 13  |z| + |v| = 2 + 5
p
p
(b) |z v| = | 1| = 1  |z| + |v| = 2 + 5
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.4
0.4
(a) We have
i. cos(✓ ⇡/2) = 0.5(ej(✓ ⇡/2) + e j(✓ ⇡/2) ) = j0.5(ej✓ e j✓ ) = sin(✓)
ii. sin(✓ ⇡/2) = 0.5j(ej(✓ ⇡/2) e j(✓ ⇡/2) ) = 0.5j( j)(ej✓ + e j✓ ) = cos(✓)
iii. sin(✓ + ⇡/2) = (jej✓ + je j✓ )/(2j) = cos(✓)
(b)
i. cos(2⇡t) sin(2⇡t) = (1/4j)(ej4⇡t
Z
e
1
cos(2⇡t) sin(2⇡t)dt =
0
j4⇡t
) so that
1 ej4⇡t 1
1 e j4⇡t 1
|0 +
| =0+0=0
4j 4⇡j
4j 4⇡j 0
ii. We have
1 j4⇡t
1
(e
+ 2 + e j4⇡t ) = (1 + cos(4⇡t))
4
2
so that its integral is 1/2 since the integral of cos(4⇡t) is over two of its periods and it is zero.
cos2 (2⇡t) =
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.5
(a)
0.5
i. 2 cos(↵ + ) = ej(↵+ ) + e j(↵+ ) = (ej↵ ej ) + (ej↵ ej )⇤ = 2Re(ej↵ ej ) and
Re[ej↵ ej ] = Re[(cos(↵) + j sin(↵))(cos( ) + j sin( ))] = cos(↵) cos( ) sin(↵) sin( )
so that
cos(↵ + ) = cos(↵) cos( ) sin(↵) sin( )
ii. 2j sin(↵ + ) = ej↵ ej
(ej↵ ej )⇤ = 2jIm[ej↵ ej ], and the imaginary is
sin(↵) cos( ) + cos(↵) sin( ) = sin(↵ + )
(b)
also
Z
Z
1
ej2⇡t dt =
0
1
ej2⇡t dt =
0
Z
ej2⇡t 1
ej2⇡ 1
|0 =
=0
j2⇡
j2⇡
1
cos(2⇡t)dt + j
0
since the integrals of the sinusoids are over a period.
(c)
Z
1
sin(2⇡t)dt = 0 + j0
0
i. Yes, ( 1)n = (ej⇡ )n = ejn⇡ = cos(n⇡) + j sin(n⇡) = cos(n⇡) since sin(n⇡) = 0 for any
integer n.
ii. Yes, ej0 = ej⇡ and ej⇡/2 = ej3⇡/2 so they add to zero.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.6
0.6 (a) Using Euler’s identity the product
ej↵ ej
=
(cos(↵) + j sin(↵))(cos( ) + j sin( ))
=
[cos(↵) cos( )
sin(↵) sin( )] + j[sin(↵) cos( ) + cos(↵) sin( )]
while
ej(↵+
)
= cos(↵ + ) + j sin(↵ + )
so that equating the real and imaginary parts of the above two equations we get the desired trigonometric
identities.
(b) We have
cos(↵) cos( )
=
0.5(ej↵ + e
j(↵+ )
j↵
) 0.5(ej + e
+e
j(↵+ )
j
)
) + 0.25(ej(↵
=
0.25(e
=
0.5 cos(↵ + ) + 0.5 cos(↵
)
+e
j(↵
)
)
)
Now,
sin(↵) sin( )
=
cos(↵
=
0.5 cos(↵
=
0.5 cos(↵ +
=
⇡/2) cos(
⇡/2 +
⇡/2)
⇡/2) + 0.5 cos(↵
⇡) + 0.5 cos(↵
0.5 cos(↵ + ) + 0.5 cos(↵
)
)
Copyright 2014, Elsevier, Inc. All rights reserved.
⇡/2
+ ⇡/2)
Chaparro — Signals and Systems using MATLAB
0.7 (a) Replacing zk = |↵|1/N ej( +2⇡k)/N in z N we get zkN = |↵|ej(
of k = 0, · · · , N 1.
(b) Applying the above result we have:
0.7
+2⇡k)
= |↵|ej(
)
= ↵ for any value
• For z 2 = 1 = 1ej2⇡ the roots are zk = 1ej(2⇡+2⇡k)/2 , k = 0, 1. When k = 0, z0 = ej⇡ =
z1 = ej2⇡ = 1.
1 and
• When z 2 = 1 = 1ej⇡ the roots are zk = 1ej(⇡+2⇡k)/2 , k = 0, 1. When k = 0, z0 = ej⇡/2 = j,
and z1 = ej3⇡/2 = j.
• For z 3 = 1 = 1ej2⇡ the roots are zk = 1ej(2⇡+2⇡k)/3 , k = 0, 1, 2. When k = 0, z0 = ej2⇡/3 ; for
k = 1, z1 = ej4⇡/3 = e j2⇡/3 = z0⇤ ; and for k = 2, z2 = 1ej(2⇡) = 1.
• When z 3 = 1 = 1ej⇡ the roots are zk = 1ej(⇡+2⇡k)/3 , k = 0, 1, 2. When k = 0, z0 = ej⇡/3 ; for
k = 1, z1 = ej⇡ = 1; and for k = 2, z2 = 1ej(5⇡)/3 = 1ej( ⇡)/3 = z0⇤
(c) Notice that the roots are equally spaced around a circle of radius r and that the complex roots appear
as pairs of complex conjugate roots.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.8
0.8
(a) We have
i. z 3 = 1 = ej⇡(2k+1) for k = 0, 1, 2, so roots are zk = ej⇡(2k+1)/3 , k = 0, 1, 2, i.e., on a
circle of unit radius and separated ⇡/3 with one at 1.
ii. z 2 = 1 = ej2⇡k for k = 0, ±1, ±2, · · · , so roots are zk = ej⇡k =, i.e., on a circle of unit
radius and separated ⇡ , one at zero and the other at 1
p
iii. z 2 + 3z + 1 = (z + 1.5)2 + (1 1.52 ) = 0 so the roots are z1,2 = ± (1.52 1) 1.5
(b) The log (using the Naperian base) of a product is the sum of the logs of the terms in the product,
and the log and the exponential are the opposite of each other so the last term in the equation.
Using the given expression for the log of a complex number (log of real numbers is a special case):
log( 2) = log(2e±j⇡ ) = log(2) ± j⇡
p
p
log(1 + j1) = log( 2ej⇡/4 ) = log( 2) + j⇡/4 = 0.5 log(2) + j⇡/4
log(2ej⇡/4 ) = log(2) + j⇡/4
(c) z =
1 = 1ej⇡ thus
i. log(z) = log(1ej⇡ ) = log(1) + j⇡ = j⇡
ii. From above result, elog(z) = ej⇡ = 1
(d)
i. z 2 /4 = (2ej⇡/4 )2 /4 = 4ej⇡/2 /4 = j
ii. Yes, (cos(⇡/4)+j sin(⇡/4))2 = (z/2)2 , and (z/2)2 = (cos(⇡/4)+j sin(⇡/4))2 = cos(⇡/2)+
j sin(⇡/2) = j
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.9
0.9 (a) If w = ez then
log(w) = z = 1 + j1
given that the log and e functions are the inverse of each other.
The real and imaginary of w are
w = ez = e1 ej1 = e cos(1) +j
e sin(1)
| {z }
| {z }
real part
imaginary part
(b) The imaginary parts are cancelled and the real parts added twice in
w + w⇤ = 2Re[w] = 2e cos(1)
(c) Replacing z
w = ez = e1 ej1
so that |w| = e and \w = 1.
Using the result in (a)
(d) According to Euler’s equation
| log(w)|2 = |z|2 = 2
j
cos(1) = 0.5(e + e
j
) = 0.5
✓
w w⇤
+
e
e
◆
which can be verified using w + w⇤ obtained above.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.10
0.10
(a) Shifting to the right a cosine by a fourth of its period we get a sinusoid, thus
sin(⌦0 t) = cos(⌦0 (t
T0 /4)) = cos(⌦0 t
⌦0 T0 /4) = cos(⌦0 t
⇡/2)
since ⌦0 = 2⇡/T0 or ⌦0 T0 = 2⇡.
(b) The phasor that generates a sine is Ae
j⇡/2
j⇡/2 j⌦0 t
y(t) = Re[Ae
e
since
] = Re[Aej(⌦0 t
⇡/2)
] = A cos(⌦0 t
⇡/2)
which equals A sin(⌦0 t).
(c) The phasors corresponding to
y(t) =
A sin(⌦0 t) =
x(t) =
A cos(⌦0 t
A cos(⌦0 t) = A cos(⌦0 t + ⇡) is Aej⇡ . For
⇡/2) = A cos(⌦0 t
⇡/2 + ⇡) = A cos(⌦0 t + ⇡/2)
the phasor is Aej⇡/2 . Thus, relating any sinusoid to the corresponding cosine, the magnitude and
angle of this cosine gives the magnitude and phase of the phasor that generates the given sinusoid.
(d) If z(t) = x(t) + y(t) = A cos(⌦0 t) + A sin(⌦0 t), the phasor corresponding to z(t) is the sum
of the phasors Aej0 , corresponding
to A cos(⌦0 t), with the phasor Ae j⇡/2 , corresponding to
p
j⇡/4
A sin(⌦0 t), which gives 2Ae
(equivalently the sum of a vector with length A and angle 0
with another vector of length A and angle ⇡/2). We have that
hp
i p
z(t) = Re 2Ae j⇡/4 ej⌦0 t = 2A cos(⌦0 t ⇡/4)
(e)
i. Phasor 4ej⇡/3
ii. 4 sin(2t + ⇡/3) = 4 cos(2t + ⇡/3 + ⇡/2) with phasor 4ej5⇡/6
iii. We have
4 cos(2t + ⇡/3)
4 sin(2t + ⇡/3)
=
=
=
p
so that the phasor is 4 2ej7⇡/12
Re[(4ej⇡/3 + 4ej(⇡/2+⇡/3) )ej2t ]
Re[4ej⇡/3 (1 + ej⇡/2 ) ej2t ]
| {z }
p
Re[4 2e
p
2ej⇡/4
j7⇡/12 j2t
Copyright 2014, Elsevier, Inc. All rights reserved.
e
]
Chaparro — Signals and Systems using MATLAB
0.11
0.11 (a) Assuming a maximum frequency of 22.05 kHz for the acoustic signal, the numbers of bytes (8 bits
per byte) for two channels (stereo) and a 75 minutes recording is greater or equal to: 2 ⇥ 22, 050
samples/channel/second ⇥ 2 bytes/sample ⇥ 2 channels ⇥ 75 minutes ⇥ 60 seconds/minute = 7.938 ⇥
108 bytes. Multiplying by 8 we get the number of bits. CD quality means that the signal is sampled at
44.1 kHz and each sample is represented by 16 bits or 2 bytes.
(b) The raw data would consist of 8 (bits/sample) ⇥10, 000 (samples/sec)=80, 000 bits/sec. The vocoder
is part of a larger unit called a digital signal processor chip set. It uses various procedures to reduce the
number of bits that are transmitted while still keeping your voice recognizable. When there is silence it
does not transmit, letting another signal use the channel during pauses.
(c) Texting between cell phones is possible by sending short messages (160 characters) using the short
message services (SMS). Whenever your cell-phone communicates with the cell phone tower there is an
exchange of messages over the control channel for localization, and call setup. This channel provides
a pathway for SMS messages by sending packets of data. Except for the cost of storing messages, the
procedure is rather inexpensive and convenient to users.
(d) For CD audio the sampling rate is 44.1 kHz with 16 bits/sample. For DVD audio the sampling rate is
192 kHz with 24 bits/sample. The sampling process requires getting rid of high frequencies in the signal,
also each sample is only approximated by the binary representation, so analog recording could sound
better in some cases.
(e) The number of pixels processed every second is: 352 ⇥ 240 pixels/frame ⇥60 frames/sec.
The number of bits available for transmission every second is obtained by multiplying the above answer
by 8 bits/pixel. There many compression methods JPEG, MPEG, etc.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.12 (a) If ↵ = 1 then
S=
N
X1
n=0
(b) The expression
S(1
↵)
0.12
1 = 1 + 1 + ··· + 1 = N
|
{z
}
N times
=
S
=
(1 + ↵ + · · · + ↵N
=
1
↵S
↵
N
1
)
(↵ + ↵2 + · · · + ↵N
1
+ ↵N )
as the intermediate terms cancel. So that
S=
1 ↵N
, ↵ 6= 1
1 ↵
Since we do not want the denominator 1 ↵ to be zero, the above requires that ↵ 6= 1. If ↵ = 1 the sum
was found in (a). As a finite sum, it exists for any finite values of ↵.
Putting (a) and (b) together we have
⇢
(1 ↵N )/(1 ↵) ↵ 6= 1
S=
N
↵=1
(c) If N is infinite, the sum is of infinite length and we need to impose the condition that |↵| < 1 so that
↵n decays as n ! 1. In that case, the term ↵N ! 0 as N ! 1, and the sum is
S=
1
1
↵
|↵| < 1
If |↵| 1 this sum does not exist, i.e., it becomes infinite.
(d) The derivative becomes
1
X
dS
1
S1 =
=
n↵n 1 =
.
d↵ n=0
(1 ↵)2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.2
0.13
Problems using MATLAB
0.13 As we will see later, the sampling period of x(t) with a frequency of ⌦max = 2⇡fmax = 2⇡ should
satisfy the Nyquist sampling condition
fs =
1
Ts
2fmax = 2 samples/sec
so Ts  1/2 (sec/sample). Thus when Ts = 0.1 the continuous-time and the discrete-time signals look
very much like each other, indicating the signals have the same information — such a statement will be
justified in the chapter on sampling where we will show that the continuous-time signal can be recovered
from the sampled signal. It is clear that when Ts = 1 the information is lost. Although it is not clear
from the figure that when we let Ts = 0.5 the discrete-time signal keeps the information, this sampling
period satisfies the Nyquist sampling condition and as such the original signal can be recovered from the
sampled signal. The following MATLAB script is used.
% Pr. 0._13
clear all; clf
T=3; Tss= 0.0001; t=[0:Tss:T];
xa=4*cos(2*pi*t); % continuous-time signal
xamin=min(xa);xamax=max(xa);
figure(1)
subplot(221)
plot(t,xa); grid
title(’Continuous-time Signal’); ylabel(’x(t)’);
axis([0 T 1.5*xamin 1.5*xamax])
N=length(t);
xlabel(’t sec’)
for k=1:3,
if k==1,Ts= 0.1; subplot(222)
t1=[0:Ts:T]; n=1:Ts/Tss: N; xd=zeros(1,N); xd(n)=4*cos(2*pi*t1);
plot(t,xa); hold on; stem(t,xd);grid;hold off
axis([0 T 1.5*xamin 1.5*xamax]); ylabel(’x(0.1 n)’); xlabel(’t’)
elseif k==2, Ts=0.5; subplot(223)
t2=[0:Ts:T]; n=1:Ts/Tss: N; xd=zeros(1,N); xd(n)=4*cos(2*pi*t2);
plot(t,xa); hold on; stem(t,xd); grid; hold off
axis([0 T 1.5*xamin 1.5*xamax]); ylabel(’x(0.5 n)’); xlabel(’t’)
else,Ts=1; subplot(224)
t3=[0:Ts:T]; n=1:Ts/Tss: N; xd=zeros(1,N); xd(n)=4*cos(2*pi*t3);
plot(t,xa); hold on; stem(t,xd); grid; hold off
axis([0 T 1.5*xamin 1.5*xamax]); ylabel(’x(n)’); xlabel(’t’)
end
end
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
Analog Signal
6
6
4
4
2
2
x(0.1 n)
x(t)
0.14
0
−2
−4
−6
0
−2
−4
0
1
2
−6
3
0
1
6
6
4
4
2
2
0
−2
−4
−4
0
1
2
t
3
2
3
0
−2
−6
2
t
x(n)
x(0.5 n)
t sec
3
−6
0
1
t
Figure 2: Problem 13: Analog continuous-time signal (top left); continuous-time and discrete-time signals
superposed for Ts = 0.1 sec (top right) and Ts = 0.5 sec and Ts = 1 sec (bottom left to right).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.15
0.14 The derivative is
y(t) =
dx(t)
=
dt
8⇡ sin(2⇡t)
which has the same frequency as x(t), thus the sampling period should be like in the previous problem,
Ts  0.5.
% Pr. 0_14
clear all
% actual derivative
Tss=0.0001;t1=0:Tss:3;
y=-8*pi*sin(2*pi*t1);
figure(2)
% forward difference
Ts=0.01;t=[0:Ts:3];N=length(t);
subplot(211)
xa=4*cos(2*pi*t); % sampled signal
der1_x=forwardiff(xa,Ts,t,y,t1);
clear der1_x
% forward difference
Ts=0.1;t=[0:Ts:3];N=length(t);
subplot(212)
xa=4*cos(2*pi*t); % sampled signal
der1_x=forwardiff(xa,Ts,t,y,t1);
The function forwardiff computes and plots the forward difference and the actual derivative.
function der=forwardiff(xa,Ts,t,y,t1)
% % forward difference
% % xa: sampled signal using Ts
% % y: actual derivative defined in t
N=length(t);n=0:N-2;
der=diff(xa)/Ts;
stem(n*Ts,der,’filled’);grid;xlabel(’t, nT_s’)
hold on
plot(t1,y,’r’); legend(’forward difference’,’derivative’)
hold off
For Ts = 0.1 the finite difference looks like the actual derivative but shifted, while for Ts = 0.01 it does
not.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.16
40
forward difference
derivative
20
0
−20
−40
0
0.5
1
1.5
t, nTs
2
2.5
3
40
forward difference
derivative
20
0
−20
−40
0
0.5
1
1.5
t, nTs
2
2.5
3
Figure 3: Problem 14: Ts = 0.01 sec (top) and Ts = 0.1 sec (bottom)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.17
0.15 (a) The backward finite difference (let Ts = 1 for simplicity)
1 [x(n)]
is connected with the forward finite difference
1 [x(n
= x(n)
x(n
1)
[x(n)] given in the chapter as follows
+ 1)] = x(n + 1)
x(n) =
[x(n)]
That is, [x(n)] is 1 [x(n)] shifted one sample to the left.
(b) (c) The average of the two finite differences gives
0.5 {
1 [x(n)]
+
[x(n)]} = 0.5[x(n + 1)
x(n
1)]
which gives a better approximation to the derivative than either of the given finite differences. The
following script is used to compute 1 and the average.
% Pr. 0_15
% compares forward/backward differences
% with new average difference
Ts=0.1;
for k=0:N-2,
x1=4*cos(2*pi*(k-1)*Ts);
x2=4*cos(2*pi*k*Ts);
der_x(k+1)=x2-x1; % backward difference
end
der_x=der_x/Ts;
Tss=0.0001;t1=0:Tss:3;
y=-8*pi*sin(2*pi*t1); % actual derivative
n=0:N-2;
figure(3)
subplot(211)
stem(n*Ts,der_x,’k’);grid
hold on
stem(n*Ts,der1_x,’b’,’filled’) % derv1_x forward difference
% from Pr. 0.2
hold on
plot(t1,y,’r’); xlabel(’t, nT_s’)
legend(’bck diff’,’forwd diff’, ’derivative’)
hold off
subplot(212)
stem(n*Ts,0.5*(der_x+der1_x));grid;xlabel(’t, nT_s’) % average
hold on
plot(t1,y,’r’)
hold off
legend(’average diff’,’derivative’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.18
30
bck diff
forwd diff
derivative
20
10
0
−10
−20
−30
0
0.5
1
1.5
t, nTs
2
2.5
3
30
average diff
derivative
20
10
0
−10
−20
−30
0
0.5
1
1.5
t, nTs
2
2.5
3
Figure 4: Problem 15: Comparison of different finite differences.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.19
0.16 (a) According to Kirchoff’s current law
is (t) = iR (t) + iL (t) =
vL (t)
+ iL (t)
R
but vL (t) = LdiL (t)/dt so that the ordinary differential equation relating the input is (t) to the output
current in the inductor iL (t) is
diL (t)
+ iL (t) = is (t)
dt
after replacing L = 1 and R = 1. Notice that this d.e. is the dual of the one given in the Chapter, so that
the difference equation is
iL (nTs ) =
Ts
[is (nTs ) + is ((n
2 + Ts
1)Ts )] +
2 Ts
iL ((n
2 + Ts
1)Ts )
n
1
iL (0) = 0
cos(1/2 π t)
is(t),iL(t)
1
0.5
0
1
input current
output current
filter gain
0.5
0
0
10
20
30
40
50
t
60
70
80
90
100
is(t),iL(t)
1
−0.5
−1
input current
output current
filter gain
0
0
10
20
30
40
50
t
60
70
80
90
100
80
90
100
2
−...+2 (2 cos(1/2 π t)+π sin(1/2 π t))/(4+π )
1
−1
0
10
20
30
40
50
t
60
70
80
90
100
0.5
is(t),iL(t)
1
input current
output current
filter gain
0
0
−0.5
−1
0
10
20
30
40
50
t
60
70
80
90
100
−1
0
10
20
30
40
50
t
60
70
Figure 5: Problem 16: Left (top to bottom): solution of difference equation for ⌦0 = 0.005, 0.05, 0.5
(rad/sec). Right: input (top), solution of ordinary differential equation (bottom).
(b)(c) The scripts to solve the difference and ordinary differential equations are the following.
% Pr. 0_16
clear all
% solution of difference equation
Ts=0.01;
t=[0:Ts:100];
figure(4)
for k=0:2;
if k==0, subplot(311)
elseif k==1, subplot(312)
else, subplot(313)
end
W0= 0.005*10ˆk*pi; % frequency of source
is=cos(W0*t); % source
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.20
a=[1 (-2+Ts)/(2+Ts)]; % coefficients of i_L(n), i_L(n-1)
b=[Ts/(2+Ts) Ts/(2+Ts)]; % coefficients of i_s(n), i_s(n-1)
il=filter(b,a,is); % current in inductor computed by
% MATLAB function ’filter’
H=1/sqrt(1+W0ˆ2)*ones(1,length(t)); % filter gain at W0
plot(t,is,t,il,’r’,t,H,’g’); xlabel(’t’); ylabel(’i_s(t),i_L(t)’)
axis([0 100 1.1*min(is) 1.1*max(is)])
legend(’input current’,’output current’,’filter gain’); grid
pause(0.1)
end
%%%%
% solution of ordinary differential equation for cosine input of frequency
clear all
syms t x y
x=cos(0.5*pi*t);
y=dsolve(’Dy+y=cos(0.5*pi*t)’,’y(0)=0’,’t’)
figure(5)
subplot(211)
ezplot(x,[0 100]);grid
subplot(212)
ezplot(y,[0 100]);grid
axis([0 100 -1 1])
Copyright 2014, Elsevier, Inc. All rights reserved.
0.5pi
Chaparro — Signals and Systems using MATLAB
0.21
0.17 (a) The distributive and the associative laws are equivalent to the ones for integrals, indeed
X
X
cak = c(· · · + a 1 + a0 + a1 + · · · ) = c
ak
k
k
since c does not depend on k. Likewise
X
[ak + bk ] = (· · · + a 1 + b
1
k
+ a 0 + b0 + a 1 + b 1 · · · ) =
X
ak +
k
X
bk
k
Finally, when adding a set of numbers the order in which they are added does not change the result. For
instance,
a0 + a1 + a2 + a3 = a0 + a2 + a1 + a3
PN
(b) Gauss’ trick can be shown in general as follows. Let S = k=0 k then
2S =
N
X
k+
k=0
letting ` =
0
X
k
k=N
k + N in the second summation we have
2S =
N
X
k=0
k+
N
X
(N
`) =
`=0
N
X
(k + N
k) = N
k=0
N
X
1 = N (N + 1)
k=0
where we let the dummy variables of the two sums be equal. We thus have that for N = 104
S=
N (N + 1)
104 (104 + 1)
=
⇡ 0.5 ⇥ 108
2
2
(c) Using the above properties of the sum,
S1
=
N
X
(↵ + k) = ↵
k=0
=
↵(N + 1) +
N
X
1+
k=0
N (N + 1)
2
N
X
k
k=0
(d) The following script computes numerically and symbolically the various sums.
% Pr. 0_17
clear all
% numeric
N=100;
S1=[0:1:N];
S2=[N:-1:0];
S=sum(S1+S2)/2
% symbolic
syms S1 N alpha beta k
simple(symsum(alpha+beta*k,0,N))
% computing sum for specific values of alpha, beta and N
subs(symsum(alpha+beta*k,0,N),{alpha,beta,N},{1,1,100})
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
S = 5050
((2*alpha + N*beta)*(N + 1))/2
5151
The answers shown at the bottom.
Copyright 2014, Elsevier, Inc. All rights reserved.
0.22
Chaparro — Signals and Systems using MATLAB
0.23
0.18 (a) The following figure shows the upper and lower bounds when approximating the integral of t:
1
x(t) = t
upper bound
0.75
0.5
lower bound
0.25
0
0.25
0.5
0.75
t
1
Figure 6: Problem 18: Upper and lower bounds of the integral of t when N = 4.
(b) (c) The lower bound for the integral is
S`
=
N
X1
(nTs )Ts = Ts2
n=1
=
Ts2

N
X1
n = Ts2
n=1
(N
1)(N
2
2)
N
X2
(` + 1)
`=0
+ (N
1)
The definite integral is
Z
1
tdt =
0
1
2
The upper bound is
Su
=
N
X
(nTs )Ts = S` + N Ts2
n=1
Letting N Ts = 1, or Ts = 1/N we have then that


(N 1)(N 2) + 2(N 1)
1
(N


2N 2
2
1)(N
2) + 2(N
2N 2
for large N the upper and the lower bound tend to 1/2.
The following script computes the lower and upper bound of the integral of t.
% Pr. 0_18
clear all
Ts=0.001;N=1/Ts;
% integral of t from 0 to 1 is 0.5
syms S1 n T k
% lower bound
n=subs(N);T=subs(Ts);
y=simple(symsum(k*Tˆ2,1,n-1));
yy=subs(y)
Copyright 2014, Elsevier, Inc. All rights reserved.
1)
+
1
N
Chaparro — Signals and Systems using MATLAB
0.24
% upper bound
z=simple(symsum(k*Tˆ2,1,n));
zz=subs(z)
% average
int= 0.5*(yy+zz)
giving the following results (the actual integral is 1/2).
yy = 0.4995
zz = 0.5005
int = 0.5000
(d) For y(t) = t2 , 0  t  1, the following script computes the upper and the lower bounds and their
average:
%% integral of tˆ2 from 0 to 1 is 0.333
% lower bound
y1=simple(symsum(kˆ2*Tˆ3,1,n-1));
yy1=subs(y1)
% upper bound
z1=simple(symsum(kˆ2*Tˆ3,1,n));
zz1=subs(z1)
% average
int= 0.5*(yy1+zz1)
giving the following results, in this case the value of the definite integral is 1/3.
yy1 = 0.3328
zz1 = 0.3338
int =
0.3333
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.25
0.19 The indefinite integral equals 0.5t2 . Computing it in [0, 1] gives the same value as the sum of the integrals
computed between [0, 0.5] and [0.5, 1].
As seen before, the sum
S=
100
X
n=0
while
n=
100(101)
= 5050
2
S1 = S + 50 = 5100
S2 = S
the first sum has an extra term when n = 50 while the other does not. To verify this use the following
script:
% Pr. 0_19
clear all
N=100;
syms n,N
S=symsum(n,0,N)
S1=symsum(n,0,N/2)+symsum(n,N/2,N)
S2=symsum(n,0,N/2)+symsum(n,N/2+1,N)
giving
S = 5050
S1 = 5100
S2 = 5050
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.26
0.20 (a)(b) We have that
↵t
0<e
for ↵ >
t
<e
0.
% Pr. 0_20
clear all
% compare two exponentials
t=[0:0.001:10];
x=exp(-0.5*t);
x1=exp(-1*t);
figure(6)
plot(t,x,t,x1,’r’);
legend(’Exponential Signal, a=-0.5’,’Exponential Signal, a=-1’)
grid
axis([0 10 0 1.1 ]); xlabel(’time’)
Exponential Signal, a=−0.5
Exponential Signal, a=−1
1
0.8
0.6
0.4
0.2
0
0
1
2
3
4
5
time
6
Figure 7: Problem 20: Comparison of exponentials e
7
8
0.5t
9
10
and e
t
for t
(c) Sampling x(t) = eat using Ts = 1, we get
x(t)|t=n = ean = ↵n
where ↵ = ea > 0
(d) The voltage in the capacitor is given by
vc (t) =
Z
1
C
t
e
0.5⌧
d⌧ + vc (0)
0
with a initial voltage vc (0) = 0. Letting C = 1, we have
vc (t) =
e
0.5⌧
0.5
|t0 = 2(1
e
0.5t
)
so that at t = 1 the voltage in the capacitor is vc (1) = 2 2e 0.5 = 0.79.
(e) Letting N Ts = 1, the definite integral is approximated, from below, by
N
X1
Ts e
0.5(n+1)Ts
n=0
Copyright 2014, Elsevier, Inc. All rights reserved.
0 and 0 otherwise.
Chaparro — Signals and Systems using MATLAB
if we let ↵ = e
0.5Ts
0.27
the above sum becomes
Ts
N
X1
↵n+1 = Ts ↵
n=0
1 ↵N
1 ↵
which is computed using the following script:
% compute value of Int (the integral)
N=1000;Ts=1/N;alpha=exp(- 0.5*Ts);
Int=Ts*alpha*(1-alphaˆN)/(1-alpha)
Int =
0.7867
approximating the analytic result found above.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.28
0.21 (a) The point (1,1) in the two-dimensional plane corresponds to z = 1 + j. The magnitude and phase are
p
p
|z| = 1 + 1 = 2
\z = tan
1
(1) = ⇡/4
(b) For the other complex numbers:
|w| =
p
p
2, \w = ⇡
⇡/4 = 3⇡/4
2, \v = ⇡ + ⇡/4 = 5⇡/4
p
|u| = 2, \u = ⇡/4
|v| =
The sum of these complex numbers
z+w+v+u=0
(c) The ratios
p j⇡/4
z
1+j
2e
=
=p
= 1e j⇡/2 = j
w
1+j
2ej3⇡/4
p j3⇡/4
w
1+j
2e
=
=p
= 1e j⇡/2 = j
v
1 j
2ej5⇡/4
p
u
1 j
2e j⇡/4
=
= p
= 1e j⇡/2 = j
z
1+j
2ej⇡/4
Also, multiplying numerator and denominator by the by the conjugate of the denominator we get the
above results. For instance,
z
1+j
(1 + j)( 1
=
=
w
1+j
2
j)
1
=
j
j2
j
2
=
and similarly for the others. Using these ratios we have
u
u
z
= ⇥ = ( j)( j) =
w
z
w
(d) y = 10
6
= j10
6
= 10
6
1.
z so that
|y| = 10
6
\y = ⇡/4
|z| = 10
6
Although the magnitude of y is negligible, its phase is equal to that of z.
The results are verified by the following script:
% Pr. 0_21
z=1+j; w=-1+j; v=-1-j;u=1-j;
figure(1)
compass(1,1)
hold on
compass(-1,1,’r’)
hold on
compass(-1,-1,’k’)
Copyright 2014, Elsevier, Inc. All rights reserved.
2j
=
2
j
Chaparro — Signals and Systems using MATLAB
0.29
hold on
compass(1,-1,’g’)
hold off
% part (a)
abs(z)
angle(z)
% part (b)
abs(w)
angle(w)
abs(v)
angle(v)
abs(u)
angle(u)
r=z+w+v+u
%part (c)
r1=z/w
r2=w/v
r3=u/z
r4=u/z
r5=u/w
figure(2)
compass(real(r1),imag(r1))
hold on
compass(real(r2),imag(r2),’r’)
hold on
compass(real(r3),imag(r3),’k’)
hold on
compass(real(r4),imag(r4),’g’)
hold on
compass(real(r5),imag(r5),’b’)
hold off
% part (c)
z
y=z*1e-16
abs(y)
angle(y)/pi
90
90
1.5
120
1
120
60
60
0.8
1
0.6
150
150
30
30
0.4
0.5
0.2
180
0
330
210
300
240
270
180
0
330
210
300
240
270
Figure 8: Problem 21: Results of complex calculations in parts (a) z, w, v, u and (b) z/w, w/v, u/z, z/w
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.30
0.22 (a)(b) Since
x(t) = (1 + jt)2 = 1 + j2t + j 2 t2 = 1 t2 +j |{z}
2t
| {z }
imag.
real
its derivative with respect to t is
y(t) =
dx(t)
=
dt
2t + 2j =
dRe[x(t)]
dIm[x(t)]
+j
dt
dt
% Pr. 0_22
clear all
t=[-5: 0.001:5];
x=(1+j*t).ˆ2;
xr=real(x);
xi=imag(x);
figure(7)
subplot(211)
plot(t,xr); title(’Real part of x(t)’); grid
subplot(212)
plot(t,xi); title(’Imaginary part of x(t)’); xlabel(’Time’); grid
% Warning when plotting complex signals
figure(8)
disp(’Read warning. MATLAB is being nice with you, this time!’)
plot(t,x); title(’COMPLEX Signal x(t)?’); xlabel(’Time’)
When plotting the complex function x(t) as function of t, MATLAB ignores the imaginary part. One
should not plot complex functions as functions of time as the results are not clear when using MATLAB.
See Fig. 9 for plots.
(c) Using the rectangular expression of x(t) we have
Z
1
x(t)dt =
0
Z
1
t2 + 2jt)dt =
(1
0
Z
1
(1
t2 )dt + 2j
0
Z
1
t dt = t
0
t3
2t2
+j
3
2
1
0
=
2
+ j1
3
=
2
3
(d) The integral
Z
1
⇤
x (t)dt =
0
Z
1
(1
0
t
2
2jt)dt =
Z
1
(1
0
2
t )dt
2j
Z
1
t dt = t
0
t3
3
j
2t2
2
1
0
which is the complex conjugate of the integral calculated in (c). So yes, the expression is true.
Copyright 2014, Elsevier, Inc. All rights reserved.
j1
Chaparro — Signals and Systems using MATLAB
Real part of x(t)
5
0.31
COMPLEX Signal x(t)?
5
0
−5
0
−10
−15
−5
−20
−25
−5
−4
−3
−2
−1
0
1
2
3
4
5
−10
Imaginary part of x(t)
10
−15
5
0
−20
−5
−10
−5
−4
−3
−2
−1
0
Time
1
2
3
4
5
−25
−5
−4
−3
−2
−1
0
Time
1
2
3
4
5
Figure 9: Problem 22: Real and imaginary parts of x(t) (left); complex signal x(t) ignoring imaginary part.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.32
0.23 (a) Using Euler’s identity
ej⇡n = cos(⇡n) + j sin(⇡n) = cos(⇡n) = ( 1)n
so it is a real signal.
ej⇤n
1
···
1
0
3
2
···
n
1
Figure 10: Problem 23: The complex exponential ej⇡n = cos(⇡n) which is real.
(b) Replacing the sines by exponentials we have
sin(↵) sin( )
=
=
=
=
1 j↵
(e
e j↵ )(ej
e j )
4
1 h j(↵+ )
e
+ e j(↵+ ) ej(↵ )
4
1
[2 cos(↵ + ) 2 cos(↵
)]
4
1
[cos(↵
) cos(↵ + )]
2
ej(
↵+ )
i
(c) Similarly
cos(↵) sin( )
=
=
=
=
1 j↵
(e + e j↵ )(ej
e j )
4j
1 h j(↵+ )
e
e j(↵+ ) ej(↵ ) + ej(
4j
1
[2j sin(↵ + ) 2j sin(↵
)]
4j
1
[sin(↵ + ) sin(↵
)]
2
↵+ )
i
If ↵ = then cos(↵) sin(↵) = (1/2) sin(2↵) since sin(0) = 0. We have that T0 = 2 is the period of
sin(⇡t), cos(⇡t) as well as sin(2⇡t) (indeed, sin(2⇡(t + 2)) = sin(2⇡t + 4⇡) = sin(2⇡t)), therefore the
integral
Z T0
Z 2
sin(⇡t) cos(⇡t)dt = 0.5
sin(2⇡t)dt
= 0.
0
|0
{z
}
area under two periods of sin(2⇡t)
Thus sin(⇡t) and cos(⇡t) are orthogonal.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
0.24
cos(j✓) =
0.33
1
(e
2
✓
+ e✓ ) = cosh(✓)
(b) The hyperbolic sine is defined as
sinh(✓) =
1 ✓
(e
2
e
✓
)
which is connected with the circular sine as follows
sin(j✓) =
1
(e
2j
✓
e✓ ) = j sinh(✓) ) sinh(✓) =
j sin(j✓)
(c) Since e±✓ > 0 then cosh(✓) = cosh( ✓) > 0, the smallest value is for ✓ = 0 which gives cosh(0) =
1
(d) Indeed,
1
sinh( ✓) = (e ✓ e✓ ) = sinh(✓)
2
1/2 exp(θ)+1/2 exp(−θ)
6000
5000
4000
3000
2000
1000
0
−10
−8
−6
−4
−2
0
θ
2
4
6
8
10
4
6
8
10
1/2 exp(θ)−1/2 exp(−θ)
2000
1000
0
−1000
−2000
−10
−8
−6
−4
−2
0
θ
2
Figure 11: Problem 24: cosh(✓) (top) and sinh(✓) (bottom).
% Pr. 0_24
clear all
theta=sym(’theta’);
x= 0.5*(exp(-theta)+exp(theta));
y= 0.5*(exp(theta)-exp(-theta));
figure(9)
subplot(211)
ezplot(x,[-10,10])
grid
subplot(212)
ezplot(y,[-10,10])
grid
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
Copyright 2014, Elsevier, Inc. All rights reserved.
0.34
Chapter 1
Continuous–time Signals
1.1
Basic Problems
1.1 Notice that 0.5[x(t) + x( t)], the even component of x(t), is discontinuous at t = 0, it is 1 at t = 0 but
0.5 at t ± ✏ for ✏ ! 0. Likewise the odd component of x(t), or 0.5[x(t) x( t)], must be zero at t = 0
so that when added to the even component one gets x(t).
z(t) equals x(t). See Fig. 1.
x(t)
x(t
x(t + 1)
1)
1
1
t
1
1
t
1
0.5[x(t) + x( t)]
x( t)
1
1
1
0.5[x(t)
t
1
t
2
1
x( t)]
0.5
1
1
t
0
t
1
0.5
x(2t)
x(0.5t)
y(t)
1
1
(1)
0.5
t
2
t
1
Figure 1.1: Problem 1
1
1
t
Chaparro — Signals and Systems using MATLAB
1.2
1.2 (a) If x(t) = t for 0  t  1, then x(t + 1) is x(t) advanced by 1, i.e., shifted to the left by 1 so that
x(0) = 0 occurs at t = 1 and x(1) = 1 occurs at t = 0.
x(t + 1)
x(t)
1
0
1
t
x( t + 1)
x( t)
1
1
0
t
0
1
1
1
t
t
0
1
2
Figure 1.2: Problem 2: Original signal x(t), shifted versions x(t + 1), x( t) and x( t + 1).
The signal x( t) is the reversal of x(t) and x( t+1) would be x( t) advanced to the right by 1. Indeed,
t
x( t + 1)
1
x(0)
0
1
x(1)
x(2)
The sum y(t) = x(t + 1) + x( t + 1) is such that at t = 0 it is y(0) = 2; y(t) = x(t + 1) for t < 0; and
y(t) = x( t + 1) for t > 0. Thus,
y(t) = x(t + 1) = t + 1
y(0) = 2
y(t) = x( t + 1) =
0  t + 1 < 1 or
t+1
0
1 t<0
t + 1 < 1 or 0 < t  1
or
8
< t+1
2
y(t) =
:
t+1
1t<0
t=0
0<t1
(b) Except for the discontinuity at t = 0, y(t) looks like the even triangle signal ⇤(t), their integrals are
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.3
y(t)
2
1
1
t
Figure 1.3: Problem 2: Triangular signal y(t) with discontinuity at the origin.
identical as the discontinuity of y(t) does not add any area.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.3
1.4
(a) We have that
i. x(t) is causal because it is zero for t < 0. It is neither even nor odd.
ii. Yes, the even component of x(t) is
xe (t)
=
0.5[x( t) + x(t)]
=
0.5[et u( t) + e t u(t)] = 0.5e
(b) x(t) = cos(t) + j sin(t) is a complex signal, xe (t) = 0.5[ejt + e
jt
|t|
] = cos(t) so xo (t) = j sin(t).
(c) The product of the even signal x(t) with the sine, which is odd, gives an odd signal and because of
this symmetry the integral is zero.
(d) Yes, because x(t) + x( t) = 2xe (t), i.e., twice the even component of x(t), and multiplied by the
sine it is an odd function.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.4 The signal x(t) = t[u(t)
1.5
1)] so that its reflection is
u(t
v(t) = x( t) =
t[u( t)
u( t
1)]
u( (t
2)
1)]
t)[u(t
1)
and delaying v(t) by 2 is
y(t)
=
v(t
2) =
(t
2)[u( (t
=
( t + 2)[u( t + 2)
2))
u( t + 1)] = (2
u(t
2)]
On the other hand, the delaying of x(t) by 2 gives
w(t) = x(t
2) = (t
2)[u(t
2)
u(t
2)[u( t
2)
u( t
3)]
which when reflected gives
z(t) = w( t) = ( t
3)]
Comparing y(t) and z(t) we can see that these operations do not commute, that the order in which these
operations are done cannot be changed, so that y(t) 6= z(t) as shown in Fig. 1.4.
v(t)
y(t)
1
1
1
1
1
t
2
t
w(t)
1
1
2
3
t
3
2
1
z(t)
t
Figure 1.4: Problem 4: Reflection and delaying do not commute, y(t) 6= z(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.5
1.6
(a) x(t) is called causal because it is zero for t < 0, it repeats every 0.5 sec. for t
0.
x(t)
1
xe (t)
0.5
0.5
···
0.5
xo (t)
0.5
0.5
0.5
···
0.5
···
1
···
1
···
1
0.5
Figure 1.5: Problem 5.
(b) Even component xe (t) = 0.5[x(t) + x( t)] is periodic of fundamental period Te = 0.5. The odd
component is xo (t) = 0.5[x(t) x( t)] is not periodic.
(c) xe (t) and xo (t) are non-causal signals as they are different from zero for negative times.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.6
1.7
(a) Using ⌦0 = 2⇡f0 = 2⇡/T0 for
i. cos(2⇡t): ⌦0 = 2⇡ rad/sec, f0 = 1 Hz and T0 = 1 sec.
ii. sin(t ⇡/4): ⌦0 = 1 rad/sec, f0 = 1/(2⇡) Hz and T0 = 2⇡ sec.
iii. tan(⇡t) = sin(⇡t)/ cos(⇡t): ⌦0 = ⇡ rad/sec, f0 = 1/2 Hz and T0 = 2 sec.
(b) The fundamental period of sin(t) is T0 = 2⇡, and T1 = 2⇡/3 is the fundamental period of sin(3t),
T1 /T0 = 1/3 so 3T1 = T0 = 2⇡ is the fundamental period of z(t).
(c)
i. y(t) is periodic of fundamental period T0 = 1.
ii. w(t) = x(2t) is x(t) compressed by a factor of 2 so its fundamental period is T0 /2 = 1/2, the
fundamental period of z(t).
iii. v(t) has same fundamental period as x(t), T0 = 1, indeed v(t + kT0 ) = 1/x(t + kT0 ) =
1/x(t).
(d)
i. x(t) = 2 cos(t), ⌦0 = 2⇡f0 = 1 so f0 = 1/(2⇡)
ii. y(t) = 3 cos(2⇡t + ⇡/4), ⌦0 = 2⇡f0 = 2⇡ so f0 = 1
iii. c(t) = 1/ cos(t), of fundamental period T0 = 2⇡, so f0 = 1/(2⇡).
(e) ze (t) is periodic of fundamental period T0 , indeed
ze (t + T0 )
Same for zo (t) since zo (t) = z(t)
=
0.5[z(t + T0 ) + z( t
=
0.5[z(t) + z( t)]
T0 ))]
ze (t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.7
(a)
1.8
i. x(t) = cos(t + ⇡/4), ⌦0 = 1 = 2⇡/T0 so T0 = 2⇡,
x(t + kT0 ) = cos(t + k2⇡ + ⇡/4) = x(t)
ii. y(t) = 2 + sin(2⇡t), ⌦0 = 2⇡, T0 = 1
y(t + kT0 ) = 2 + sin(2⇡t + 2⇡k) = y(t)
iii. z(t) = 1 + (cos(t)/ sin(3t)), T0 = 2⇡ fundamental period of cosine, T1 = 2⇡/3 fundamental
period of the sine, then T0 /T1 = 3 or T0 = 3T1 = 2⇡ is the fundamental period of z(t),
z(t + 2⇡k) = 1 +
(b)
cos(t + 2⇡k)
= z(t)
sin(3t + 6⇡k)
i. z1 (t) is periodic of period 10T0 , indeed
z1 (t + 10T0 )
=
x1 (t + 10T0 ) + 2y1 (t + 10T0 )
=
x1 (t) + 2y1 (t)
ii. v1 (t) is periodic of fundamental period 10T0 as
v1 (t + 10T0 ) =
x1 (t + 10T0 )
x1 (t)
=
y1 (t + 10T0 )
y1 (t)
iii. w1 (t) is periodic of fundamental period T0 , since y1 (10T0 ) is compressed by a factor of 10 so
its fundamental period is T0 the same as x1 (t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.8
1.9
(a) x(t) is a causal decaying exponential with energy
Z 1
Ex =
e
2t
dt =
0
and zero power as
Px = lim
T !1
1
2
Ex
=0
2T
(b)
Ez =
(c)
Z
1
e
2|t|
dt = 2
1
Z
|
1
0
e 2t dt
{z }
E z1
i. If y(t) = sign[x1 (t)], it has the same fundamental period as x1 (t), i.e., T0 = 1 and y(t) is a
train of pulses so its energy is infinite, while
Z 1
Py =
1 dt = 1
0
ii. Since x2 (t) = cos(2⇡t ⇡/2) = cos(2⇡(t
x2 (t) coincide with those of x1 (t).
1/4), the energy and power of
1/4)) = x1 (t
(d) v(t) = x1 (t) + x2 (t) is periodic of fundamental period T0 = 2⇡, and its power is
Z 2⇡
Z 2⇡
1
1
Pv =
(cos(t) + cos(2t))2 dt =
(cos2 (t) + cos2 (2t) + 2 cos(t) cos(2t))dt
2⇡ 0
2⇡ 0
Using
1 1
+ cos(2✓)
2 2
1
cos(✓) cos( ) = (cos(✓ + ) + cos(✓
2
cos2 (✓) =
))
we have
Pv
=
=
1
2⇡
|
Z
2⇡
0
1
cos2 (t)dt +
2⇡
{z
} |
Px 1
1 1
+ +0=1
2 2
Z
2⇡
0
1
cos2 (2t)dt +
2⇡
{z
} |
Z
2⇡
0
Px 2
2 cos(t) cos(2t))dt
{z
}
(e) Power of x(t)
Px
=
=
=
1
T0
Z 1
Z
Z
T0
x2 (t)dt
0
cos2 (2⇡t)dt
0
1
(1/2 + cos2 (4⇡t)dt = 0.5 + 0 = 0.5
0
Copyright 2014, Elsevier, Inc. All rights reserved.
0
Chaparro — Signals and Systems using MATLAB
1.10
Power of f (t)
Pf
=
=
=
1
lim
T !1 2T
Z
T
y 2 (t)dt
T
Z N T0
1
y 2 (t)dt
N !1 2(N T0 ) 0
Z T0
1
y 2 (t)dt = 0.5Ps
2T0 0
lim
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.11
1.9 This problem can be done in the time domain or in the phasor domain. The series connection of the
source vs (t) = cos(t), the resistor R and the inductor L is equivalent to the connection of a phasor
source Vs = 1ej0 , and impedances R and j⌦L = jL (the frequency of the source is ⌦ = 1). The
corresponding to the current across the resistor and the inductor, in steady state, is
I=
Vs
R + jL
(a) L = 1, R = 0 —intuitively, the power used by the inductor is zero since only the resistor uses power.
R
Vs = 1ej0
+
I
_
jL
Figure 1.6: Problem 9: Phasor circuit.
In this case, the current i(t) has a phasor
I=
1
=
j
j = 1e
j⇡/2
so that the current across the inductor in steady state is given by
i(t) = cos(t
⇡/2)
We can compute the average power Pa in time by finding the instantaneous power as
p(t) = i(t)vs (t) = cos(t
⇡/2) cos(t) =
1
(cos(⇡/2) + cos(2t
2
⇡/2))
so that
Pa
=
=
1
T0
1
2⇡
Z
T0
p(t)dt
0
Z
2⇡
0
1
[cos(⇡/2) + cos(2t
2
since cos(⇡/2) = 0 and the area under cos(2t
⇡/2)]dt = 0
⇡/2) in a period is zero.
You probably remember from Circuits that the average power is computed using the equivalent expression
Vsm Im
Pa =
cos(✓)
2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.12
where Vsm and Im are the peak-to-peak values of the phasors corresponding to Vs and I, and ✓ is the
angle in the impedance of the inductor, i.e, j1 = ej⇡/2 or ✓ = ⇡/2, and the average power is then
Pa = 0.5 cos(⇡/2) = 0
Confirming our intuition!
(b) For L = 1, R = 1, the phasor
p
Vs
2
I=
=
e
1+j
2
j⇡/4
and so in the phasor domain,
Vsm Im
Pa =
cos(⇡/4) =
2
p
2/2 p
1
2/2 =
2
4
(c) L = 0, R = 1, in this case the power used by the resistor will be the power provided by the source.
in this case the phasor for the current across the resistor is
I = Vs = 1ej0 so that i(t) = cos(t)
in the steady state. Thus,
Pa
=
=
1
T0
1
2⇡
Z
T0
p(t)dt
0
Z
2⇡
0
1
[cos(0) + cos(2t)]dt = 0.5
2
In the phasor domain, the average power is
Pa =
2
Vsm
1
cos(0) =
2
2
(d) The complex power supplied to the circuit is given by
P
=
1
1
|I|2 |Z| j✓
Vs I ⇤ = (IZ)I ⇤ =
e
2
2
2
where Z = |Z|ej✓ = R + j⌦L is the input impedance.
Since ⌦ = 1, then for
j so P = 12 ej⇡/2 = 0 + j0.5 and Pa = Re[P ] = 0.
p
• R = 1, p
L = 1, Z = 1p+ j, I = 1/(1 + j) so |I|2 = 1/2, Z = 2, ✓ = ⇡/4 so that P =
0.5(0.5) 2ej⇡/4 = 0.25 2(cos(⇡/4) + j sin(⇡/4)) and Pa = Re[P ] = 0.25.
• R = 0, L = 1, Z = j, I =
• R = 1, L = 0, Z = 1, I = 1 so P = 12 ej0 = 0.5 + j0 and Pa = Re[P ] = 0.5.
The real part of the complex power corresponds to the average power used by the resistors, while the
imaginary part corresponds to the reactive power which is due to inductor and capacitors only.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.13
1.10 (a) Let x(t) = x1 (t) + x2 (t) = cos(2⇡t) + 2 cos(⇡t), so that x1 (t) is a cosine of frequency ⌦1 = 2⇡ or
period T1 = 1, and x2 (t) is a cosine of frequency ⌦2 = ⇡ or period T2 = 2. The ratio of these periods
T2 /T1 = 2/1 is a rational number so x(t) is periodic of fundamental period T0 = 2T1 = T2 = 2.
The average power of x(t) is given by
Z
1
Px =
T0
T0
0
1
x (t)dt =
2
2
Z
2
[x21 (t) + x22 (t) + 2x1 (t)x2 (t)]dt
0
Using the trigonometric identity cos(↵) cos( ) = cos(↵
1
2
Z
2
2x1 (t)x2 (t)dt
=
0
=
1
2
Z
Z
) + cos(↵ + ) we have that the integral
2
4 cos(2⇡t) cos(⇡t)dt
0
2
[cos(⇡t) + cos(3⇡t)]dt = 0
0
since cos(⇡t) + cos(3⇡t) is periodic of period 2 and so its area under a period is zero. Thus,
Px
=
=
=
1
2
Z
2
0
[x21 (t) + x22 (t)]dt
Z
Z 1
1 2 2
1
x1 (t)dt + 2
x2 (t)]dt
2 0
2 0 2
Px 1 + Px 2
so that the power of x(t) equals the sum of the powers of x1 (t) and x2 (t) which are sinusoids of different
frequencies, and thus orthogonal as we will see later.
Finally,
Px
=
=
=
1
2
Z
2
cos2 (2⇡t)dt +
0
Z
1
4 cos2 (⇡t)dt
0
Z
Z 1
1 2
[0.5 + 0.5 cos(4⇡t)]dt +
4[0.5 + 0.5 cos(2⇡t)]dt
2 0
0
0.5 + 2 = 2.5
remembering that the integrals of the cosines are zero (they are periodic of period 0.5 and 1 and the
integrals compute their areas under one or more periods, so they are zero).
(b) The components of y(t) have as periods T1 = 2⇡ and T2 = 2 so that T1 /T2 = ⇡ which is not rational
so y(t) is not periodic. In this case we need to find the power of y(t) by finding the integral over an
infinite support of y 2 (t) which will as before give
Py = Py 1 + Py 2
In the case of harmonically related signals we can use the periodicity and compute one integral. However,
in either case the power superposition holds.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.11
1.14
(a) Yes, expressing ej2⇡t = cos(2⇡t) + j sin(2⇡t), periodic of fundamental period T0 = 1, then the
integral is the area under the cosine and sine in one or more periods (which is zero) when k 6= 0
and integer. If k = 0, the integral is also zero.
(b) Yes, whether t0 = 0 (first equation) or a value different from zero, the two integrals are equal as
the area under a period is the same. In the case x(t) = cos(2⇡t), both integrals are zero.
(c) It is not true, cos(2⇡t) (t
1) = cos(2⇡) (t
1) = (t
1).
(d) It is true, considering x(t) the product of cos(t) and u(t) its derivative is
dx(t)
dt
d cos(t)
du(t)
u(t) + cos(t)
dt
dt
sin(t)u(t) + cos(0) (t)
=
=
(e) Yes,
Z
1
1
⇥
t
e u(t)
⇤
(t
2)d⌧
=
=
Z
e
1
0
2
⇥
e
2
⇤
(t
2)d⌧
(f) Yes,
dx(t)
dt
=
0.5[et u(t) + et (t)] + 0.5[ e t u(t) + e
=
0.5[et
t
(t)]
e t ]u(t) + (t) = sinh(t)u(t) + (t)
(g) The even component xe (t) is a periodic full-wave rectified signal of amplitude 1/2 and fundamental
period T1 = ⇡.
Power of x(t)
 Z ⇡
1
Px = 0.5
x2 (t)dt
⇡ 0
Power of xe (t)
Px e
1
=
⇡
Z
⇡
(0.5x(t))2 dt = 0.5Px
0
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.12
(a) See Fig. 12a
x(t) = |t| [u(t + 2) u(t
|
{z
1.15
2)] Derivative
}
p(t)
x(t)
2
2
t
2
y(t)
1
(2)
t
2
2
1
( 2)
Figure 1.7: Problem 12
y(t) =
dx(t)
= 2 (t + 2)
dt
u(t + 2) + 2u(t)
u(t
2)
(b) Integral
Z
t
y(t0 )dt0
1
which equals x(t).
=
8
>
>
<
>
>
:
0
t
t
0
t< 2
2t<0
0t<2
t 2
(c) Yes, because x(t) is an even function of t.
Copyright 2014, Elsevier, Inc. All rights reserved.
2 (t
2)
Chaparro — Signals and Systems using MATLAB
1.13
1.16
(a) The signal x(t) is
8
0
>
>
<
t+1
x(t) =
1
>
>
:
0
t< 1
1t0
0<t1
t>1
there are discontinuities at t = 0 and at t = 1. The derivative
y(t)
dx(t)
dt
u(t + 1)
=
=
u(t)
2 (t) + (t
indicating the discontinuities at t = 0, a decrease from 1 to
to 0.
1)
1, and at t = 1 an increase from
(b) The integral
Z
Z
t
y(⌧ )d⌧
=
1
t
[u(⌧ + 1)
1
2 (⌧ ) + (⌧
u(⌧ )
1)]d⌧ = x(t)
x(t)
1
1
1
t
1
y(t)
1
(1)
1
( 2)
1
t
Figure 1.8: Problem 13
Copyright 2014, Elsevier, Inc. All rights reserved.
1
Chaparro — Signals and Systems using MATLAB
1.14 (a) x(t),
1.17
1 < t < 1, is a continuous signal and its derivative exists and it is
y(t) =
d cos(⌦0 t)
=
dt
⌦0 sin(⌦0 t)
(b) x1 (t) has a discontinuity at t = 0, and so its derivative will have a (t) function. Indeed, its derivative
is
z(t)
=
d cos(⌦0 t)u(t)
dt
d cos(⌦0 t)
du(t)
u(t) + cos(⌦0 t)
dt
dt
⌦0 sin(⌦0 t)u(t) + cos(⌦0 t) (t)
=
⌦0 sin(⌦0 t)u(t) + cos(0) (t)
=
⌦0 sin(⌦0 t)u(t) + (t)
=
=
(c) The integral of z(t) is zero for t < 0, and
Z
t
1
z(t0 )dt0
=
=
Z
t
⌦0 sin(⌦0 t0 )dt0 +
0
[cos(⌦0 t)
Z
t
(t0 )dt0
0
1] + 1 = cos(⌦0 t)
or cos(⌦0 t)u(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
t>0
Chaparro — Signals and Systems using MATLAB
1.18
1.15 (a) The signal x(t) = t for 0  t  1, zero otherwise. Then
⇢
2t 0  2t  1 or 0  t  1/2
x(2t) =
0
otherwise
that is, the signal has been compressed — instead of being between 0 and 1, it is now between 0 and 0.5.
(b) Likewise, the signal
x(t/2) =
⇢
t/2
0
0  t/2  1 or 0  t  2
otherwise
i.e., the signal has been expanded, its support has doubled.
The following figure illustrates the compressed and expanded signals x(2t) and x(t/2).
x(2t)
x(t/2)
1
1
0.5
1
t
1
2
t
Figure 1.9: Problem 15: Compressed x(2t), expanded x(t/2) signals.
(c) If the acoustic signal is recorded in a tape, we can play it faster (contraction) or slower (expansion)
than the speed at which it was recorded. Thus the signal can be made to last a desired amount of time,
which might be helpful whenever an allocated time is reserved for broadcasting it.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.19
1.16 (a) Because of the discontinuity of x(t) at t = 0 the even component of x(t) is a triangle with xe (0) = 1,
i.e.,
8
< 0.5(1 t) 0 < t  1
0.5(1 + t)
1t<0
xe (t) =
:
1
t=0
while the odd component is
8
0<t1
< 0.5(1 t)
0.5(1 + t)
1t<0
xo (t) =
:
0
t=0
xe (t)
x0 (t)
1
0.5
0.5
1
1
1
1
t
t
0.5
Figure 1.10: Problem 16: Even and odd decomposition of x(t).
(b) The energy of x(t) is
Z 1
x2 (t)dt
=
1
=
Z
Z
1
1
1
1
[xe (t) + xo (t)]2 dt
Z 1
Z
2
2
xe (t)dt +
xo (t)dt + 2
1
1
xe (t)xo (t)dt
1
where the last equation on the right is zero, given that the integrand is odd.
(c) The energy of x(t) = 1
Z
t, 0  t  1 and zero otherwise, is given by
Z 1
1
t3 1
1
2
x (t)dt =
(1 t)2 dt = t t2 +
0 =
3
3
1
0
The energy of the even component is
Z 1
Z 0
Z 1
2
2
xe (t)dt = 0.25
(1 + t) dt + 0.25
(1
1
1
1
1
2
t) dt = 0.5
0
Z
1
(1
t)2 dt
0
where the discontinuity at t = 0 does not change the above result. The energy of the odd component is
Z 1
Z 0
Z 1
Z 1
2
2
2
xo (t)dt = 0.25
(1 + t) dt + 0.25
(1 t) dt = 0.5
(1 t)2 dt
so that
0
Ex = Ex e + Ex o
Copyright 2014, Elsevier, Inc. All rights reserved.
0
Chaparro — Signals and Systems using MATLAB
1.20
1.17 (a) The function g(t) corresponding to the first period of x(t) is given by
g(t) = u(t)
2u(t
1) + u(t
2)
(b) The periodic signal x(t) is
x(t) =
4) + · · ·
1
X
g(t + 2) + g(t + 4) + · · · =
g(t + 2k)
g(t) + g(t
+
2) + g(t
k= 1
(c) Yes, the signals y(t), z(t) and v(t) are periodic of period T0 = 2 as can be easily verified.
(d) The derivative of x(t) is
dx(t)
dt
2
···
···
1
1
t
2
2
Figure 1.11: Problem 17: Derivative of x(t).
w(t) = 2 (t)
2 (t
1) + 2 (t
2) + · · ·
2 (t + 1) + 2 (t + 2) + · · ·
which can be seen to be periodic of period T0 = 2.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.18 (a) ⌦0 = 2⇡ = 2⇡f0 (rad/sec), so f0 = 1/T0 = 1 (Hz) and T0 = 1 sec.
The sum
z(t)
=
x(t) + y(t)
=
(2 cos(2⇡t) + cos(⇡t)) + j(2 sin(2⇡t) + sin(⇡t)
is also periodic of period T1 = 2.
(b) v(t) = x(t)y(t) = 2ej3⇡t with frequency ⌦3 = 3⇡ so that
T3 = 2⇡/⌦3 = 2/3
Copyright 2014, Elsevier, Inc. All rights reserved.
1.21
Chaparro — Signals and Systems using MATLAB
1.22
1.19 (a) The derivative signal y(t) = dx(t)/dt is a train of rectangular pulses. Indeed, if x1 (t) = r(t)
2r(t 0.5) + r(t 1) is the first period of x(t) then
x(t) =
1
X
x1 (t
k)
k= 1
its derivative is
y(t) =
where
(b) The signal x(t)
1
X
dx(t)
dx1 (t k)
=
dt
dt
k= 1
dx1 (t k)
= u(t k) 2u(t 0.5 k) + u(t
dt
0.5 has an average of zero, so its integral
z(t) = lim N
N !1
Z
1
1
(x(t)
0.5)dt = 0
0
(c) Neither is a finite energy signal.
Copyright 2014, Elsevier, Inc. All rights reserved.
k)
Chaparro — Signals and Systems using MATLAB
1.2
1.23
Problems using MATLAB
1.20 The given signal x(t) = e |t| is even, positive and decays to zero as t ! ±1
(a) The signal is finite energy as
Z 1
Z 1
e 2t 1
2
Ex =
x (t)dt = 2
e 2t dt = 2
| =1
2 0
1
0
(b) The signal x(t) is absolutely integrable as
Z 1
Z
|x(t)|dt = 2
1
1
e t dt = 2
0
e
2t
1
|1
0 =2
Notice that 0 < x2 (t) < x(t) and so the knowledge that x(t) is absolutely integrable (i.e., that the above
integral is finite) would imply that x(t) has finite energy (i.e., the integral calculated in (b) is finite).
(c) The energy of y(t) is
Z 1
Z 1
Ey =
e 2t cos2 (2⇡t)dt <
e 2t dt = Ex /2 = 1/2
0
0
since cos2 (2⇡t)  1 (the decaying sinusoid is bounded by the envelope e
2t
u(t)).
% Pr. 1_20
clear all; clf
syms x y t z
x=exp(-abs(t));
% computation of integrals
% for increasing values of time
for k=1:100,
zi=2*int(x,t,0,k/10);
yi=2*int(xˆ2,t,0,k/10);
vi=int((exp(-t)*cos(2*pi*t))ˆ2,0,k/10);
zz(k)=subs(zi);
yy(k)=subs(yi);
vv(k)=subs(vi);
end
t1=[1:100]/10;
figure(1)
subplot(221)
ezplot(x,[-10,10]);grid
axis([-10 10 0 1]);title(’x(t)=eˆ{-|t|}’)
subplot(222)
plot(t1,zz);grid;title(’integral of |x(t)|’);xlabel(’t’)
subplot(223)
plot(t1,yy);grid;title(’integral of |x(t)|ˆ2’);xlabel(’t’)
subplot(224)
plot(t1,vv);grid;title(’integral of |eˆ{-t}cos(2\pit)|ˆ2’);xlabel(’t’)
figure(2)
ezplot((exp(-t)*cos(2*pi*t))ˆ2,[0,5]);grid
axis([0 5 0 1])
hold on
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.24
ezplot((exp(-t))ˆ2,[0,5])
axis([0 5 0 1]);title(’envelope of |y(t)|ˆ2’)
hold off
x(t)=e−|t|
1
integral of |x(t)|
2
0.8
envelope of |y(t)|2
1
1.5
0.9
1
0.8
0.5
0.7
0.6
0.4
0.2
0
−10
−5
0
t
5
10
0
0.6
0
2
6
8
10
t
0.5
integral of |e−tcos(2πt)|2
integral of |x(t)|2
1
4
0.4
0.3
0.8
0.3
0.25
0.6
0.2
0.4
0.2
0.15
0.2
0.1
0
0.05
0
2
4
6
t
8
10
0.1
0
2
4
6
8
10
0
0
0.5
1
t
1.5
2
2.5
t
3
3.5
4
4.5
5
Figure 1.12: Problem 20: signal x(t), and the integrals of |x(t)|, |x(t)|2 and |y(t)|2 (left). Right: envelope of
|y(t)|2 .
(d) For a value C for the capacitor, considering the initial condition the source for the RC circuit the KVL
equation for t 0 is:
Z
1 t
vR (t) +
i(⌧ )d⌧ = 1, or
C 0
Z t
1
e t+
e ⌧ d⌧ = 1
CR 0
after replacing the voltage and current in the resistor. Solving the integral we obtain
e
t
+
1
(1
RC
e t) = 1
so that for t = 0 we get an identity indicating the initial condition is satisfied by the solution. For t ! 1
we get 1/RC = 1. So that R = 1/C in general, for C = 1 mF then R = 1 K⌦ and for C = 1µ = 10 6 F,
then R = 106 ⌦ or 1 M⌦.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.25
1.21 (a) The signal x1 (t) = 4 cos(⇡t) has frequency ⌦1 = 2⇡/2 so that the period of x1 (t) is T1 = 2.
Likewise the signal x2 (t) = sin(3⇡t + ⇡/2) has frequency ⌦2 = 3⇡ = 2⇡/(2/3) so that it is
periodic of period T2 = 2/3. The signal x(t) is periodic of fundamental period T0 = 2 as the ratio
T1 /T2 = 2/(2/3) = 3 so that T0 = 3T2 = T1 = 2.
(b) The ratio of the two periods is
T1
3
1
=
=
T2
3⇥4
4
so that
T0 = 4T1 = T2
is the period of x(t) = x1 (t) + x2 (t).
(c) In general, if the ratio of the periods of two periodic signals is
T1
M
=
T2
K
for integers M and K, not divisible by each other, then T0 = KT1 = M T2 is the period of the sum of
the periodic signals. If the ratio is not rational (i.e., M and/or K are not integers) then the sum of the two
periodic signals is not periodic.
The following script is used to show that x1 (t) + x2 (t) is periodic, while x3 (t) + x4 (t) is not.
% Pr. 1_21
clear all; clf
syms x1 x2 x3 x4 t
x1=4*cos(2*pi*t); x2=-sin(3*pi*t+pi/2);
x3=4*cos(2*t);x4=x2;
figure(3)
subplot(211)
ezplot(x1+x2,[0 10]);grid
subplot(212)
ezplot(x3+x4,[0 10]);grid
4 cos(2 π t)−cos(3 π t)
5
0
−5
0
1
2
3
4
5
t
6
7
8
9
10
7
8
9
10
4 cos(2 t)−cos(3 π t)
5
0
−5
0
1
2
3
4
5
t
6
Figure 1.13: Problem 21: periodic x1 (t) + x2 (t) (top), non–periodic x3 (t) + x4 (t) (bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.26
1.22 (a) The triangular pulse has a width of 2 and a height of 1/ , its area is 1. The following MATLAB
script can be used to see the limit as ! 0
% Pr. 1_22
clear all; clf
% part (a)
delta=0.1;
t=[-delta:0.05:delta];N=length(t);
lambda=zeros(1,N);
figure(5)
for k=1:6,
lambda=(1-abs(t/delta))/delta;
delta=delta/2;
plot(t,lambda);xlabel(’t’)
axis([-0.1 0.1 0 330]);grid
hold on
pause(0.5)
end
grid
hold off
(b) The signal S (t) = 1/ s(t/ ) so that
S (t) =
1 sin(⇡t/ )
sin(⇡t/ )
=
⇡t/
⇡t
and so
S (0) = lim (⇡/ )
t! 0
cos(⇡t/ )
= 1/
⇡
and S (t) is zero at
⇡t/
or t = ±k
and finally the integral
Z 1
1
k 6= 0 integer
= ±k⇡
S (t)dt =
Z
1
1
sin(⌧ ⇡)
d⌧ = 1
⇡ ⌧
where we used ⌧ = t/ . The following script illustrates the limit as
! 0.
% part (b)
syms S t
delta=1;
figure(6)
for k=1:4,
delta=delta/k;
S=(1/delta)*sinc(t/delta);
ezplot(S,[-2 2])
axis([-2 2 -8 30])
hold on
I=subs(int(S,t,-100*delta, 100*delta)) % area under sinc
pause(0.5)
end
grid;xlabel(’t’)
hold off
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.27
sin(24 π t)/π/t
λ(t)
30
300
25
250
20
200
15
10
150
5
100
0
50
−5
0
−0.1
−0.08
−0.06
−0.04
−0.02
0
t
0.02
0.04
0.06
0.08
0.1
−2
−1.5
−1
−0.5
0
t
0.5
1
1.5
2
Figure 1.14: Problem 22: approximation of (t) using triangular (left) or sinc (right) functions
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.28
1.23 (a) The sampling signal is a sequence of unit impulses at uniform times kT , for t > 0. The integral
ssT (t) =
Z
1
X
t
(t
kT )dt =
1 k=0
1 Z
X
k=0
t
(t
kT )dt =
1
1
X
u(t
kT )
k=0
This signal is called the “stairway to the stars” (ssT (t)) for obvious reasons.
(b)(c) The following script will display the signal ss(t) and the conversion to analog (just uncomment
the desired signal and comment the not desired signal).
% Pr. 1_23 parts (b) and (c)
clear all; clf
T=0.1; t=0:T:10;
%f=t; % part (b)
f=cos(2*pi*t); % part (c)
figure(6)
stairs(t,f);grid
%axis([0 10 0 10]) % part (b)
axis([0 10 -1.1 1.1]) % part (c)
hold on
plot(t,f,’r’)
hold off
When f (t) = t + 1 the output looks like a digitized line with unit slope and cut at 1 (see figure below),
similarly when f (t) = cos(2⇡t) the output looks like a digitized sinusoid.
10
1
9
0.8
8
0.6
7
0.4
6
0.2
5
0
4
−0.2
−0.4
3
−0.6
2
−0.8
1
−1
0
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
Figure 1.15: Problem 23: ‘Digitized’ ramp and cosine signals using ’stairway to stars’
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.29
1.24 (a) The expanded signal x(t/2) is periodic. The first period of x(t) is x1 (t) for 0  t  2, and so the
period of x(t/2) is x1 (t/2) which is supported in 0  t/2  2 or 0  t  4, so the period of x(t/2) is
4.
(b) The compressed signal x(2t) is periodic. The first period of x(t), x1 (t) for 0  t  2, becomes
x1 (2t) for 0  2t  2 or 0  t  1, its support is halved. So the period of x(2t) is 1.
% Pr. 1_24, part(b)
clear all; clf
t=0:0.002:8;
t1=0:0.001:8; t2=0:0.004:8;
x=cos(pi*t);
x1=cos(pi*t1/2);
x2=cos(pi*2*t2);
figure(7)
subplot(211)
plot(t1,x1)
hold on
plot(t,x,’r’)
xlabel(’t (sec)’)
ylabel(’x(t/2), x(t)’)
legend(’expanded signal’, ’original signal’)
subplot(212)
plot(t2,x2)
hold on
plot(t,x,’r’)
xlabel(’t (sec) ’)
ylabel(’x(2t), x(t)’)
hold off
legend(’compressed signal’, ’original signal’)
1
expanded signal
original signal
x(t/2), x(t)
0.5
0
−0.5
−1
0
1
2
3
4
t (sec)
5
1
7
8
compressed signal
original signal
0.5
x(2t), x(t)
6
0
−0.5
−1
0
1
2
3
4
t (sec)
5
6
7
8
Figure 1.16: Problem 24: expanded and compressed sinusoids vs original sinusoid.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.30
1.25 (a) The power of the full-wave rectified signal is
Py =
Z
1
| sin(⇡t)|2 dt
0
because the period of y(t) is T = 1. A simpler expression for sin2 (⇡t) can be computed using Euler’s
equation
sin2 (⇡t)
=
=
=

ej⇡t
e
2j
j⇡t 2
1 ⇥ j2⇡t
e
2+e
4
0.5(1 cos(2⇡t))
j2⇡t
⇤
Since cos(2⇡t) has a period 1 its integral over a period is zero, thus
Py = 0.5
(b) A pulse ⇢(t) = u(t) u(t 1) covers one of the periods of y(t) and thus the area under the full-wave
rectified signal is Py < 1 the area of the pulse squared.
(c) The following script is used to calculate the power which is found to be 1/2
% Pr. 1_25, part (c)
clear all;clf
syms x t
x=sin(pi*t); T=1;
figure(8)
ezplot(xˆ2,[0,5*T]);grid
P=int(xˆ2,t,0,T)/T
sin(π t)2
1
0.8
0.6
0.4
0.2
0
0
0.5
1
1.5
2
2.5
t
3
3.5
4
4.5
5
Figure 1.17: Problem 25: magnitude squared signal used to compute power.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.31
1.26 The sampling rate Fs in sample/second is given with the discretized signal. To get one second of the
signal we need to take N = Fs samples from the given signal. The corresponding number of samples
N N for ⌧ = 0.5 sec. is then calculated and the signal y(t) computed and displayed as function of time
as shown in the following script. For Fs = 8, 192 samples/sec, N N = 4, 096 samples
% Pr. 1_26
clear all; clf
load handel; Fs % test signal and sampling freq
N=Fs; y=y(1:N)’; % one second of handel
NN=fix(0.5*Fs) % delay in samples
% delaying signals
t=0:1/Fs:(N-1)/Fs;
tt=0:1/Fs:(N-1)/Fs+2*NN/Fs;
y1=[y zeros(1,2*NN)];
y2=0.8*[zeros(1,NN) y zeros(1,NN)];
y3=0.5*[zeros(1,2*NN) y];
yy=y1+y2+y3;
figure(9)
subplot(211)
plot(t,y); title(’original signal’);grid
subplot(212)
plot(tt,yy); title(’multipath signal’);grid
xlabel(’t (sec)’)
sound(yy,Fs)
original signal
1
0.5
0
−0.5
−1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1.4
1.6
1.8
2
multipath signal
2
1
0
−1
−2
0
0.2
0.4
0.6
0.8
1
t (sec)
1.2
Figure 1.18: Problem 26: original ’handel’ signal (top); two-path affected signal (bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.32
1.27 (a) (b) Adding 1 to the phasor 0.7ej t gives a phasor of continuously varying magnitude and phase. Part
(a) of the script below shows it.
We have
1 + 0.7ej t = 1 + 0.7 cos( t) + j0.7 sin( t) = A(t)ej✓(t)
where
A(t) =
and
p
p
(1 + 0.7 cos( t))2 + (0.7 sin( t))2 = 1.49 + 1.4 cos( t)
✓(t) = tan
1

0.7 sin( t)
1 + 0.7 cos( t)
which are computed as indicated in the script below.
(c) In this case we consider the effects of having two paths, the attenuation and the delays in time and in
frequency.
% Pr. 1_27
clear all; clf
% part (a)
t1=0;T=0.5;
m=1;
figure(10)
for k=1:512,
B=0.7*exp(j*pi*t1/100);
A=1+B;
A1(k)=abs(A);
Theta(k)=angle(A)*180/pi;
if k==20*m,
compass(real(A),imag(A),’r’)
hold on
compass(real(B),imag(B))
hold on
compass(1,0,’k’)
legend(’A=B+1’,’B’,’1’)
m=m+1;
pause(0.1)
else
t1=t1+T;
hold off
end
end
t=0:T:511*T;
% part (b)
figure(11)
subplot(211)
plot(t,A1);title(’Magnitude of 1+eˆ{j\phi t}’);grid
axis([0 max(t) 0 1.1*max(A1)])
subplot(212)
plot(t,Theta);title(’Phase (degrees) of 1+eˆ{j\phi t}’);grid
axis([0 max(t) 1.1*min(Theta) 1.1*max(Theta)]);xlabel(’t’)
% part (c)
y0=0.7*exp(j*(pi+pi/100)*t);
y1=real(exp(j*pi*t)+[zeros(1,100) y0(1:length(y0)-100)]);
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.33
t1=0:T:(length(y1)-1)*T;
figure(12)
plot(t1,y1);title(’Multi-path effects’);grid
axis([0 max(t1) 1.1*min(y1) 1.1*max(y1)]); ylabel(’y_1(t)’);xlabel(’t’)
Magnitude of 1+ejφ t
90
1.5
120
A=B+1
60 B
1
1.5
1
1
150
30
0.5
0.5
0
0
180
50
100
150
200
250
200
250
0
Phase (degrees) of 1+ejφ t
40
210
20
330
0
−20
240
300
−40
270
0
50
100
150
t
Multi−path effects
1.5
1
y1(t)
0.5
0
−0.5
−1
−1.5
0
50
100
150
200
250
t
Figure 1.19: Problem 27: phasor plot (top–left); magnitude and phase of 1 + ej
due to multipath (bottom).
t
Copyright 2014, Elsevier, Inc. All rights reserved.
(top–right); resulting signal
Chaparro — Signals and Systems using MATLAB
1.34
1.28 (a) The following script generates the signal y(t) for N P = 101 players, and
the N P to 51 we obtain the corresponding signal).
= 0.02 Hz (changing
% Pr. 1_28
clear all; clf
NP=101 % number of players
% NP=51
A=10; delta=2/(NP-1);
F=160-(NP-1)/2*delta:delta:160+(NP-1)/2*delta;
t=0:0.1:200;
y=zeros(1,length(t));
figure(13)
for k=1:NP,
y=y+A*cos(2*pi*F(k)*t);
plot(t,y);grid
pause(0.1)
end
ylabel(’y(t)’); xlabel(’t’)
The final signal looks like a sequence of very narrow pulses.
(b) In this part, one can think of a multipath with N P paths, with no attenuation but a different Doppler
shift, ranging from 1 Hz to 1 Hz, in increments of 0.02 Hz.
1200
1000
800
y(t)
600
400
200
0
−200
−400
0
20
40
60
80
100
t
120
140
160
180
200
Figure 1.20: Problem 28: pulsation effect when N P = 101 and
Copyright 2014, Elsevier, Inc. All rights reserved.
= 0.02 Hz.
Chaparro — Signals and Systems using MATLAB
1.35
1.29 (a)(b) The following script generates the chirps
% Pr. 1_29
clear all;clf
t=0:0.05:40;
% chirps
y=cos(2*t+t.ˆ2/4);
y1=cos(2*t- 2*sin(t));
figure(14)
subplot(211)
plot(t,y); title(’linear chirp’)
axis([0 20 1.1*min(y) 1.1*max(y)]);grid
subplot(212)
plot(t,y1);title(’sinusoidal chirp’);xlabel(’t’)
axis([0 20 1.1*min(y1) 1.1*max(y1)]);grid
% instantaneous frequencies
IF=2+2*t/4;
IF1=2-2*cos(2*t);
figure(15)
subplot(211)
plot(t,IF);title(’IF of linear chirp’)
ylabel(’frequency’); xlabel(’t’);grid
subplot(212
plot(t,IF1);title(’IF of sinusoidal chirp’)
ylabel(’frequency’);xlabel(’t’);grid
linear chirp
IF of linear chirp
25
1
20
frequency
0.5
0
−0.5
15
10
5
−1
0
2
4
6
8
10
12
14
16
18
0
20
sinusoidal chirp
4
0.5
3
frequency
1
0
−0.5
0
5
10
15
20
t
25
30
35
40
30
35
40
IF of sinusoidal chirp
2
1
−1
0
2
4
6
8
10
t
12
14
16
18
20
0
0
5
10
15
20
t
25
Figure 1.21: Problem 29: linear and sinusoidal chirps (left) and their corresponding instantaneous frequencies
(right).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
Copyright 2014, Elsevier, Inc. All rights reserved.
1.36
Chapter 2
Continuous–time Systems
2.1
Basic Problems
2.1 (a) The y(t)-x(t) relation is a line through the origin between 10 to 10 and a constant before and after
that. The system is non-linear, for instance if x(t) = 7 the output is y(t) = 700 but if we double the
input, the output is not 2y(t) = 1400 but 1000.
(b) If the inputs is always between 10 and 10 the system behaves like a linear system. In this case the
output is chopped whenever x(t) is above 10 or below 10. Se Fig. 2.1.
(c) Whenever the input goes below 10 or above 10 the output is 1000 and 1000, otherwise the output
is 2000 cos(2⇡t)u(t).
(d) If the input is delayed by 2 the clipping will still occur, simply at a later time. So the system is time
invariant.
1000
x(t)
y(t)
800
600
400
200
0
−200
−400
−600
−800
−1000
−2
−1
0
1
t
2
3
4
Figure 2.1: Problem 1: input and output of amplifier.
1
Chaparro — Signals and Systems using MATLAB
2.2
2.2
(a) Input x1 (t) = (t) gives
y1 (t) =
Z
8
< 2
3
(⌧ )d⌧ + 2 =
:
2
t
t 1
x2 (t) = 2x1 (t) gives
y2 (t) = 2
Z
t
t 1
t<0
0t1
t>1
8
< 2
4
(⌧ )d⌧ + 2 =
:
2
t<0
0t1
t>1
Since y2 (t) 6= 2y(t) system is non-linear.
x1 (t)
y1 (t)
3
2
(1)
t
x2 (t)
y2 (t)
2
t
1
4
2
(2)
t
2
1
t
Figure 2.2: Problem 2
(b) If x3 (t) = u(t) u(t 1) then y3 (t) = 2 + r(t) 2r(t 1) + r(t 2) . If x4 (t) = x3 (t
then the corresponding output is y3 (t 1), so the system is time-invariant.
1)
(c) Non-causal, although y(t) depends on present and past inputs, it is not zero when x(t) = 0, due to
the bias of 2.
(d) If |x(t)| < M we have
|y(t)| 
Z
t
t 1
|x(⌧ )|d⌧ + 2 < M + 2 < 1
The system is BIBO stable.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.3
2.3
(a) x(t) = sin(2⇡t)u(t) is zero for t < 0 and repeats periodically every T0 = 1. Thus,
y(t) =
1
X
p(t
k), p(t) = u(t)
2u(t
0.5) + u(t
1)
k=0
If the input is 2x(t) the output is the same as before, so the system is non-linear.
(b) The system is time-invariant: if input x(t
⌧ ) the output is y(t
⌧ ) for any value of ⌧ .
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.4
2.4
(a) Derivative
dz(t)
= w(t) w(t 1)
dt
which excludes the initial condition of 2. System is LTI if initial condition is zero.
(b)
i. If input is i(t
µ) then the output is letting ⌘ = ⌧
Z
t
i(⌧
µ)d⌧ =
0
Z
0
i(⌘)d⌘ +
µ
Z
µ
t µ
i(⌘)d⌘ = vc (t
µ)
0
that is, provided that i(t) = 0 for t < 0, the system is time-invariant.
Rt
ii. If i(t) = u(t) then vc (t) = 0 u(⌧ )d⌧ = r(t). If we shift the inputs i1 (t) = i(t 1) = u(t 1)
the previous output is shifted, so system is time-invariant.
(c) If x(t) = u(t) then y(t) = sin(2⇡t)u(t) while corresponding to x(t 0.5) = u(t
y1 (t) = sin(2⇡t)u(t 0.5) indicating the system is not time-invariant as y1 (t) is not y(t
sin(2 π t) heaviside(t)
−0.5
0
0.5
t
heaviside(t − 1/2) sin(2 π t)
1
1.5
−0.5
0
0.5
t
1
1.5
Figure 2.3: Problem 4(c)
Copyright 2014, Elsevier, Inc. All rights reserved.
0.5) is
0.5).
Chaparro — Signals and Systems using MATLAB
2.5
2.5
(a) See Fig. 1. The circuit is a series connection of a voltage source x(t) with a resistor R = 1/2 ⌦,
and capacitor C = 1F. Indeed, the mesh current is i(t) = dy(t)/dt so
x(t) = Ri(t) + y(t) = Rdy(t)/dt + y(t)
i(t)
x(t)
R = 1/2 ⌦
+
+
_
C = 1F
y(t)
Figure 2.4: Problem 5
(b) The output is
y(t) = e
2t
and
dy(t)
dt
dy(t)
+ 2y(t)
dt
0.5 e2⌧ |t0 = 0.5(1
e
=
e
2t
u(t) + 0.5(1
=
e
2t
u(t)
=
e
2t
u(t) + u(t)
=
u(t)
2t
)u(t)
e
e
2t
2t
) (t)
u(t)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.6
2.6
(a)
i. z(t) = Av(t) + B, system is linear if B = 0, non-linear otherwise.
ii. z(t) = v(t) cos(⌦0 t) is linear but time-varying.
iii. If f (t) = v(t) = u(t) u(t 1), B = 0 then z(t) = u(t) u(t 1), and if we shift v(t) so
the input is v1 (t) = u(t 2) u(t 3) the output is z1 (t) = v1 (t)f (t) = 0 which is different
from z(t 2), so the system is time-varying.
(b)
i. The system is linear:
Z
Z
Z
1 t
A t
B t
[Ax1 (⌧ ) + Bx2 (⌧ )]d⌧ =
x1 (⌧ )d⌧ +
x2 (⌧ )d⌧ = Ay1 (t) + By2 (t)
T t T
T t T
T t T
where yi (t), i = 1, 2, are the corresponding outputs to xi (t),i = 1, 2.
ii. If x(t) = u(t) then y(t) = r(t) r(t 1) and if x1 (t) = u(t 2) the corresponding output
is y1 (t) = y(t 2). System is time-invariant.
In general, if x1 (t) = x(t
) the output is
1
T
Z
t
t T
1
x1 (⌧ ) d⌧ =
| {z }
T
x(t
)
Z
t
x(⌫)d⌫
t T
(using ⌫ = ⌧
) which is the same as y(t
), so time-invariant.
iii. y(t) depends on present and past inputs, and zero if input is zero, so the system is causal.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.7
2.7 (a) The charge is
q(t) = C(t)v(t)
so that
dq(t)
dv(t)
dC(t)
= C(t)
+ v(t)
dt
dt
dt
(b) If C(t) = 1 + cos(2⇡t) and v(t) = cos(2⇡t), the current is
i(t) =
i1 (t)
=
dv(t)
dC(t)
+ v(t)
dt
dt
(1 + cos(2⇡t))( 2⇡ sin(2⇡t))
=
2⇡ sin(2⇡t)[1 + 2 cos(2⇡t)]
=
C(t)
cos(2⇡t)(2⇡ sin(2⇡t))
(c) When the input is
v(t
0.25) = cos(2⇡(t
1/4)) = sin(2⇡t)
the output current is
i2 (t)
=
0.25)
dC(t)
+ v(t 0.25)
dt
dt
(1 + cos(2⇡t))(2⇡ cos(2⇡t)) 2⇡ sin2 (2⇡t)
=
2⇡ cos(2⇡t) + 2⇡[cos2 (2⇡t)
=
C(t)
dv(t
sin2 (2⇡t)]
which is not
i1 (t
0.25) = 2⇡ cos(2⇡t)[1 + sin(2⇡t)]
so the system is time varying.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.8
2.8 (a) The system is LTI since the input x(t) and the output y(t) are related by a convolution integral with
h(t ⌧ ) = e (t ⌧ ) u(t ⌧ ) or h(t) = e t u(t).
Another way: to show that the system is linear let the input be x1 (t) + x2 (t), and x1 (t) and x2 (t) have
as outputs
Z
t
yi (t) =
e
(t ⌧ )
xi (⌧ )d⌧
i = 1, 2
0
The output for x1 (t) + x2 (t) is
Z
t
(t ⌧ )
e
(x1 (⌧ ) + x2 (⌧ ))d⌧ = y1 (t) + y2 (t)
0
To show the time invariance let the input be x(t
Z
Z
t
e
(t ⌧ )
x(⌧
t0 )d⌧
=
0
Z
=
by letting µ = ⌧
t0 ), its output will be
0
e
((t t0 ) µ)
t0
t t0
x(µ)dµ +
((t t0 ) µ)
e
Z
t t0
e
((t t0 ) µ)
x(µ)dµ
0
x(µ)dµ = y(t
t0 )
0
t0 and using the causality of the input. The system is then TI.
Finally the impulse response is found by letting x(t) = (t) so that the output is
⇢
Z t
Z t
e t⇥1=e t t 0
(t ⌧ )
(t 0)
h(t) =
e
(⌧ )d⌧ =
e
(⌧ )d⌧ =
0
otherwise
0
0
(b) Yes, this system is causal as the output y(t) depends on present and past values of the input.
(c) Letting x(t) = u(t), the unit-step response is
s(t) =
Z
t
e
t+⌧
u(⌧ )d⌧ = e
0
t
Z
t
e⌧ d⌧ = 1
t
e
0
for t 0 and zero otherwise. The impulse response as indicated before is h(t) = ds(t)/dt = e t u(t).
The BIBO stability of the system is then determined by checking whether the impulse response is absolutely integrable or not,
Z
Z
1
1
|h(t)|dt =
1
e t dt =
e
0
t 1
|0
so yes it is BIBO stable.
(d) Using superposition, the response to the pulse x1 (t) = u(t)
y1 (t) = y(t)
y(t
e t )u(t)
1) = (1
which starts at zero, grows to a maximum of 1
e
1
u(t
(1
e
=1
1) would be
(t 1)
)u(t
1)
at t = 1 and goes down to zero as t ! 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.9
2.9 (a) Letting x(t) = (t) the impulse response is
h(t)
=
=
If t > 0, and t
1
T
1
T
Z
Z
t+T /2
(⌧ )d⌧
t T /2
t
1
(⌧ )d⌧ +
T
t T /2
Z
t+T /2
(⌧ )d⌧
t
T /2 < 0 the first integral includes 0, while the second does not. Thus
h(t) =
1
T
Z
t
(⌧ )d⌧ + 0 =
t T /2
1
T
t > 0 and t
T /2 < 0, or 0 < t < T /2
Likewise when t < 0 then t T /2 < T /2 and t + T /2 < T /2 the reverse of the previous case happens
and so
Z
1 t+T /2
1
h(t) = 0 +
(⌧ )d⌧ =
t < 0 and t + T /2 > 0, or
T /2 < t < 0
T t
T
so that
1
[u(t + T /2) u(t
T
indicating that the system is non-causal as h(t) 6= 0 for t < 0.
(b) If x(t) = u(t) then the output of the averager is
h(t) =
y(t) =
1
T
Z
T /2)]
t+T /2
u(⌧ )d⌧
t T /2
If t + T /2 < 0 then y(t) = 0 since the argument of the unit step signal is negative. If t + T /2
t T /2 < 0 then
Z t+T /2
1
y(t) =
u(⌧ )d⌧ = (t + T /2)
T
0
and finally when t
T /2
0 then
y(t) =
1
T
Z
t+T /2
u(⌧ )d⌧ = 1
t T /2
The unit-step response of the noncausal averager is
8
t < T /2
< 0
1
(t + T /2)
T /2  t < T /2
y(t) =
T
:
1
t T /2
Copyright 2014, Elsevier, Inc. All rights reserved.
0 and
Chaparro — Signals and Systems using MATLAB
2.10
2.10 The input to all the systems is x(t) = cos(t), 1 < t < 1
(a) The system is non-linear, as the output
y(t) = cos2 (t) = 0.5(1 + cos(2t))
has frequency components of frequencies 0 and 2 (rad/sec) which are not in the input.
(b) The output is
y(t) = 0.5 cos(t) + 0.5 cos(t 1)
having the same frequencies as the input so it is LTI.
(c) The output
y(t) = cos(t)u(t)
is not LTI. This is not a periodic signal, and it has frequencies different from the one at the input due to
the multiplication by the u(t).
(d) The output is
y(t) = 0.5 sin(⌧ )|tt
2
= 0.5 sin(t)
0.5 sin(t
2)
having the same frequency as the input so it is LTI.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.11
2.11 (a) Since f (t) is not a constant, the system is a modulator thus linear but time varying. Linearity is clearly
satisfied. If x(t) 6= 0 is the input and we shift it to get as input x(t 11) the corresponding output is
zero different from y(t 11). Thus the system is time varying. Since y(t) depends on x(t) the system is
causal. For x(t) bounded, i.e., |x(t)| < M < 1, the output is also bounded, |y(t)| < M |f (t)| < 1 so
the system is BIBO stable.
(b) The modulated signal is
x(t)f (t) = 2[cos((⇡/2 + 6⇡/7)t) + cos((6⇡/7
⇡/2)t) = 2(cos(19⇡t/14) + cos(5⇡t/14)
with periods of T0 = 28/19 and T1 = 28/5 for the two components. The ratio
T0
5
=
T1
9
i.e., it is rational so the modulated signal is periodic of period 5T1 = 19T0 = 28, which is easily verified.
The frequencies at the output are not present at the input so the system is linear but not time–invariant
(f (t) is a function of t).
(c) If x(t) = u(t), the modulated signal is y(t) = u(t) u(t 2), and if we shift the input so that it is
x(t 3) = u(t 3) the corresponding output is u(t 3)[u(t) u(t 2)] = 0 different from the previous
output shifted by 3, therefore the system is time-varying.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.12
2.12
(a) If y(0) = 0 the system is linear, indeed for an input ↵x1 (t) + x2 (t) with y1 (t) the response due
to x1 (t) and y2 (t) the response due to x2 (t) we have
Z
t
e
(t ⌧ )
[↵ax1 (⌧ ) + x2 (⌧ )]d⌧ = ↵y1 (t) + y2 (t)
0
If y(0) 6= 0, the output for input ↵x1 (t) is
y(0)e
t
+
Z
t
(t ⌧ )
e
↵x1 (⌧ )d⌧ = y(0)e
t
+ ↵y1 (t)
0
which is not ↵y1 (t) thus it is not linear.
(b) If the input is x(t) = 0, then y(t) = y(0)e t u(t) is the zero-input response, due completely to the
initial condition. If y(0) = 0 the response
y(t) =
Z
t
(t ⌧ )
e
x(⌧ )d⌧
0
(which is the convolution integral of the impulse response h(t) = e t u(t) with x(t)) is the zerostate response.
(c) The impulse response, obtained when y(0) = 0, x(t) = (t), and y(t) = h(t) is
⇢
Z t
Z t
e t t 0
(t ⌧ )
t
0
h(t) =
e
(⌧ )d⌧ = e
e (⌧ )d⌧ =
0
otherwise
0
0
(d) If x(t) = u(t) and y(0) = 0, then y(t) = s(t) given by
s(t) =
Z
t
(t ⌧ )
e
e t )u(t)
d⌧ = (1
0
Notice the relation between the unit-step and the impulse response:
−heaviside(t) (1/exp(t) − 1)
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
−1
0
1
2
3
4
5
6
7
8
9
10
t
Figure 2.5: Problem 12
ds(t)
dt
=
=
(t)
e
t
(t) + e t u(t)
e t u(t) = h(t)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.13
2.13 (a) To find the differential equation let y(0) = 0, so that
2t
y(t) = 2e
Z
t
e2⌧ x(⌧ )d⌧
0
and its derivative is
dy(t)
=
dt
4e
2t
Z
t
e2⌧ x(⌧ )d⌧ + 2e
2t 2t
e x(t) =
2y(t) + 2x(t)
0
giving the differential equation
dy(t)
+ 2y(t) = 2x(t)
dt
(b) Finding the integral after replacing x(⌧ ) = u(⌧ ) we have that
y(t) = y(0)e
2t
+ 2e
2t e
2⌧
2
t
0
= y(0)e
t
+ (1
e
2t
)
so that in the steady state, i.e., when t ! 1, the output is 1, independent of the value of the initial
condition.
(c) From the given input-output equation, letting x(t) = (t) and y(0) = 0 the output is the impulse
response of the system
Z t
Z t
2(t ⌧ )
2t
h(t) = 2
e
(⌧ )d⌧ = 2e
(⌧ )d⌧ = 2e 2t u(t)
0
0
Computing the convolution integral as
y(t) =
Z
1
x(t
⌧ )h(⌧ )d⌧
1
it can be obtained graphically by reflecting the input x(t) = u(t) and shifting it linearly from
to get
1 to 1
• for t < 0 then y(t) = 0
• for t
0
y(t) =
Z
t
2e
2⌧
d⌧ = 1
e
t
0
and so in the steady state the output goes to 1.
(d) The zero-input response is
yzi (t) = y(0)e
2t
u(t)
and it is bounded for any finite value of the initial condition y(0), in particular for y(0) = 1, therefore
the system that depends on the initial condition is BIBO.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.14
2.14
(a) Yes. Using the convolution integral the output is
y(t)
=
Z
1
1
h(⌧ )
|{z}
u(⌧ ) u(⌧
x(t
⌧ )d⌧ =
1)
where we changed the variable to ⌘ = t
Z
1
x(t
⌧ )d⌧ =
0
Z
t
x(⌘)d⌘
t 1
⌧.
(b) If x(t) = u(t) then the step-response is
8
< 0
t
y(t) =
:
1
i.e., the unit-step response is s(t) = r(t)
h(t) =
r(t
t<0
0t<1
t 1.
1) and the impulse response is
ds(t)
= u(t)
dt
u(t
1)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.15
(a) x1 (t) = x(t)
by 1.
2) so y1 (t) = y(t)
x(t
2.15
2), two triangular pulses, the second multiplied
y(t
x1 (t)
y1 (t)
1
1
3
2
2
t
1
1
4
t
y2 (t)
x2 (t)
1
1
1
1
2
t
t
1
1
1
Figure 2.6: Problem 15
(b) x2 (t) = x(t + 1)
x(t) then y2 (t) = y(t + 1)
y(t) (they overlap between 0 and 1).
(c) x3 (t) = (t)
(t 1) so y3 (t) = dy(t)/dt = u(t) 2u(t 1) + u(t 2). Considering that
the output of x(t) is y(t), i.e., y(t) = S[x(t)], and that the integrator and the differentiator are
LTI systems Fig. 2.7 shows how to visualize the result in this problem by considering that you can
change the order of the cascading of LTI systems.
x3 (t) =
dx(t)
dt
Z
x(t)
y(t)
S
d
dt
dy(t)
dt
x3 (t) =
dx(t)
dt
S
dy(t)
dt
Z
|
Figure 2.7: Problem 15
Copyright 2014, Elsevier, Inc. All rights reserved.
dy(t)
dt
d
dt
{z
1
}
Chaparro — Signals and Systems using MATLAB
2.16
(a) If x(t) =
P9
k=0
(t
2.16
kT ) then by superposition and time-invariance
y(t) =
9
X
h(t
kT )
k=0
(b) If T = 1, y(t) = u(t)
y(t) =
10), while when t = 0.5
u(t
9
X
h(t
9
X
0.5k) =
k=0
h(t
[u(t
0.5k)
u(t
0.5k
k=0
⌧)
x(⌧ )
1
···
t
T =1
T
2T
⌧
9T
y(t)
1
0
y(t)
10
t
T = 0.5
1
0
0.5
t
Figure 2.8: Problem 16
Copyright 2014, Elsevier, Inc. All rights reserved.
1)]
Chaparro — Signals and Systems using MATLAB
2.17
2.17
(a) By the definition of the derivative
d
dt
Z
t
f (⌧ )d⌧
=
0
=
=
1
lim
h!0 h
1
lim
h!0 h
lim
h!0
"Z
"Z
t+h
f (⌧ )d⌧
0
t+h
f (⌧ )d⌧
t
#
Z
t
f (⌧ )d⌧
0
f (t)h
= f (t)
h
(b) y(t) satisfies the ordinary differential equation, indeed

Z t
dy(t)
d
=
ay(0)e at +
e at
ea⌧ x(⌧ )d⌧
dt
dt
0
Z t
=
a[y(0)e at + e at
ea⌧ x(⌧ )d⌧ ] + x(t) =
0
|
{z
}
ay(t) + x(t)
y(t)
(c) Multiplying the two terms of the ordinary differential equation by eat we get
eat dy(t)/dt + aeat y(t) = eat x(t)
|
{z
}
d(eat y(t))/dt
eat y(t) =
Z
t
ea⌧ x(⌧ )d⌧ + y(0)
0
solving for y(t) we obtain the solution.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.18
(a) For x1 (t) = u(t)
2.18
2) and zero initial conditions, we can use the convolution integral
u(t
y1 (t)
Z
=
t
h(⌧ )x1 (t
0
1 Z t
X
=
k=0
⌧ )d⌧
h1 (⌧
2k)x(t
⌧ )d⌧
0
for k = 0, we find graphically the integral to be
Z t
z(t) =
h1 (⌧ )x1 (t ⌧ )d⌧ = r(t) 2r(t
1) + 2r(t
3)
r(t
0
graphically. So that
y1 (t) =
1
X
z(t
2k) = r(t)
2r(t
1) + r(t
2)
k=0
(b) For x2 (t) = (t)
(t
2), the output is
y2 (t)
=
=
h(t) h(t 2)
1
1
X
X
h1 (t 2k)
h1 (t
k=0
=
h1 (t) +
1
X
h1 (t
k=1
=
h1 (t)
2(k + 1))
k=0
2k)
1
X
h1 (t
2k 0 )
k0 =1
where we changed to the variable k 0 = k + 1 in the second summation.
Also since x2 (t) = dx1 (t)/dt the output
y2 (t) =
dy1 (t)
= u(t)
dt
2u(t
1) + u(t
2) = h1 (t)
Copyright 2014, Elsevier, Inc. All rights reserved.
4)
Chaparro — Signals and Systems using MATLAB
2.19
2.19 (a) The output is the sum of two modulated signals, and as such it is time-varying as each modulator is
time-varying.
(b) If we let m1 (t) = m2 (t) = m(t), the output is equal to the sum of two modulators so it is linear
since the modulators are liner. Also
p
s(t) = m(t)(cos(⌦c t) + sin(⌦c t)) = 2m(t) cos(⌦c t ⇡/4)
i.e., one modulator with a phase. This system is known to be linear.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.20
2.20 (a) We can either find the impulse response or show that the output is bounded for any input signal that
is bounded. To find the impulse response change the variable to = t ⌧ which gives
1
y(t) =
T
Z
0
x(t
)d =
T
Z
T
0
1
x(t
T
)d
which is a convolution integral with h(t) = (1/T )[u(t) u(t T )]. This impulse response is absolutely
integrable as
Z 1
Z T
1
|h(t)|dt =
dt = 1
T
0
0
Likewise, if we assume that x(t) is bounded, i.e., there is a value M < 1 such that |x(t)| < M , then
|y(t)| 
1
T
Z
t
t T
|x(⌧ )|d⌧ 
M
T
Z
t
t T
d⌧ = M < 1
so system is BIBO stable.
(b) The ramp is not bounded, there is no M such that |r(t)| < M < 1. So when we compute the output
of the stable system to the ramp we do not expect it to be bounded either. Indeed
Z
1 t
t2 (t T )2
T
y(t) =
⌧ d⌧ =
=t
T t T
2T
2
increases as t increases, so it is unbound.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.21
2.21 (a) The following block diagram represents the echo system:
x(t)
y(t)
+
–delay
..
.
1
⇤)
y(t
–delay
(N
y(t
N 1
1)⇥ )
–delay
N⇥)
y(t
N
Figure 2.9: Problem 21: recursive model for echo system.
(b) When N = 1, ⌧ = 1 and ↵ = 0.1 the input/output equation for the echo system is
y(t) = x(t) + 0.1y(t
1)
To check the LTI we need an explicit expression of the output in terms of the input. This can be obtained
by recursively replacing y(t k), k = 1, 2, · · · in the right by the a delayed version of the input/output
equation, i.e.,
y(t)
=
=
x(t) + 0.1y(t
1
X
(0.1)k x(t
1) = x(t) + 0.1x(t
1) + 0.01x(t
2) · · ·
k)
k=0
Using this expression we have that if the input is x(t) = x1 (t) + x2 (t), with corresponding outputs y1 (t)
and y2 (t), then
1
X
(0.1)k [x1 (t
k) + x2 (t
k)] = y1 (t) + y2 (t)
k=0
so the echo system is linear. If we shift the input to x(t
1
X
(0.1)k x(t
n0
n0 ) then the output will be
k) = y(t
n0 )
k=0
i.e., time-invariant. The system is then overall LTI.
(c) The non-recursive model can be written as
z(t) =
M
X
k x(t
k⌧ )
0
=1
k=0
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
x(t
x(t)
–delay
2.22
x(t
⇤)
–delay
1
(M
···
2
1)⇥ )
x(t
M⇥)
–delay
M
+
z(t)
Figure 2.10: Problem 21: non-recursive model for echo system.
We have a finite representation of the output in terms of the inputs, attenuated and shifted in time. The
system resembles that in (b), and as in there it can be shown to be LTI.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.2
2.23
Problems using MATLAB
2.22 (a) The output voltage when the switch closes at t = 0 is
vo (t) =
R(t)u(t) =
(1 + 0.5 cos(20⇡t))u(t)
The initial value of the voltage is v(0) = 1.5.
(b) If the switch closes at t = 50 msec, the output voltage is
vo1 (t)
=
=
⇢
R(t)u(t 50 ⇥ 10 3 )
(1 + 0.5 cos(20⇡t))
0
with an initial value of vo1 (50 ⇥ 10 3 ) = 0.5.
(c) The initial values are different, and v01 (t) 6= vo (t
50 ⇥ 10
t 50 ⇥ 10
otherwise
3
3
) so the system is time varying.
The following script is used for the plotting in (a) and (b)
%% Pr 2_22
t=0:0.01:0.2;M=length(t);
v0=-(1+0.5*cos(20*pi*t));
t1=0:0.01:0.05;
N=length(t1);
v01=[zeros(1,N) v0(N+1:M)];
figure(1)
subplot(211)
plot(t,v0); grid; axis([0 max(t) -1.7 0.2]); ylabel(’v_0(t)’)
subplot(212)
plot(t,v01); grid;axis([0 max(t) -1.7 0.2]); xlabel(’t’); ylabel(’v_{01}(t)’)
0
v0(t)
−0.5
−1
−1.5
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
0
0.02
0.04
0.06
0.08
0.1
t
0.12
0.14
0.16
0.18
0.2
0
v01(t)
−0.5
−1
−1.5
Figure 2.11: Problem 22
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.24
2.23 (a) The zener diode clips any signal that exceeds a set threshold, in this case 0.5, thus if we have a
sinusoid with amplitude 0.3, less than the threshold, the output of the zerner diode would be the same as
the input. When the amplitude of the input is 1 the output is a sinusoid clipped at 0.5, but when it is 0.3
is not a clipped sinuosoid. Thus, the system is non-linear as scaling does not hold.
(b) The zener diode would do the same thresholding to a signal x(t) or to a shifted version of it x(t
⌧ ),
so the system is time invariant.
%% Pr 2_23
t=0:0.001:4;
vs=cos(pi*t); x=vs;
% vs=0.3*cos(pi*t);x=vs; % for a second input get rid of %
N=length(t);
for k=1:N,
if abs(vs(k))>=0.5,
if vs(k)<0,
vs(k)=-0.5;
else
vs(k)=0.5;
end
end
end
y=vs;
figure(2)
plot(t,x); grid; hold on
plot(t,y,’or’); axis([0 4 -1.1 1.1]); legend(’x(t)’,’y(t)’); xlabel(’t’)
hold off
1
x(t)
y(t)
0.8
0.6
0.4
0.2
0
−0.2
−0.4
−0.6
−0.8
−1
0
0.5
1
1.5
2
t
2.5
3
3.5
4
Figure 2.12: Problem 23: input x(t) and output y(t) of the zener diode.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.25
2.24 (a) No, the diode is non-linear. For v(t) > 0 doubling the voltage does not double the current i(t)
because the voltage-current relation is not a 45o line.
(b) To get the current to be close to zero when the voltage is negative we would need that Is ! 0 because
eqv(t)/kT 1  0. If the constant q/kT ! 1 the current would be very large for small values of the
voltage. The ideal diode is an approximation to the p-n diode with the voltage-current plot given by
the script below. The ideal diode is non-linear, the voltage-current plot is not a line of slope 45o . The
following is the plot for the given values of Is and the constant q/kT .
%% Pr. 2_24
v=-0.1:0.01:1;
Is=0.0001;kqT=0.026;
i=Is*(exp(v/kqT)-1);
figure(1)
plot(v,i);grid
axis([-0.1 1.2 -5 1.1*max(i)])
12
x 10
5
4
3
2
1
0
0
0.2
0.4
0.6
0.8
1
1.2
Figure 2.13: Problem 24: i-v response of the p-n diode.
(c) This is a half-wave rectifier used to obtain dc sources. The output is the positive part of the sinusoid
and zero whenever the sinusoid is negative.
1
0.8
|x(t)|
0.6
0.4
0.2
0
0
0.5
1
1.5
2
t
2.5
3
3.5
4
Figure 2.14: Problem 24: output of the half-wave rectifier.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.25 % Pr 2_25
clear all; clf
Ts=0.01; delay=1; Tend=20;
t=0:Ts:Tend;
%x=cos(2*pi*t).*(ustep(t,0)-ustep(t,-20));
%x=sin(2*pi*t).*exp(-0.1*t).*(ustep(t,0)-ustep(t,-20));
x=ramp(t,1,0)+ramp(t,-2,-2)+ramp(t,1,-8);
h=exp(-t);
y=Ts*conv(x,h);
% plots
t1=0:Ts:length(y)*Ts-Ts;
figure(1)
subplot(311)
plot(t,x); axis([0 20 -5 3]);grid;ylabel(’x(t)’);
subplot(312)
plot(t,h); axis([0 20 -0.1 1]);grid;ylabel(’h(t)’);
subplot(313)
plot(t1,y);
grid
Copyright 2014, Elsevier, Inc. All rights reserved.
2.26
Chaparro — Signals and Systems using MATLAB
2.27
2
x(t)
0
−2
−4
0
2
4
6
8
10
12
14
16
18
20
0
2
4
6
8
10
12
14
16
18
20
1
h(t)
0.5
0
0.2
0.1
0
−0.1
−0.2
0
5
10
15
20
25
30
35
40
2
x(t)
0
−2
−4
0
2
4
6
8
10
12
14
16
18
20
0
2
4
6
8
10
12
14
16
18
20
h(t)
1
0.5
0
0.6
0.4
0.2
0
−0.2
0
5
10
15
20
25
30
35
40
2
x(t)
0
−2
−4
0
2
4
6
8
10
12
14
16
18
20
0
2
4
6
8
10
12
14
16
18
20
h(t)
1
0.5
0
2
0
−2
−4
−6
0
5
10
15
20
25
30
35
40
Figure 2.15: Problem 25: input, impulse response and output of convolution integral.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.28
2.26 This averager is a LTI system
(a) The average signal for T = 1 and x(t) = u(t) is
8
0
>
>
>
>
Z t
< R
t
d⌧ = t
y(t) =
u(⌧ )d⌧ =
0
>
t 1
>
> R
>
: t
d⌧ = 1
t 1
t<0
0t<1
t
1
Using the LTI of the system, the response to x1 (t) = x(t) x(t 1) = u(t) u(t 1) is then
8
0t1
< t
1 (t 1) = 2 t 1  t  2
y1 (t) = y(t) y(t 1) =
:
0
otherwise
which is a triangular signal.
(b) The implementation of the averager can be seen as the sliding, from left to right, of a rectangular window of
width T and amplitude 1, and adding the values of the signal in that window to get the output. If we let T = T0 , the
period of the sinusoid x(t) = cos(2⇡t/T0 )u(t) after zero, the output of the averager is zero for t  0. There is then
a transient for 0  t  T0 , and the output will be zero for t t0 , as the average of the sinusoids is zero.
(c) The following script is used to implement this convolution in (a) and (b).
%% Pr. 2_26
N=1000; Ts=1/N;
tt=0:Ts:2; x=cos(2*pi*tt);
h=[ones(1,N) zeros(1,N+1)];
y=conv(x,h)*Ts;t=0:Ts:(length(y)-1)*Ts;
figure(5)
subplot(211)
plot(tt,x);hold on;plot(tt,h,’or’); legend(’x(t)’,’h(t)’);
axis([0 2 -1.1 1.1]); grid
subplot(212)
plot(t(1:length(t)/2),y(1:length(t)/2));grid
axis([0 2 1.1*min(y) 1.1*max(y)]); ylabel(’x*h’); xlabel(’t’)
1
x(t)
h(t)
0.5
0
−0.5
−1
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
0
0.2
0.4
0.6
0.8
1
t
1.2
1.4
1.6
1.8
2
0.15
0.1
x*h
0.05
0
−0.05
−0.1
−0.15
Figure 2.16: Problem 26:Sinusoid and impulse response (top), result of convolution.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.29
2.27 (a) The system with the sinc impulse response is non-causal because h(t) 6= 0 for t < 0. As such an ideal
low-pass filter cannot be used for real-time processing as it would require future inputs, not available in
real-time. This can be seen by looking at the convolution with a causal signal x(t):
Z 1
y(t) =
x(⌧ )h(t ⌧ )d⌧
0
Z t
Z 1
=
x(⌧ )h(t ⌧ )d⌧ +
x(⌧ )h(t ⌧ )d⌧
0
t
where the upper limit of the top integral is due to h(⌧ ) having an infinite support, and the lower limit
because x(t) is causal. The second bottom integral shows that the output depends on future values of the
input.
(b) For the low-pass filter to be BIBO stable the impulse response h(t) must be absolutely integrable,
i.e.,
Z 1
| sin(t)/t|dt < 1
1
To approximtely compute this integral we use the following script. The integral is bounded, so the filter
is BIBO stable.
%% Pr 2_27
clear all; clf
syms x t x1
x=abs(sinc(t/pi));
for k=1:30,
x1=int(x,t,0,k);
xx(k)=subs(2*x1);
end
n=1:30;
figure(1)
subplot(211)
ezplot(x,[-30,30]); axis([-30 30 -0.1 1.2]);grid
subplot(212)
stem(n,xx); axis([1 30 0 8]);grid
abs(sin(t))/abs(t)
1
0.8
0.6
0.4
0.2
0
−30
−20
−10
0
t
10
20
30
5
10
15
n
20
25
30
8
Integral
6
4
2
0
0
Figure 2.17: Problem 27: absolute value of sinc function and its integral values for t = n sec.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.28 %% Pr. 2_28
clear all; clf
% parts (a)--(c)
Ts=0.01;
t=0:0.01:100; N=length(t)
p=[20*ones(1,4000) -10*ones(1,2000) zeros(1,N-6000)];
P=1.1*abs(min(p))
x=(p+P).*cos(2*pi*t);
figure(6)
subplot(221)
plot(t,p); ylabel(’p(t)’)
subplot(222)
plot(t,x); ylabel(’x(t)’)
y=abs(x);
subplot(223)
plot(t,y); ylabel(’y(t)’)
h=exp(-0.8*t);
z=conv(h,y)*Ts; z=z*20/15;
subplot(224)
plot(t,z(1:length(t))-P); ylabel(’z(t)’); xlabel(’t’)
% part (d)
Ts=0.01;
t=0:0.01:100;N=length(t)
p=2*cos(0.2*pi*t);
P=abs(min(p))
x=(p+P).*cos(10*pi*t);
figure(7)
subplot(221)
plot(t,p+P); ylabel(’p(t)+P(t)’)
subplot(222)
plot(t,x); ylabel(’x(t)’)
y=abs(x);
subplot(223)
plot(t,y); ylabel(’y(t)’); xlabel(’t’)
h=exp(-0.8*t);
z=conv(h,y)*Ts;z=z-P+0.4;z=z*2/max(z);
subplot(224)
plot(t,z(1:length(t)));grid; ylabel(’z(t)’); xlabel(’t’)
Copyright 2014, Elsevier, Inc. All rights reserved.
2.30
Chaparro — Signals and Systems using MATLAB
2.31
40
20
20
x(t)
p(t)
10
0
−10
−20
0
−20
0
20
40
60
80
−40
100
0
20
40
0
20
40
60
80
100
60
80
100
60
80
100
60
80
100
30
20
20
10
z(t)
y(t)
10
0
−10
−20
0
−10
0
20
40
60
80
−20
100
4
4
3
2
x(t)
p(t)+P(t)
t
2
1
0
0
−2
0
20
40
60
80
−4
100
4
0
20
40
0
20
40
2
1
3
z(t)
y(t)
0
2
1
0
−1
−2
0
20
40
60
t
80
100
−3
t
Figure 2.18: Problem 28: modulation and envelope detection for pulses and for sinusoid.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
2.29 %% Pr. 2_29
clear all; clf
% part (a)
Ts=0.01;
t=0:Ts:10;
omega_c=2*pi; nu=10;
m=cos(t);
%% message
im=sin(t);
%% integral of message
y=cos(omega_c*t +2*pi*nu*im);
%% FM1 with nu=10
y1=cos(omega_c*t +2*pi*nu*im/10);
%% FM2 with nu/10
figure(9)
subplot(311)
plot(t,m); ylabel(’m(t)’)
subplot(312)
plot(t,y); ylabel(’y(t)’)
subplot(313)
plot(t,y1); ylabel(’y_1(t)’)
% part(b)
N=length(t)
for k=1:N,
if m(k)>=0,
m1(k)=1;
%% message
y(k)=cos(omega_c*k*Ts +2*pi*nu*k*Ts/10); %% FM
else
m1(k)=-1;
y(k)=cos(omega_c*k*Ts -2*pi*nu*k*Ts/10);
end
end
figure(10)
subplot(211)
plot(t,m1); ; ylabel(’m_1(t)’)
axis([0 10 1.1*min(m1) 1.1*max(m1)])
subplot(212)
plot(t,y); ylabel(’y(t)’)
axis([0 10 1.1*min(y) 1.1*max(y)])
Copyright 2014, Elsevier, Inc. All rights reserved.
2.32
Chaparro — Signals and Systems using MATLAB
2.33
1
m(t)
0.5
0
−0.5
−1
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
1
y(t)
0.5
0
−0.5
−1
1
y1(t)
0.5
0
−0.5
−1
1
m1(t)
0.5
0
−0.5
−1
1
y(t)
0.5
0
−0.5
−1
Figure 2.19: Problem 29: message signal m(t) and FM signals for ⌫ = 10 and 1 (top); message m1 (t) and
FM signal for ⌫ = 1 (bottom)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
Copyright 2014, Elsevier, Inc. All rights reserved.
2.34
Chapter 3
The Laplace Transform
3.1
3.1
Basic Problems
(a) Finite–support signals.
R1
i. L[x(t)] = 1 (t 1)e st dt = e s , ROC the whole s-plane
ii. L[y(t)] = es e s = 2 sinh(s), ROC the whole s-plane
iii. We have
L[z(t)] = L[u(t + 1)]
L[u(t
1)] =
es
e
s
=2
sinh(s)
s
s
ROC whole s-plane, pole-zero cancellation at s = 0.
iv. Notice that because cos(2⇡(t ± 1)) = cos(2⇡t ± 2⇡) = cos(2⇡t) then
w(t) = cos(2⇡t)[u(t + 1)
u(t
1)] = cos(2⇡(t + 1))u(t + 1)
cos(2⇡(t
1))u(t
so that
1)
es s
e ss
(es e s )s
2s sinh(s)
=
= 2
s2 + 4⇡ 2
s2 + 4⇡ 2
s2 + 4⇡ 2
s + 4⇡ 2
s
The poles p1,2 = ±j2⇡ are cancelled by zeros z1,2 = ±j2⇡ ( indeed, e e s |s=±j2⇡ = 1 1 = 0)
so the ROC is the whole s-plane.
(b) Causal signals.
i. X1 (s) = L[x1 (t)] = 1/(s + 1), ROC > 1
ii. Notice the exponential is not delayed, so the shifting property cannot be applied. Instead,
W (s) =
Y1 (s) = L[y1 (t)] = L[e
1
e
(t 1)
u(t
1)] =
(s+1)
e
s+1
, ROC
>
1
iii. L[z1 (t)] = L[e (t 1) u(t 1)] = e s /(s + 1), ROC > 1
iv. Since w1 (t) = x1 (t) y1 (t), where x1 (t) and y1 (t) are given before then
L[w1 (t)] = X1 (s)
ROC whole s-plane because pole s =
Y1 (s) =
1
e (s+1)
,
s+1
1 is cancelled by zero, i.e., 1
1
e
(s+1)
|s=
1
= 0.
Chaparro — Signals and Systems using MATLAB
3.2
3.2
(a) Anti–causal signals.
i. Using the integral definition of Laplace transform:
Z 0
Z 0
Z
X(s) =
et e st dt =
e ⌧ es⌧ d⌧ =
1
1
1
e(s
1)⌧
d⌧ =
0
1
1
=
s 1
1 s
by letting ⌧ = t. The ROC is < 1 to make upper limit of the integral go to zero.
ii. Let v(t) = y( t) = e t u(t 1) with V (s) = e 1 e s /(s + 1), ROC: > 1 then
e(s 1)
,
s+1
Y (s) = V ( s) =
ROC:
< 1.
A direct way is
Y (s)
Z
=
Z
=
iii. We have
Z(s)
Z
=
Z
=
1
1
1
1
et e
1
1
e
st
letting t0 =
dt
t0 (1 s)
dt0 =
1
et+1 u( (t + 1))e
e
⇢
u(⇢)e
s(⇢+1)
st
d⇢ =
1
t
es 1
1 s
ROC 1
dt letting ⇢ =
Z
1
es e⇢(s
1)
> 0 or
<1
(t + 1)
d⇢ = es
0
e⇢(s 1) 1
| =
s 1 0
es
s+1
ROC: < 1 to make the upper limit of the integral go to zero.
iv. w(t) = et u( t) et u( t 1) = x(t) y(t),
W (s) =
1
s
1
+
e(s 1)
e(s 1) 1
=
s 1
s 1
ROC: whole s-plane, since pole s = 1 is cancelled by zero at s = 1( indeed, e(s 1) 1|s=1 =
0). Notice that due to the pole–zero cancellation the region of convergence is not the intersection of the ROCs of X(s) and Y (s)
(b) Non–causal signals.
i. X1 (s) = (es e s )/s = 2 sinh(s)/s, ROC whole s-plane because pole at s = 0 is cancelled
by zero at s = 0 (since sinh(0) = 0).
ii. y1 (t) = e t u(t + 1) = e[e (t+1) u(t + 1)] so
Y1 (s) =
e(s+1)
, ROC:
s+1
>
1.
iii. We have
Z1 (s)
=
L[(e(t+1) u(t + 1))e
1
=
2 sinh(s 1)
ROC: whole s-plane
s 1
]
L[(e(t
1)
u(t
1))e] =
because there is pole/zero cancellation at s = 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
es
1
e
s
(s 1)
1
Chaparro — Signals and Systems using MATLAB
3.3
3.3 (a) The signal
y(t) = sin(2⇡t)[u(t)
u(t
1)] = sin(2⇡t)u(t)
sin(2⇡(t
1))u(t
1)
is the first period of the sinusoid. Its Laplace transform is
Y (s) = X(s)[1
e
s
], X(s) = L[sin(2⇡t)u(t)] =
s2
2⇡
+ 4⇡ 2
Since y(t) has finite support, Y (s) has as ROC the whole s-plane. The poles of the Laplace transform of
the sine are cancelled by the zeros. The zeros let 1 e s = 0 or e s = 1 = ej2⇡ or s1,2 = ±j2⇡, which
correspond to the poles of L[sin(2⇡t)u(t)].
(b) Let x1 (t) = cos(2⇡t)u(t) then
cos(2⇡t)[u(t)
u(t
1)] = x1 (t)
x(t) = [u(t)
u(t
1)]
s
s
x1 (t
1)
and so
x1 (t) + x1 (t
1)
with Laplace transform
X(s) =
1
(1 e
s
s
) X1 (s)[1 e
] = [1 e
]

1
s
X1 (s)] , X1 (s) = L[cos(2⇡t)u(t)] =
s2
s
+ 4⇡ 2
Since x(t) is of finite support its ROC is the whole plane. The zeros of X(s) cancel its poles. The zeros
s1,2 = ±j2⇡, 0, correspond to the poles of L[cos(2⇡t)u(t)] and the pole s = 0. There is a cancellation
of all the poles.
(c) There are different ways to find the Laplace transform of cos2 (t)u(t):
• Expressing
cos2 (t)u(t) = 0.5 cos(t)[ejt + e
jt
]u(t)
and finding the Laplace transform of the modulated exponentials.
• Considering cos2 (t)u(t) the product of two equal signals, so that its Laplace transform is the convolution of the Laplace transform of cos(t)u(t) with itself.
• Finally, cos2 (t)u(t) = 0.5(1 + cos(2t))u(t) and then finding the Laplace transform of the two
components.
Option 1, gives
and
L[cos2 (t))u(t)] = 0.5L[cos(t)ejt u(t)] + 0.5L[cos(t)e
L[cos(t)ejt u(t)] =
so that
Z
1
0.5(ej2t + 1)e
st
dt = 0.5
0
2
L[cos (t)u(t)] = 0.5
✓
1
s
+ 2
s s +4
✓
jt
u(t)]
1
s
j2
+
1
s
◆
◆
Option 3 gives

1
1
s
L[cos (t)u(t)] = L[1/2(1 + cos(2t))u(t)] = 0.5
+ L[cos(2t)u(t)] = 0.5
+
s
s s2 + 4
2

Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.4
(a)
3.4
i. For ↵ > 0,
X(s) =
1
s+↵
1
2s
2s
= 2
= 2
2
s+↵
↵
s
s
↵2
ROC:
↵<
<↵
where the ROC is the intersection of ROC of 1/(s + ↵), or > ↵, and the ROC of 1/( s +
↵), or < ↵.
ii. As ↵ ! 0, x(t) = u(t) u( t), the sign signal, which has no Laplace transform because
ROC does not exist.
(b) For the sampled signal
X1 (s) =
N
X1
e
n=0
2n
L[ (t
n)] =
N
X1
e
(s+2)n
=
n=0
1 e (s+2)N
1 e (s+2)
The poles of X1 (s) are values of s that make e (s+2) = 1 = ej2⇡k , or sk = 2 j2⇡k for k =
0, ±1, ±2 · · · . Similarly, the zeros of X1 (s) are sm = 2 j2⇡(m/N ) for m = 0, ±1, ±2 · · · .
Because the poles are cancelled when m = 0, ±N, ±2N, · · · (i.e., multiples of N ), the ROC of
X1 (s) is the whole s-plane.
(c) We have
S(s) =
1
X
n=0
L[u(t
n)] =
1
X
e
n=0
ns
=
s
1
s(1
e
s)
The poles are s = 0 and values of s that make 1 e s = 0 or sk = j2⇡k for k = 0, ±1, · · · .
Thus, all the poles are on the j⌦-axis and the signal is causal, as such the ROC is > 0.
(d) Since sin(2⇡t) = sin(2⇡t
2⇡) = sin(2⇡(t
v(t) = [cos(2(t
then
V (s) =
with ROC
+ 2 > 0 or
>
1)) + sin(2⇡(t
e ss
2⇡e s
+ 2
,
2
s + 4 s + 4⇡ 2
(e) The Laplace transform of y(t) is
Z 1
Z
Y (s) =
t2 e 2t u(t)e st dt =
1
1)) we have
1
1
(t2 u(t))e
(s+2)t
1))]u(t
ROC:
1)
>0
dt = L[t2 u(t)]s!s+2 =
2.
Copyright 2014, Elsevier, Inc. All rights reserved.
2
(s + 2)3
Chaparro — Signals and Systems using MATLAB
3.5
3.5
(a)
L[x(t)e
i.e., multiplying by e
shift. Thus,
at
at
u(t)] =
Z
1
[x(t)u(t)]e
(s+a)t
dt = X(s + a)
1
shifts the complex frequency s to s + a. This property is called frequency
Y (s) = L[(cos(t)u(t))e
2t
] = L[cos(t)u(t)]s!s+2 =
s+2
(s + 2)2 + 1
(b) The zero is s = 2 and the poles s1,2 = 2 ± j. Because the poles are in the left-hand splane x1 (t) ! 0 as t ! 1. Indeed, we have that X1 (s) is the Laplace transform of x1 (t) =
cos(t)e 2t u(t) which tends to zero as t ! 1.
(c)
i. z(t) =
e t u(t) + (t), so
Z(s) =
1
s
+1=
s+1
s+1
ii. If f (t) = e t u(t), then z(t) = df (t)/dt so
Z(s) = sL[f (t)]
f (0 ) =
s
s+1
0=
s
.
s+1
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.6
3.6 The transform is X(s) = (1 e s )/s. The pole of X(s) is s = 0, while the zeros of X(s) are values of
s that make 1 e s = 0 or sk = j2k⇡ for 1 < k < 1 and integer. The pole is cancelled with the
k = 0 zero, so X(s) has an infinite number of zeros on the j⌦-axis.
(a) The output of the LTI system has Laplace transform
Y (s) = X(s)H(s)
=
1
(s + j2⇡)(s j2⇡) Y
(s + j2⇡k)(s
s2 + 4⇡ 2
k=2
=
1
Y
(s2 + (2⇡k)2 )
k=2
There are no poles, but an infinite number of zeros at ±j2⇡k for integer k
(b) This is similar to the above problem, but here
Z(s) = X(s)G(s) = 1
which gives
z(t) = (t)
Copyright 2014, Elsevier, Inc. All rights reserved.
2.
j2⇡k)
Chaparro — Signals and Systems using MATLAB
3.7
(a) The Laplace transform of u( t) is
L[u( t)] =
provided that
Z
3.7
1/s, indeed
0
e
st
dt =
1
Z
1
es⌧ d⌧ =
0
es⌧ 1
|
=
s ⌧ =0
1
s
< 0 so that the limit when ⌧ = 1 is zero. Thus
L[u( t)] =
1
s
ROC :
<0
Thus x(t) = u(t) + u( t) = 1 for all t would have as Laplace transform
X(s) =
and as ROC the intersection of
x(t) = 1, 1 < t < 1.
> 0 and
1
s
1
=0
s
< 0 which is null. So we cannot find the Laplace of
(b) Let y(t) = yc (t) + yac (t) where the causal component yc (t) = y(t)u(t) = e t u(t) and the
anticausal component yac (t) = y(t)u( t) = et [u(t + 1) u(t)]. The Laplace transform of yac (t)
is
Z 0
Z 1
e(s 1) 1
Yac (s) =
e (s 1)t dt =
e(s 1)⌧ d⌧ =
s 1
1
0
with ROC the whole plane (pole at s = 1 is cancelled by zero at 1).
The Laplace transform of yc (t) is Yc (s) = 1/(s + 1), so that
Y (s)
=
=
Yc (s) + Yac (s) =
ses
1
+ es 1
s2 1
2
1
es 1 1
+
s+1
s 1
ROC
>
1
The poles of Y (s) are s = ±1, and a zero is s = 1. Thus the zero cancels the pole at s = 1 leaving
the pole at s = 1, and so the ROC is > 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.8
3.8
(a) The signal x(t) and its first derivative are shown in Fig. (3.1). The second derivative is
x(t)
1
2
1
4
3
t
1
dx(t)
dt
1
1
3
t
4
1
d2 x(t)
dt2
(2)
(1)
4
1
t
3
( 1)
( 2)
Figure 3.1: Problem 8
d2 x(t)
= (t)
dt2
2 (t
1) + 2 (t
3)
(t
4)
(b) The Laplace transform of the second derivative is
s2 X(s) = 1
2e
s
+ 2e
3s
2s
e
e
4s
from which we obtain
X(s) =
e
2s
s2
[e2s
2es + 2e
s
e
]=
2s
s2
[2 sinh(2s)
Copyright 2014, Elsevier, Inc. All rights reserved.
sinh(s)]
Chaparro — Signals and Systems using MATLAB
3.9
(a) Writing
3.9
1
e 2s
2
+
+
2
s + 1 s + 2 (s + 2)3
Y1 (s) =
then from the table of Laplace transforms:
y1 (t) = sin(t
2)u(t
2) + e
2t
u(t) + t2 e
2t
u(t)
(b) Expressing Y2 (s) in terms X2 (s) and I(s) (due to the initial conditions) as:
Y2 (s)
X(s)
I(s)
+ 2
+ 3s + 2 s + 3s + 2
1
s 1
+
s(s2 + 3s + 2) s2 + 3s + 2
=
s2
=
we have that I(s) =
equation
1, and (s2 + 3s + 2)Y2 (s) = X(s) would give the ordinary differential
s
d2 y2 (t)
dy2 (t)
+3
+ 2y2 (t) = x2 (t)
2
dt
dt
Its Laplace transform gives
(s2 + 3s + 2)Y2 (s)
sy2 (0)
dy2 (0)/dt
3y2 (0) = X(s)
so that I(s) = sy2 (0) + (dy2 (0)/dt + 3y2 (0)) which compared with I(s) =
1 and dy2 (0)/dt = 1 3y2 (0) = 2.
(c) We have that
Y (s) =
A
Bs + C
+
s
(s + 1)2 + 4
A = Y (s)s|s=0 = 1/5, then
Y (s)
gives B =
1/5 and C =
A
s/5 2/5
Bs + C
=
=
2
s
(s + 1) + 4
(s + 1)2 + 4
2/5, so
Y (s) =
1
5s
1
s+1
5 (s + 1)2 + 4
1
2
10 (s + 1)2 + 4
The steady state response is yss = 1/5, while the transient is
yt (t) = [ (1/5)e
t
cos(2t)
(1/10)e
t
sin(2t)]u(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
s
1 gives y2 (0) =
Chaparro — Signals and Systems using MATLAB
3.10
3.10
(a) Considering zero initial conditions the Laplace transform of the ordinary differential equation is
(s2 + 3s + 2)Y (s) = X(s) )
Y (s)
1
H(s) =
= 2
X(s)
s + 3s + 2
s2 + 3s + 2 = (s + 1)(s + 2), so the poles are at s = 1 and s = 2, both in the left-hand s-plane
so the system is BIBO stable. Equivalently, the impulse response h(t) = L 1 [H(s)] can be shown
to be absolutely integrable. Indeed,

1
1
h(t) = L 1
+
= [e t e 2t ]u(t) and
s+1 s+2
Z 1
|h(t)|dt = e t + 0.5e 2t |1
0.5 = 0.5
0 =1
1
(b) If X(s) = 1/s then
Y (s) =
s(s2
1
I(s)
+ 2
+ 3s + 2) s + 3s + 2
where the term I(s) corresponds to the initial conditions. If I(s) = 0 then
Y (s) =
1
A
B
C
= +
+
, where A = Y (s)s|s=0 = 0.5
s(s2 + 3s + 2)
s
s+1 s+2
and the steady state is yss (t) = 0.5 since the other terms disappear. If the initial conditions are
not zero, the inverse Laplace transform of I(s)/((s + 1)(s + 2)) will give terms that disappear as
t ! 1 because the poles are in the left-hand s-plane. Thus the ICs do not have any effect in this
case when the system is BIBO stable.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.11
3.11
(a) The following term corresponds to the zero-state
(s 1)X(s)
(s + 2)2 + 1
and the following term corresponds to zero-input
1
.
(s + 2)2 + 1
Zero-state response for x(t) = u(t)
Yzs (s)
=
=
=
s 1
A
B + Cs
= +
s((s + 2)2 + 1)
s
(s + 2)2 + 1
1/5
9/5 + s/5
1/5 1 (s + 2) + 7
+
=
+
s
(s + 2)2 + 1
s
5 (s + 2)2 + 1
1/5 1
(s + 2)
7
1
+
+
2
s
5 (s + 2) + 1 5 (s + 2)2 + 1
From the table of Laplace transforms
yzs (t)
=
(1/5)u(t) + (1/5)e
+(7/5)e
2t
2t
cos(t)u(t)
sin(t)u(t)
(b) Zero-input response
Yzi (s) =
(c) As t ! 1 y(t) !
1
) yzi (t) = e
(s + 2)2 + 1
2t
sin(t)u(t)
1/5.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.12
3.12
(a) The Laplace transform of s(t) = (h ⇤ x)(t) is S(s) = H(s)X(s) which gives
S(s) =
1
) s(t) = e
(s + 1)2 + 1
t
sin(t)u(t)
(b) By LTI
y1 (t) = s(t)
s(t
1)
y2 (t) = ds(t)/dt ds(t
Z t
y3 (t) =
s(t0 )dt0
1)/dt
1
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.13
(a) Zeros: s = ±j2, poles: s1 = 0, s2,3 =
zero.
3.13
1 ± j. The system is not BIBO because of the pole at
(b) For x(t) = cos(2t)u(t)
Y (s) =
y(t) = e
t
s2 + 4
s
1
=
s((s + 1)2 + 1) s2 + 4
(s + 1)2 + 1
cos(t)u(t), and limt!1 y(t) = 0.
(c) When x(t) = sin(2t)u(t)
Y (s)
=
=
s2 + 4
2
2
=
s((s + 1)2 + 1) s2 + 4
s((s + 1)2 + 1)
1 B + C(s + 1)
1
B
C(s + 1)
+
= +
+
s
(s + 1)2 + 1
s (s + 1)2 + 1 (s + 1)2 + 1
giving a steady state yss (t) = 1.
Although not needed to find the steady state, the values of B are obtained as follows

1
2
s 2
B + C(s + 1)
1 =
=
2
2
s (s + 1) + 1
(s + 1) + 1
(s + 1)2 + 1
so that B = C =
1.
(d) If x(t) = u(t) then
Y (s) =
s2 + 4
+ 1)2 + 1)
s2 ((s
the response is a ramp and exponentially decaying sinusoids, so the steady state will be infinity or
no steady–state response.
(e) The pole/zero cancellations in the first two cases permit us to find bounded responses for this
unstable system. However when the input is u(t) there is no pole/zero cancellation and the output
is unbounded.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.14
3.14 (a)–(c) h1 (t) is unbounded and corresponds to an unstable causal system,
h2 (t) is absolutely integrable and corresponds to a non–causal stable system,
h3 (t) is unbounded and corresponds to an unstable anti–causal system. The transfer functions are
2/3
1/3
+
ROC: > 1
s+2 s 1
2/3
1/3
H2 (s) =
ROC: 2 < < 1
s+2
s+1
2/3
1/3
2/3
1/3
H3 (s) =
=
ROC:
s 2
s+1
s+2
s+1
H1 (s) =
j⌦
⇥
2
(a)
⇥
2
⇥
1
(b)
2
j⌦
j⌦
⇥
1
<
⇥
2
⇥
1
(c)
Figure 3.2: Problem 14: ROCs of (a) H1 (s), (b) H2 (s), (c) H3 (s).
only the region of convergence of the second transfer function includes the j⌦-axis and so it is the one
corresponding to a stable system, the others correspond to unstable systems as determined using the
impulse response. See Fig. 3.2 for the ROCs. (d) Independent of whether the LTI is causal, non-causal
or anti-causal, the system is BIBO stable if the ROC of the corresponding transfer function contains the
j⌦ axis.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.15
3.15
(a) S(s) = H(s)X(s), so H(s) = S(s)/X(s) = sS(s)
✓
◆
0.5
1
0.5
1
H(s) = s
+
=
s
s+1 s+2
(s + 1)(s + 2)
(b) If u(t) ! s(t) are input-output pairs, then
or in the Laplace domain:
Input
(t) = du(t)/dt
Rt
r(t) = 1 u(t0 )dt0
Output
h(t) = ds(t)/dt
Rt
⇢(t) = 1 s(t0 )dt0
Input
L[u(t)] = 1/s
L[ (t)] = sL[u(t)] = 1
L[r(t)] = (1/s)L[u(t)] = 1/s2
Output
S(s)
H(s) = sS(s)
⇢(s) = S(s)/s
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.16
3.16
(a) The transfer function is
H(s) =
1
s+a
e ae s
1 e (s+a)
=
s+a
s+a
because pole/zero cancellation at s =
(b) Pole s =
sk = a
ROC: whole s plane
a.
a; zeros are values of s such that e (s+a) = 1 = ej2⇡k for k = 0, ±1, ±2, · · · , or
j2⇡k (the zero s0 = a cancels the pole at s = a).
(c) As a ! 0
H(s) =
1
e
s
s
(d) Pole s = a and zeros sk = a j2⇡k; pole/zero cancellation when k = 0. As a ! 0 the
remaining zeros move towards the j⌦ axis.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.17
3.17
(a) H(s) = Y (s)/X(s) = 1/(s2 + 4) so that (s2 + 4)Y (s) = X(s) giving
d2 y(t)
+ 4y(t) = x(t)
dt2
(b) The Laplace transform including initial conditions is
dy(0)
+ 4Y (s) = X(s)
dt
(s2 + 4)Y (s) = 1 + X(s)
1 + X(s)
Y (s) = 2
= 0 ) X(s) = 1
s +4
or x(t) =
(t)
s2 Y (s)
y(0)s
(c) Assuming initial conditions y(0) and y 0 (0), the Laplace transform of Y (s) is
Y (s) =
and if Y (s) = 0 then
X(s)
sy(0) + y 0 (0)
+
s2 + 4
s2 + 4
sy(0) + y 0 (0) + 1 = 0
after replacing X(s) = 1. Thus y(0) = 0 and y 0 (0) =
1
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.18
3.18
(a) Poles satisfy the identity e s = 1 = ej2⇡k for k = 0, ±1, ..., so there are an infinite number of
poles, sk = j2⇡k. No zeros. The system is unstable because of poles on j⌦-axis.
+
x(t)
y(t)
Delay
y(t
1)
Figure 3.3: Problem 18
(b) Y (s)(1 e s ) = X(s) gives y(t) = y(t 1) + x(t). A positive feedback system with a delay in
the feedback represents the system. See Fig. 3.3.
(c) The transfer function is
H(s) =
1
1 e
with inverse
h(t) =
s
=
1
X
(e
s n
)
n=0
1
X
(t
n)
n=0
which is not absolutely integrable
Z
1
1
|h(t)|dt =
1 Z
X
n=0
1
1
(t
n)dt =
1
X
n=0
1!1
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.19
3.19
(a) h(t) is a triangular pulse of duration 2, then for any T
y(t) = [x ⇤ h](t) =
1
X
h(t
kT )
k=0
If T = 1, the triangular pulses superpose to give square pulses after t = 1 so
8
< 0 t<0
t 0t1
y(t) =
:
1 t>1
If T = 2, y(t) is a sequence of triangular pulses for t
y(t)
0. See Fig. 3.4.
T =1
1
···
t
1
T =2
y(t)
1
···
t
4
2
Figure 3.4: Problem 19
(b) The transfer function is
H(s) =
1
(1
s2
2e
s
+e
2s
)=
2e s
(0.5es
s2
1 + 0.5e
s
s
2e
)=
(cosh(s)
s2
1)
then for T = 2
Y (s)
=
1
X
k=0
=
=
2e
L[h(t
s
kT )] =
(cosh(s)
s2
cosh(s) 1
s2 sinh(s)
1
X
H(s)e
2ks
= H(s)
k=0
1)
1
1
X
(e
2s k
)
k=0
1
e
2s
=
2e
s
(cosh(s)
s2
Copyright 2014, Elsevier, Inc. All rights reserved.
1)
1
e
s (es
e
s)
Chaparro — Signals and Systems using MATLAB
3.20
3.20
(a) Letting x(t) = (t) so that y(t) = h(t) we get
h(t) = ↵ (t
(b) H(s) = ↵e sT + ↵3 e s3T
H(s) has no poles, its zeros satisfy ↵e
1=e
1e
j⇡
j2⇡k
↵2 e
2T s
2
= (↵ e
sT
+ ↵3 e
= ↵2 e
2T
)e
T ) + ↵3 (t
s3T
3T )
= 0 or (dividing by ↵e
2T ( +j(⌦+⇡/(2T ))
j2T (⌦+⇡/(2T ))
letting s =
sT
> 0)
+ j⌦
, k = 0, ±1, ±2, · · ·
so that
log ↵2
, real part of zeros
2T
(2k 1)⇡
j2T (⌦ + ⇡/(2T )) = jk2⇡ ) ⌦ =
, imaginary part of zeros
2T
✓
◆
log ↵2
(2k 1)⇡
zeros s = + j⌦ =
+j
2T
2T
1 = ↵2 e
2T
)
System is BIBO stable since
=
= log(↵)/T < 0 because 0 < ↵ < 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.21
(a) z(t) = (1
t)[u(t)
x(t)
u(t
=
=
3.21
1)], then
dz(t)
= 1(u(t) u(t 1)) + (1
dt
(t) (u(t) u(t 1))
t)( (t)
(t
1))
(b) For the above x(t)
y(t) = e
2t
u(t)
0.5(1
e
2t
)u(t) + 0.5(1
e
2(t 1)
)u(t
1)
(c) For the second system when the input is x(t) = (t) the corresponding output is y(t) = e
so the transfer function of the second system is
H(s) =
Y (s)
1
=
X(s)
s+2
giving dy(t)/dt + 2y(t) = x(t) = dz(t)/dt.
Copyright 2014, Elsevier, Inc. All rights reserved.
2t
u(t)
Chaparro — Signals and Systems using MATLAB
3.22
(a)
3.22
1
1
(1 2e s + e 2s ) = (1 e s )2
s
s
with the whole s-plane as ROC. Pole s = 0 is cancelled by zero s = 0. The transfer function is
X(s) =
H(s) =
Y (s)
s+2
1
1
=
=
+
2
X(s
(s + 1)
s + 1 (s + 1)2
ROC
>0
Using the frequency shift property, the inverse of 1/(s + 1)2 is e t r(t), so
h(t) = e t (1 + t)u(t)
(b) The partial fraction expansion gives
X(s) =
A
Bs + C
+ 2
s
s + 2s + 10
Since the roots of s2 + 2s + 10 = (s + 1)2 + 9 = 0 are
s1,2 =
1 ± j3
the steady state is given by the A/s term. As t ! 1, the terms corresponding to complex roots
goes to zero. We have A = 1/10 and
lim x(t) = 1/10
t!1
(c) The poles of Z(s) are s = 0 and s = 2 ± j1. The inverse transform corresponding to the complex
roots goes to zero in the steady state. Thus
lim z(t) = sZ(s)|s=0 = 1/5
t!1
(d) Since e s simply shifts the inverse by one, it does not affect the steady state. Letting W1 (s) =
1/(s((s 2)2 + 1) the complex poles s12 = 2 ± j have a positive real part so that its response will
grow as t increases and as such there will be no steady–state.
(e) The partial fraction expansion is
V (s) =
A
B + Cs
+
s
(s + 1)2 + 1
where
A = V (s)s|s=0 = 0.5
so that the steady state is 0.5 since the other term has poles in the left-hand s-plane, s1,2 = 1 ± j1,
which would give a transient. If we subtract 0.5/s from V (s) we obtain the Laplace transform of
the transient, thus
V (s)
0.5
=
s
0.5s
=
(s + 1)2 + 1
0.5s + 0.5
0.5
+
(s + 1)2 + 1 (s + 1)2 + 1
which gives the transient
vt (t) =
0.5e
t
cos(t)u(t) + 0.5e
t
sin(t)u(t)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.23
3.23 (a) Using the Laplace transform
1
s+2
1 e
X(s) =
s
H(s) =
3s
Y (s) = H(s)X(s) =
Letting
F (s) =
1
0.5
=
s(s + 2)
s
0.5
) f (t) = 0.5(1
s+2
then
y(t) = f (t)
f (t
1 e 3s
s(s + 2)
3) = 0.5(1
2t
e
)u(t)
0.5(1
2t
e
e
)u(t)
2(t 3)
)u(t
3)
Graphically, we plot h(⌧ ) and x(t ⌧ ) as functions of ⌧ and shift x(t ⌧ ) from the left to the right and
integrate the overlapping areas to get
8
0
t<0
>
>
>
>
< R
t
e 2⌧ d⌧ = 0.5(1 e 2t )
0t<3
y(t) =
0
>
>
>
>
: Rt
e 2⌧ d⌧ = 0.5(e 2(t 3) e 2t ) t 3
t 3
which can be written as
y(t)
=
=
0.5(1
0.5(1
e
2t
e
2t
)[u(t)
u(t
)u(t)
3)] + 0.5[e
0.5(1
e
2(t 3)
2(t 3)
)u(t
e
2t
]u(t
3)
3)
coinciding with the result obtained using the Laplace transform.
(b) Using Laplace transform
H1 (s) =
Y1 (s) =
1
1
e
s
2e
s
X1 (s) = H(s)
s
+e
2s
s2
so that
y1 (t) = r(t)
2r(t
1) + r(t
2)
a triangular pulse.
Graphically, letting x1 (⌧ ) and h1 (t ⌧ ) (moving from left to right) be functions of ⌧ , and integrating
their overlap gives
8
0
t<0
>
>
>
>
>
Rt
>
>
>
0t<1
< 0 d⌧ = t
y1 (t) =
R1
>
>
>
d⌧ = 1 t + 1 = 2 t 1  t < 2
>
t 1
>
>
>
>
:
0
t 2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.24
coinciding with the result using the Laplace transform. The signal y1 (t) is smoother than x1 (t) since it
is the output of an averager filter.
(c) Using the Laplace transform, letting h(t) = hi (t), i = 1, 2, 3
H(s) =
1
(H(s))3 =
e
s
(1
s
e s )3
1
=
3
s
3e
s
+ 3e
s3
2s
The support of the output will be 3M .
Copyright 2014, Elsevier, Inc. All rights reserved.
e
3s
Chaparro — Signals and Systems using MATLAB
3.25
3.24 (a) Using the Laplace transform, we have
s+1
(s + 1)2 + 1
Y (s)
4
X(s) =
=
H(s)
s(s + 1)
H(s) =
The partial fraction expansion of X(s) is
X(s) =
4
4
+
s s+1
which gives
x(t) = 4u(t)
4e t u(t)
(b) Using the Laplace transform
e s )2
s2
1 e s
X1 (s) =
s
Y1 (s)
s(1 e s )2
1 e
H1 (s) =
= 2
=
s
X1 (s)
s (1 e )
s
Y1 (s) =
so that h1 (t) = u(t)
u(t
(1
s
1).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.26
3.25 (a) The Laplace transform of the output for input x(t) is
Y (s) = H1 (s)X(s) =
X(s)
(s + 1)(s
2)
= ··· +
B
C
+
s+1 s 2
where the dots correspond to the partial fraction expansion of the poles of X(s), and we assume that
there is no pole/zero cancellation. Then
lim y(t) ! 1
t!1
because the system is unstable due to the s = 2 pole in the right-hand s-plane, as it would have an inverse
Ce2t u(t) which grows as time increases.
(b) In this case, the Laplace transform of the output for any bounded input x(t) is
Y (s) = H2 (s)X(s) =
X(s)
B
C
= ··· +
+
(s + 1)(s + 2)
s+1 s+2
then assuming no pole/zero cancellation
lim y(t) ! 0
t!1
because the system is stable (poles in the left s-plane), and all the poles of Y (s) are in the left-hand
s-plane. All terms have as inverse a signal that decays as t increases.
Since the input is bounded, the output should also be bounded for the system to be BIBO stable, but we
only know that the steady state goes to zero. So the fact that y(t) tends to zero simply tells that there is
the possibility that the system is not unstable, unfortunately it does not imply the system is stable. The
condition for stability is that the impulse response of the system be absolutely integrable or that the poles
of the transfer function be in the left-hand s-plane, which in this case are, so the system is BIBO stable.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.27
3.26 (a) The impulse response of the system is of the form
h(t) = Ae
Given that the poles of H(s) are s1,2 =
Since | cos(2t + ✓)|  1 we have
then
The value A is found to be
A = H(s)(s + 1
Z
1
1
t
cos(2t + ✓)u(t)
1 ± j2, the impulse response will go to zero as t ! 1.
|h(t)|  |A|e t u(t)
|h(t)|dt  |A|
j2)|s=
1+j2
=
Z
1
0
e t dt = |A|
1
1
=
= 0.25e
1 + j2 + 1 + j2
j4
j⇡/2
so the integral is bounded by 0.25 < 1, so the system is stable.
(b) For input x(t) = u(t) we have
Y (s) =
1
A
= + ···
2
s((s + 1) + 4)
s
where · · · are the terms corresponding to the poles due to the system which are in the left-hand s-plane
and so their inverse will go to zero. Computing
A = Y (s)s|s=0 =
1
5
the steady state response is yss (t) = 0.2.
(c) If x(t) = tu(t), then X(s) = 1/s2 , and
Y (s) =
1
s2 ((s + 1)2 + 4)
the steady state is only due to the double pole s = 0, since the others would have a zero steady state (they
are in the left hand s-plane). The partial fraction expansion is
Y (s) =
a
b c + (s + 1)d
+ +
2
s
s (s + 1)2 + 4
we need only to find the values of a and b to find the steady state, the other term will give zero in the
steady state. But if a 6= 0, the steady state response is of the form
yss (t) = [at + b]u(t) ! 1
To find the value of a multiply both sides by s2 to get
Y (s)s2 = a + bs +
(c + (s + 1)d)s2
(s + 1)2 + 4
and letting s = 0 we have
1
5
and thus the steady state response is infinite. The double pole at the origin causes an infinite steady state,
when the pole at the origin is simple the steady state is finite as in part (c).
(d) The input x(t) = tu(t) is not bounded since there is no finite value M such that |x(t)| < M < 1,
since the signal continuously grows. Since the input is not bounded the system will not be able to generate
a bounded output even if the system is stable.
a = Y (s)s2 |s=0 =
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.27 (a) Use
=t
3.28
⌧ as a new variable in the integral to get
y(t) =
1
T
Z
0
x(t
Z
1
T
)d =
T
T
x(t
)d
0
so that the impulse response of the analog averager is
h(t) =
1
[u(t)
T
u(t
T )]
a causal pulse of magnitude 1/T from 0 to T .
(b) If the input is
x(t) = u(t)
u(t
2)
and the impulse response is h(t) = u(t) u(t 1). Taking x(⌧ ) as the fixed part of the integrand and
h(t ⌧ ) as the shifting part (as functions of ⌧ ) graphically the convolution integral gives
y(t) = r(t)
r(t
1)
r(t
2) + r(t
3)
This can be seen by considering that for negative values of t the averager gives zero; when t
0 and
t 1 < 0, or 0  t < 1, the averager gives t ; when t 1 0 and t < 2, or 1  t < 2, gives a constant
value of 1 ; when t 2 and t 1 < 2, or 2  t < 3, the averager gives 3 t, and finally when t > 3 the
averager’s output is zero.
(c) Using Laplace we have
H(s) =
1
(1
s
e
s
X(s) =
1
(1
s
e
2s
Y (s) = X(s)H(s) =
1
[1
s2
e
s
)
)
so that
e
2s
+e
3s
and so
y(t) = r(t)
r(t
1)
r(t
2) + r(t
3)
coinciding with the graphical result.
Copyright 2014, Elsevier, Inc. All rights reserved.
]
Chaparro — Signals and Systems using MATLAB
h(t
t
1
⇤)
3.29
x(⇥ )
1
2
t
y(t)
1
1
2
3
t
Figure 3.5: Problem 27: Graphical convolution integral
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.30
3.28 (a) The poles of H(s) are at s = 0 and s = 1 ± j1, and the zeros are at s = ±j2. This system is not
BIBO stable because of the pole at the origin, the impulse response will not be absolutely integrable.
(b) If x(t) = 2 cos(2t)u(t) then
s
X(s) = 2 2
s +4
and thus
2
Y (s) =
(s + 1)2 + 1
i.e., the pole at s = 0 and the zeros are cancelled by the transform of the cosine. The remaining poles are
in the left-hand s-plane and so the steady state is zero.
This is a very special case because of the cancellation of the pole at s = 0 and the numerator due to
the used input. The system is not stable, and the frequency response does not exist for all frequencies.
Indeed it is infinite whenever the input frequency is 0.
(c) The input cannot be a sine of the same frequency because its Laplace transform does not cancel the
pole at zero and so the steady state is not zero.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.31
3.29 (a) Negative feedback
Y (s)
C(s)
H(s)(C(s)
H(s)
1 + H(s)
G(s)
=
Y (s)
=
G(s)
=
G1 (s)
=
Y (s)
=
G1 (s)
=
G(s) =
1/(s + 1)
1
=
1 + 1/(s + 1)
s+2
Y (s))
(b) Positive feedback
Y (s)
C(s)
H(s)(C(s) + Y (s))
H(s)
1 H(s)
(c) Negative feedback gives
while positive feedback gives
G1 (s) =
1
1/(s + 1)
1
=
1/(s + 1)
s
The Laplace transform of the output when C(s) = 1/s is for negative feedback
Y (s) = G(s)C(s) =
so that y(t) = 0.5u(t) 0.5e
For the positive feedback
2t
1
0.5
=
s(s + 2)
s
0.5
s+2
u(t).
Y (s) = G1 (s)C(s) =
1
s2
so that y(t) = r(t) which will go to 1 as t ! 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.30
3.32
(a) The transfer function of the overall system is
G(s) =
H(s)
2
=
1 + KH(s)
s + 2K
1
for the pole to be in the left-hand s-plane we need 2K 1 > 0 or K > 0.5, for instance K = 1
which gives a pole at s = 1 so that the impulse response of the feedback system is g(t) =
2e t u(t) which is absolutely integrable.
(b) We have
i. The transfer function of an all-pass filter is of the form
Hap (s) = K
Ys
k
for
k,
m
s+
k
Y (s
k m
+ j⌦m )(s
(s + m + j⌦m )(s +
m
m
m
j⌦m )
j⌦m )
> 0.
ii. The all-pass is
s 1
s+1
iii. To cancel the pole at s = 1, so that the gain of the all-pass be unity the gain at s = 0 should be
unity, i.e.,
Hap (0) = K( 1) = 1
Hap (s) = K
so that K =
1 and the filter becomes
Hap (s) =
1 s
s+1
giving a serial connection with a transfer function
G(s) = H(s)Hap (s) =
(s
s+1
1)(s2 + 2s + 1)
(s 1)
1
=
s+1
(s + 1)2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.2
3.33
Problem using MATLAB
3.31 (a) By long division we have that
Y (s) =
4+s+
11s2 + 20s + 9
s3 + 4s2 + 5s + 2
The inverse of the first two terms are 4 (t) and d (t)/dt. The third term is proper rational and its
partial fraction expansion can be found.
(b) Z(s) is not proper rational so we need to divide to get
3s + 5
=1
(s + 1)(s + 2)
Z(s) = 1
2
s+1
1
s+2
so that
2e t u(t)
z(t) = (t)
e
2t
u(t)
Applying the initial–value result we get
z(0) = lim sX(s) ! 1
s!1
given the presence of (t) which is not defined at t = 0.
(c)
X(s) =
where A =
2, B = 7 and C =
A
B
C
+
+
s
s+1 s+2
5 so that
x(t) =
2u(t) + 7e t u(t)
5e
2t
u(t)
% Pr. 3_31
clear all; clf
syms s t w
disp(’>>>>> Inverse Laplace <<<<<’)
x=ilaplace((3*s-4)/(sˆ3+3*sˆ2+2*s))
figure(1)
ezplot(x,[0,10])
axis([0 10 -2.5 .5])
grid
>>>>> Inverse Laplace <<<<<
x = -5*exp(-2*t)+7*exp(-t)-2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.34
−5 exp(−2 t)+7 exp(−t)−2
0.5
0
−0.5
−1
−1.5
−2
−2.5
0
1
2
3
4
5
t
6
7
8
9
10
Figure 3.6: Prob. 31
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.35
3.32 (a) Although the denominator can be obtained by multiplying by hand the three different polynomials, the
function conv can be used to obtain the coefficients of the product of the three polynomials. The steady–
state is obtained by looking at the residue corresponding to the poles s = 0, in this case 1/50 = 0.02
% Pr. 3_32 (a)
clear all; clf
den=conv([1 0],[1 1]); den=conv(den,[1 10 50])
syms s t w
disp(’>>>>> Inverse Laplace <<<<<’)
x=ilaplace((sˆ2+2*s+1)/(den(1)*sˆ4+den(2)*sˆ3+den(3)*sˆ2+den(4)*s+den(5)))
figure(1)
ezplot(x,[0,5])
axis([0 5 0 .1]); grid
>>>>> Inverse Laplace <<<<<
x = -1/50*exp(-5*t)*cos(5*t)+9/50*exp(-5*t)*sin(5*t)+1/50
−1/50 exp(−5 t) cos(5 t)+...+1/50
0.08
0.07
0.06
0.05
0.04
0.03
0.02
0.01
0
0
0.5
1
1.5
2
2.5
t
3
3.5
4
4.5
5
Figure 3.7: Problem 3.32(a)
(b) Separating the given expression into two,
X(s)
=
=
1
se s
s(s + 2) s(s + 2)
0.5
0.5
e s
s
s+2 s+2
giving
x(t) = 0.5u(t)
0.5e
2t
u(t)
e
2(t 1)
u(t
1)
Using the MATLAB script we compute the inverse.
% Pr. 3_32 (b)
clear all; clf
syms s t w
x=ilaplace((1-s*exp(-s))/(sˆ2+2*s))
figure(2)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.36
ezplot(x,[0,5])
axis([0 5 -0.6 0.6])
grid
x =
exp(-t)*sinh(t)-heaviside(t-1)*exp(-2*t+2)
Notice that the expression in the solution obtained from ilaplace
e
t
te
sinh(t)u(t) = e
t
e
2
t
u(t) = 0.5u(t)
0.5e
is identical to the first inverse given above.
exp(−t) sinh(t)−heaviside(t−1) exp(−2 t+2)
0.5
0.4
0.3
0.2
0.1
0
−0.1
−0.2
−0.3
−0.4
−0.5
0
0.5
1
1.5
2
2.5
t
3
3.5
4
4.5
5
Figure 3.8: Prob. 3.32(b)
Copyright 2014, Elsevier, Inc. All rights reserved.
2t
u(t)
Chaparro — Signals and Systems using MATLAB
3.37
3.33 (a) According to the location of the poles 1 and 2, the negative real part 3 indicates a decay and the
imaginary part indicates the frequency ⇡/2 so that within a constant A in the magnitude and a constant
✓ in the phase
x1 (t) = Ae 3t cos((⇡/2)t + ✓)u(t)
The pole at the origin gives
x2 (t) = Bu(t)
so that the signal is the sum x(t) = x1 (t) + x2 (t)
(b) The following script gives the inverse x(t) and its plot.
% Pr. 3_33
num=[ 0 0 0 1];
den=poly([-3+j*pi/2 -3-j*pi/2 0 ])
syms s t w
figure(1)
subplot(121)
[r,p]=pfeLaplace(num,den)
disp(’>>>>> Inverse Laplace <<<<<’)
x=ilaplace(1/(den(1)*sˆ3+den(2)*sˆ2+den(3)*s))
subplot(122)
ezplot(x,[0,5])
axis([0 5 -0.01 .1])
grid
r =
-3.0000 + 1.5708i
-3.0000 - 1.5708i
0
-0.0436 + 0.0833i
-0.0436 - 0.0833i
0.0872
x(t)
0.1
2.5
2
0.08
1.5
1
0.06
0.5
jΩ
p =
0
0.04
−0.5
−1
0.02
−1.5
−2
0
−2.5
−3
−2
−1
0
1
2
3
0
1
2
3
4
t
σ
Figure 3.9: Problem 33
Copyright 2014, Elsevier, Inc. All rights reserved.
5
Chaparro — Signals and Systems using MATLAB
3.38
3.34 (a) If the initial conditions are zero the system is LTI. The Laplace transform of the differential equations
is then
Y (s)[s2 + 0.5s + 0.15] = X(s)
and so
Y (s) =
s2
X(s)
+ 0.5s + 0.15
(b) If the initial conditions are dy(0)/dt = 1 and y(0) = 1 the Laplace transform of the differential
equation is
[Y (s)s2 s 1] + 0.5[sY (s) 1] + 0.15Y (s) = X(s)
which gives
Y (s) =
X(s)
s + 1.5
+
s2 + 0.5s + 0.15 s2 + 0.5s + 0.15
which can be written, with the appropriate definitions, as Y (s) = X(s)/A(s) + I(s)/A(s), so that when
we double the input the Laplace transform of the corresponding output is
2X(s)
I(s)
+
6= 2Y (s)
A(s)
A(s)
thus the system is not LTI.
(c) If x(t) = u(t) then the Laplace transform of the output (including the initial conditions is) after
replacing X(s) = 1/s:
s2 + 1.5s + 1
Y (s) = 3
s + 0.5s2 + 0.15s
when we double the input the Laplace transform of the output (again including the initial conditions) is
Y1 (s) =
s2 + 1.5s + 2
.
s3 + 0.5s2 + 0.15s
The following script is used to obtain the two responses. The second one is not the double of the first, so
the system is not LTI — due to the initial conditions not being zero.
%% Pr. 3_34
clear all; clf
% response to u(t)
den=[1 0.5 0.15 0];
num=[0 1 1.5 1];
syms s t y y1
[p,r]=pfeLaplace(num,den)
disp(’>>>>> Inverse Laplace <<<<<’)
y=ilaplace((num(2)*sˆ2+num(3)*s+num(4))/(den(1)*sˆ3 +den(2)*sˆ2+den(3)*s))
% response to 2u(t)
num=[0 1 1.5 2];
pfeLaplace(num,den)
disp(’>>>>> Inverse Laplace <<<<<’)
y1=ilaplace((num(2)*sˆ2+num(3)*s+num(4))/(den(1)*sˆ3 +den(2)*sˆ2+den(3)*s))
figure(1)
subplot(311)
ezplot(y,[0,40])
axis([0 40 -0.01 11]);grid;title(’Response to u(t)’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.39
subplot(312)
ezplot(y1,[0,40])
axis([0 40 -0.01 15]);grid;title(’Response to 2 u(t)’)
subplot(313)
ezplot(y1-2*y,[0,40]);grid;title(’Difference of two responses’)
axis([0 40 -10 10])
Response to u(t)
10
5
0
0
5
10
0
5
10
0
5
10
15
15
20
25
t
Response to 2 u(t)
30
35
40
30
35
40
30
35
40
10
5
0
10
15
20
25
t
Difference of two responses
0
−10
15
20
t
25
Figure 3.10: Problem 34: Responses y(t) and y1 (t) corresponding to inputs u(t) and 2u(t), the difference
y1 (t) 2y(t) =
6 0 indicates the system is not linear.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.40
3.35 Let A(s) = s2 + 2s + 3 and I(s) = s + 1 then we can write
Y (s) =
X(s)
I(s)
+
A(s)
A(s)
(a) Ignoring the term due to initial conditions (i.e., consider initial conditions equal to zero) we have
Y (s)A(s) = s2 Y (s) + 2sY (s) + 3Y (s) = X(s)
so that using sN as an indicator of taking the N th derivative of the function in the time domain we have
that the inverse of the above equation is the differential equation
d2 y(t)
dy(t)
+2
+ 3y(t) = x(t)
2
dt
dt
(Notice that this can only be done by assuming the IC are zero, otherwise we do not have a clear expression relating the input and the output variables.)
(b) If we compute the Laplace transform of the differential equation found above and assume the initial
conditions are not zero we get
[s2 Y (s)
sy(0)
y 0 (0)] + 2[sY (s)
y(0)] + 3Y (s) = X(s)
which can be written
Y (s)
=
X(s)
sy(0) + y 0 (0) + 2y(0)
+
s2 + 2s + 3
s2 + 2s + 3
which when compared with the equation given at the beginning
I(s) = s + 1 = sy(0) + [y 0 (0) + 2y(0)]
so that y(0) = 1 and y 0 (0) = 1 2y(0) = 1.
(c) Letting the initial conditions be zero, the inverse Laplace transform of
Y (s)
=
s2
X(s)
+ 2s + 3
with X(s) = 1 gives the impulse response
H(s) =
Y (s)
1
=
X(s)
(s + 1)2 + 2
)
1
h(t) = p e
2
t
p
sin( 2t)u(t)
The poles, computed by the following script, are in the open left-hand s-plane so the system is BIBO
stable.
%% Pr. 3_35
num=[0 0 1];
den=[1 2 3];
syms s t h
figure(1)
subplot(121)
[r,p]=pfeLaplace(num,den)
disp(’>>>>> Inverse Laplace <<<<<’)
h=ilaplace(num(3)/(den(1)*sˆ2+den(2)*s+den(3)))
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.41
subplot(122)
ezplot(h,[0,8])
axis([0 8 -0.2 0.4])
grid
>>>>> Poles <<<<<
p = -1.0000 + 1.4142i
-1.0000 - 1.4142i
0 - 0.3536i
0 + 0.3536i
(21/2 sin(21/2 t))/(2 exp(t))
0.4
2
0.3
1.5
1
0.2
0.5
jΩ
r =
0
0.1
−0.5
0
−1
−1.5
−0.1
−2
−2
−1
0
1
2
3
−0.2
0
2
σ
4
t
6
8
Figure 3.11: Prob. 35
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.42
3.36 (a) For zero-state, x(t) = u(t), consider the first term letting X(s) = 1/s:
Yzs (s) =
1
A a + b(s + 1)
= +
s(s + 1)2
s
(s + 1)2
the value of A is found as
A=
1
|s=0 = 1
(s + 1)2
subtracting 1/s from Yzs (s) we get
a + b(s + 1)
(s + 2)
=
(s + 1)2
(s + 1)2
so that b =
1 and a =
1, and
Y (s) =
1
+
s
1 (s + 1)
1
=
(s + 1)2
s
The zero-state response is thus
yzs (t) = [1
te
t
1
(s + 1)2
1
s+1
e t ]u(t)
Using the initial value property we get yzs (0) = lims!1 1/(s + 1)2 = 0.
(b) For the zero-input response, we consider the second term
Yzi (s) =
so that
(s + 1)
1
=
(s + 1)2
s+1
yzi (t) = e t u(t)
(c) The complete response is then
y(t) = yzi (t) + yzs (t) = [1
te t ]u(t)
(d) The steady state is due to the pole at s = 0 and so yss (t) = u(t) and the transient is then yt (t) =
te t u(t). Also you can see that the zero–input response goes to zero in the steady state, i.e., the effect
of the initial conditions disappears as t goes to infinity. Moreover the zero-state response only provides
a steady-state response for the pole at the origin of the s-plane.
(e) The following script is used to compute the different responses
%% Pr. 3_36
syms s t yzs yzi
% zero-state response
num=[0 0 0 1];
den=[1 2 1 0];
figure(1)
subplot(121)
[r,p]=pfeLaplace(num,den);
disp(’>>>>> Inverse Laplace <<<<<’)
yzs=ilaplace(num(4)/(den(1)*sˆ3+den(2)*sˆ2+den(3)*s))
subplot(122)
ezplot(yzs,[0,10])
axis([0 10 -0.1 1.2]); grid;
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
%zero-input response
num=[0 0 1 1];
figure(2)
subplot(121)
[r,p]=pfeLaplace(num,den);
disp(’>>>>> Inverse Laplace <<<<<’)
yzi=ilaplace((num(3)*s+num(4))/(den(1)*sˆ2+den(2)*s+den(3)))
subplot(122)
ezplot(yzi,[0,10])
axis([0 10 -0.1 1.2]); grid;
% complete response
y=yzs+yzi;
figure(3)
ezplot(y,[0,10])
axis([0 10 -0.1 1.2])
grid;
% transient response
yt=y-1;
figure(4)
ezplot(yt,[0,10])
axis([0 10 -0.5 .2]); grid;
Copyright 2014, Elsevier, Inc. All rights reserved.
3.43
Chaparro — Signals and Systems using MATLAB
3.44
1+(−t−1) exp(−t)
1
exp(−t)
1
0.8
0.8
1
1
0.6
0.6
0.4
0.4
0.8
0.2
0.8
0.2
0.6
0
jΩ
jΩ
0.6
0
−0.2
−0.2
0.4
−0.4
0.4
−0.4
0.2
−0.6
−0.8
−0.8
0
−1
−2
−1
0
1
2
3
0.2
−0.6
0
2
4
6
8
0
−1
−2
10
−1
0
t
σ
1
2
3
0
2
4
6
8
10
t
σ
1+(−t−1) exp(−t)+exp(−t)
(−t−1) exp(−t)+exp(−t)
0.1
1
0
0.8
−0.1
0.6
−0.2
0.4
−0.3
0.2
−0.4
0
0
1
2
3
4
5
t
6
7
8
9
10
−0.5
0
1
2
3
4
5
t
6
7
8
9
10
Figure 3.12: Problem 36: Clockwise from top-left: zero-state response, zero-input response, transient response and complete response.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.45
3.37 (a) The transfer function is
1
1
=
s2 + 5s + 6
(s + 2)(s + 3)
H(s) =
so that
Y (s) =
1
A
B
C
=
+
+
s(s + 2)(s + 3)
s
s+2
s+3
where
1
6
A = Y (s)s|s=0 =
B = Y (s)(s + 2)|s=
2
C = Y (s)(s + 3)|s=
so that the total response is
y(t) =

1
6
1
e
2
2t
+
1
2
=
3
1
e
3
=
3t
1
3
u(t)
which starts at y(0) = 0 and in steady state it is 1/6, and in between it increases smoothly from 0 to 1/6.
(b) The transfer function is
1
1
H(s) = 2
=
s + 2s + 6
(s + 1)2 + 5
so that
Y (s) =
a + (s + 1)b
1
A
=
+
s((s + 1)2 + 5)
s
(s + 1)2 + 5
Y (s)
a + (s + 1)b
1
s 2
=
=
6s
6((s + 1)2 + 5)
(s + 1)2 + 5
The value of A = 1/6 and
so that b =
1/6 and a =
1/6 to give
Y (s) =
y(t) =
1/6
s

1
1
6
p
1
5
p ⇥
(s + 1)2 + 5
6 5
p
5
e
5
t
p
sin( 5t)
1
s+1
⇥
6
(s + 1)2 + 5
e
t
p
cos( 5t) u(t)
At t = 0 this signal is zero, and in the steady state it is 1/6, in between the signal oscillates.
%% Pr. 3_37
clear all; clf
num=[0 0 0 1]; den=[1 5 6 0];
% den=[1 2 6 0]; % part (b)
syms s t y
figure(1); subplot(121)
[r,p]=pfeLaplace(num,den);
disp(’>>>>> Inverse Laplace <<<<<’)
y=ilaplace(num(4)/(den(1)*sˆ3+den(2)*sˆ2+den(3)*s))
subplot(122)
ezplot(y,[0,8]); axis([0 8 0 .25]; grid
The results for part (a) are:
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.46
>>>>> Residues <<<<<
r = 0.3333
-0.5000
0.1667
>>>>> Zeros <<<<<
z = Empty matrix: 0-by-1
>>>>> Poles <<<<<
p =
0
-3.0000
-2.0000
>>>>> Inverse Laplace <<<<<
y = 1/6+1/3*exp(-3*t)-1/2*exp(-2*t)
while the results for part (b) are:
>>>>> Residues <<<<<
r =
-0.0833 + 0.0373i
-0.0833 - 0.0373i
0.1667
>>>>> Zeros <<<<<
z =
Empty matrix: 0-by-1
>>>>> Poles <<<<<
p =
0
-1.0000 + 2.2361i
-1.0000 - 2.2361i
>>>>> Inverse Laplace <<<<<
y = -1/6*exp(-t)*cos(5ˆ(1/2)*t)-1/30*5ˆ(1/2)*exp(-t)*sin(5ˆ(1/2)*t)+1/6
(c) Both responses start at 0 and go to the same steady-state value of 1/6, but the first one does it smoothly
(due to the negative real poles) while the second oscillates (due to the complex conjugate poles).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1
3.47
1/6+1/3 exp(−3 t)−1/2 exp(−2 t)
0.25
−1/6 exp(−t) cos(51/2 t)−...+1/6
0.25
3
0.8
0.6
2
0.2
0.2
0.4
1
0.15
0.15
0
jΩ
jΩ
0.2
−0.2
0
0.1
0.1
−1
−0.4
−0.6
0.05
0.05
−2
−0.8
−3
−1
−2
−1
0
1
σ
2
3
0
0
2
4
t
6
8
−1
0
1
σ
2
3
0
0
2
4
t
Figure 3.13: Problem 37: Response for b1 = 5 and b0 = 6 giving double real pole (left), and response for
b1 = 2 and b0 = 6 giving complex conjugate poles.
Copyright 2014, Elsevier, Inc. All rights reserved.
6
8
Chaparro — Signals and Systems using MATLAB
3.48
3.38 (a) The input/output equation for the analog averager is
y(t) =
1
T
Z
t
x(⌧ )d⌧
t T
and its derivative is
dy(t)
1
= [x(t)
dt
T
Likewise if we integrate this from
x(t
1 to t it gives
1
y(t) =
T
Z
Z
t
x(⌧ )d⌧
1
T )]
t
and changing the variable in the second integral to = ⌧
"Z
t
1
y(t) =
x(⌧ )d⌧
T
1
Z
1 t
=
x(⌧ )d⌧
T t T
x(⌧
T )d⌧
1
T we get
Z
#
t T
x( )d
1
the equation for the analog averager.
(b) Graphically the convolution gives zero for t < 0; for values of 0  t < T the output is a transient;
and for t > T it is a periodic signal. If we choose T = 2, the period of the sinusoid, (or multiples of
2) the periodic output signal becomes zero—the averager computes the area under the input of a period,
which is zero. It can also be shown analytically, for T = 2
y(t)
=
=
=
Z
1 t
cos(⇡⌧ )d⌧
2 t 2
1 sin(⇡⌧ ) t
|t 2
2
⇡
1
[sin(⇡t) sin(⇡(t
2⇡
(c) The impulse response of the averager is h(t) = 0.5[u(t)
If the input is cos(⇡t)u(t), then
Y (s) = H(s)X(s) =
1
[1
2s
e
2s
2))] = 0
u(t
]X(s) =
t
2)] for the value T = 2 found above.
X(s)
2s
X(s)
e
2s
Replacing X(s) = s/(s2 + ⇡ 2 ) above we have
Y (s) = 0.5
1 e 2s
= Y1 (s)
s2 + ⇡ 2
Y1 (s)e
2s
where Y1 (s) = 0.5/(s2 + ⇡ 2 ) so that
y(t) =
0.5
(sin(⇡t)u(t)
⇡
sin(⇡(t
2
2)u(t
2))
Copyright 2014, Elsevier, Inc. All rights reserved.
2s
Chaparro — Signals and Systems using MATLAB
3.49
jΩ
%% Prob 3_38
clear all; clf
T=2;
num=[0 0
1/T]
den=[1 0 piˆ2]
syms s t y
figure(1)
subplot(221)
[r,p]=pfeLaplace(num,den);
disp(’>>>>> Inverse Laplace <<<<<’)
y1=ilaplace(0.5/(sˆ2+piˆ2))
subplot(222)
ezplot(y1,[0,8])
axis([0 8 -0.2 0.2]); title(’y_1(t)’)
grid
y=y1-y1*heaviside(t-2)
subplot(223)
ezplot(y,[0,8])
axis([0 8 -0.2 0.2]); title(’y(t)’)
grid
4
0.2
2
0.1
0
0
−2
−0.1
−4
−1
0
1
σ
2
3
6
8
−0.2
y1(t)
0
2
4
t
6
8
y(t)
0.2
0.1
0
−0.1
−0.2
0
2
4
t
Figure 3.14: Prob. 38 Poles/zeros of Y1 (s) (top–left) , y1 (t) and y(t) (bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.50
3.39 (a) If X(s) = 1/s then
X(s)(s + 1)
s2 + 2s + 4
so that the differential equation connecting the input x(t) and the output y1 (t) is
Y1 (s) =
d2 y1 (t)
dy1 (t)
dx(t)
+2
+ 4y1 (t) = x(t) +
dt2
dt
dt
Similarly,
X(s)s
s2 + 4s + 4
so that the differential equation connecting the input x(t) and the output y2 (t) is
Y2 (s) =
d2 y2 (t)
dy2 (t)
dx(t)
+4
+ 4y2 (t) =
2
dt
dt
dt
Finally,
Y3 (s) =
X(s)(s 1)
s(s2 + 2s + 10)
so that the differential equation connecting the input x(t) and the output y3 (t) is
d3 y3 (t)
d2 y3 (t)
dy3 (t)
dx(t)
+
2
+ 10
= x(t) +
3
2
dt
dt
dt
dt
p
(b) For Y1 (s) its poles are s = 0 and s = 1 ± j 3 and a zero at s = 1, its general solution is of the
form
p
y1 (t) = [A + Be t cos( 3t + ✓)]u(t)
For Y2 (s) its poles are s =
2 (double) and no zero, its general solution is of the form
y2 (t) = [Be
2t
+ Cte
2t
]u(t)
For Y3 (s) its poles are s = 0 (double) and s = 1 ± j3 and a zero at s = 1, its general solution is of the
form
y3 (t) = [A + Bt + Ce t cos(3t + ✓)]u(t)
The values of the coefficients of the partial fraction expansion (also called residues), the inverse and the
plot of the response is computed using MATLAB.
%% Prob 3_39
num=[0 0 1 1]; % numerator of Y1
% num=[0 0 1];
% numerator of Y2
% num=[0 0 0 1 -1]; % numerator of Y3
den=[1 2 4 0]; % denominator of Y1
% den=[1 4 4];
% denominator of Y2
% den=[1 2 10 0 0]; % denominator of Y3
syms s t y
figure(1)
subplot(121)
[r,p]=pfeLaplace(num,den)
disp(’>>>>> Inverse Laplace <<<<<’)
y1=ilaplace((num(3)*s+num(4))/(den(1)*sˆ3+den(2)*sˆ2+den(3)*s));y=y1
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.51
% y2=ilaplace(num(3)/(den(1)*sˆ2+den(2)*s+den(3)));y=y2
% y3=ilaplace((num(4)*s+num(5))/(den(1)*sˆ4+den(2)*sˆ3+den(3)*sˆ2));y=y3
subplot(122)
ezplot(y,[0,10])
axis([0 10 -1 1])
grid
For the three cases we have the residuals (r) the corresponding poles (p) and the complete responses.
%% case 1
r = -0.1250 - 0.2165i
-0.1250 + 0.2165i
0.2500
p = -1.0000 + 1.7321i
-1.0000 - 1.7321i
0
y1 = 1/4-1/4*exp(-t)*cos(3ˆ(1/2)*t)+1/4*3ˆ(1/2)*exp(-t)*sin(3ˆ(1/2)*t)
%% case 2
r =
0
1
p = -2
-2
y2 = t*exp(-2*t)
%% case 3
r = -0.0600 + 0.0033i
-0.0600 - 0.0033i
0.1200
-0.1000
p= -1.0000 + 3.0000i
-1.0000 - 3.0000i
0
0
y3= 3/25-3/25*exp(-t)*cos(3*t)-1/150*exp(-t)*sin(3*t)-1/10*t
1/4−...+1/4 31/2 exp(−t) sin(31/2 t)
1
0.2
0.45
0.5
0.8
0.18
0.4
0.6
0.16
1
0.35
0.4
0.14
0.5
0.3
0.2
0.12
0
0.25
0
t exp(−2 t)
3/25−3/25 exp(−t) cos(3 t)−...−1/10 t
4
2.5
2
−0.5
0.2
−1
−0.1
−0.4
jΩ
−0.5
−1
−0.6
0.06
−0.4
0.1
−0.3
0
0.08
−0.7
−2
0.04
−0.6
−0.8
0.02
−2
−0.2
1
0.1
−0.2
0.15
−1.5
0.05
−3
−0.8
−0.9
0
−2.5
−2
3
2
jΩ
jΩ
1.5
0
−1
0
1
σ
2
3
0
0
2
4
6
t
8
10
−1
−3
−2
−1
0
σ
1
2
3
0
2
4
6
8
10
−4
−1
t
0
1
2
3
−1
σ
Figure 3.15: Problem 39: Poles/zeros and response for cases (1) (left) to (3) (right).
Copyright 2014, Elsevier, Inc. All rights reserved.
0
2
4
6
t
8
10
Chaparro — Signals and Systems using MATLAB
3.52
3.40 The pulse is given by
x(t) = u(t + 0.5)
u(t
0.5)
with Laplace transform
X(s) =
1 0.5s
(e
s
e
0.5s
)
(a) Then if y2 (t) = (x ⇤ x)(t) its Laplace transform is
Y2 (s) =
1 s
(e
s2
2+e
s
)
which gives
y(t) = r(t + 1)
2r(t) + r(t
1)
a triangular signal.
(b) The Laplace transform of y3 (t) is
Y3 (s) = L[(y2 ⇤ x)(t)] =
If we call (t) = L
1
(1/s3 ) =
t3
6 u(t)
y3 (t) = (t + 1.5)
1 1.5s
[e
s3
3e0.5s + 3e
0.5s
e
1.5s
]
we have that
3 (t + 0.5) + 3 (t
0.5)
(t
1.5)
%% Pr. 3_40
syms s t x y
y1=heaviside(t+0.5)-heaviside(t-0.5);
y2=(t+1)*heaviside(t+1)-2*t*heaviside(t)+(t-1)*heaviside(t-1);
y3=(0.5*(t+1.5)ˆ2)*heaviside(t+1.5)-3*(t+0.5)ˆ2/2*heaviside(t+0.5)+3*(t-0.5)ˆ2/2*heav
y3=y3-(0.5*(t-1.5)ˆ2)*heaviside(t-1.5)
figure(1)
subplot(311)
ezplot(y1,[-2,2])
axis([-2 2 -0.1 1]);grid
subplot(312)
ezplot(y2,[-2,2])
axis([-2 2 -0.1 1]);grid
subplot(313)
ezplot(y3,[-2,2])
axis([-2 2 -0.1 1]); grid
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.53
heaviside(t+1/2)−heaviside(t−1/2)
1
0.5
0
−2
−1.5
−1
−0.5
0
t
0.5
1
1.5
2
1.5
2
1.5
2
(t+1) heaviside(t+1)−...+(t−1) heaviside(t−1)
1
0.5
0
−2
−1.5
−1
−0.5
0
t
0.5
1
1/2 (t+3/2)2 heaviside(t+3/2)−...−1/2 (t−3/2)2 heaviside(t−3/2)
1
0.5
0
−2
−1.5
−1
−0.5
0
t
0.5
1
Figure 3.16: Prob. 40
(c) y3 (t) is the smoothest, and its support is also the largest.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.54
3.41 (a) The two expressions for y1 (t) are equivalent. Indeed, since
sin(2⇡(t
0.5)) = sin(2⇡t
⇡) =
sin(2⇡t)
then
y1 (t)
=
sin(2⇡t)u(t) + sin(2⇡(t
0.5))u(t
=
sin(2⇡t)u(t)
sin(2⇡t)u(t
=
sin(2⇡t)[u(t)
u(t
0.5)
0.5)
0.5)]
Graphically, the following MATLAB script also shows the two expressions for x1 (t) are identical.
%% Prob 3_41
figure(1)
syms t
x1=sin(2*pi*t)*heaviside(t)+sin(2*pi*(t-0.5))*heaviside(t-0.5);
x2=sin(2*pi*t)*(heaviside(t)-heaviside(t-0.5));
subplot(211)
ezplot(x1,[0 4]); axis([0 4 -1.1 1.1])
subplot(212)
ezplot(x2,[0 4]); axis([0 4 -1.1 1.1])
sin(2 π t) heaviside(t)+sin(2 π (t−1/2)) heaviside(t−1/2)
1
0.5
0
−0.5
−1
0
0.5
1
1.5
2
t
2.5
3
3.5
4
3
3.5
4
sin(2 π t) (heaviside(t)−heaviside(t−1/2))
1
0.5
0
−0.5
−1
0
0.5
1
1.5
2
t
2.5
Figure 3.17: Problem 41: Plots for equivalent expressions for x1 (t)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.55
The Laplace transform of y1 (t) is then, using the first expression,
Y1 (s) = L[sin(2⇡t)u(t) + sin(2⇡(t
0.5))u(t
0.5)] =
s2
2⇡
[1 + e
+ 4⇡ 2
(c) The half-rectified signal y(t) can be written
y(t) =
1
X
y1 (t
k)
k=0
Since the Laplace transform of y1 (t
Y (s)
⌧ ) is Y1 (s)e
s
⌧s
then
+e
2s
=
Y1 (s)[1 + e
=
2⇡(1 + e 0.5s )
(s2 + 4⇡ 2 )(1 e s )
+ ···] =
Y1 (s)
1 e s
Copyright 2014, Elsevier, Inc. All rights reserved.
0.5s
]
Chaparro — Signals and Systems using MATLAB
3.56
3.42 (a)(b) The following script shows how to do polynomial multiplication using conv function.
The multiplication of the polynomials
P (s) = s2 + s + 1 and Q(s) = 2s3 + 3s2 + s + 1
gives
Z(s) = P (s)Q(s) = 2s5 + 5s4 + 6s3 + 5s2 + 2s + 1
The script shows how to obtain this result in the Poly Multiplication part of the script.
In the Application part of the script we show how to find the numerator N1 (s) and the denominator
D1 (s) of Y (s) by multiplying X(s) and H(s) to give
Y (s) =
X(s)N (s)
(s + 2)
= 2
D(s)
s (s + 1)((s + 4)2 + 9)
so that the poles of Y (s) are s = 0 (double), and s = 4 ± j3, and no zeros. The double pole gives a
ramp and the other poles a modulated sinusoid by a decaying exponential.
% Pr. 3_42
% Poly multiplication
% coefficients of higher to lower orders of s
P=[1 1 1];Q=[2 3 1 1];
Z=conv(P,Q);
% Application
d1=[1 1]; d2=[1 8 25]; D=conv(d1,d2);
d3=[1 0 0]; den=conv(D,d3)
N=length(den)
num=[ zeros(1,N-2) 1 2]
syms s t y
figure(1)
subplot(121)
[r,p]=pfeLaplace(num,den);
disp(’>>>>> Inverse Laplace <<<<<’)
y=ilaplace((num(N-1)*s+num(N))/(den(1)*sˆ5+den(2)*sˆ4+den(3)*sˆ3+den(4)*sˆ2+den(5)*s+d
subplot(122)
ezplot(y,[0,50])
axis([0 50 -0.1 1.5]); grid
den = 1
9
33
25
num = 0
0
0
0
>>>>> Zeros <<<<<
z = -2
>>>>> Poles <<<<<
p = -4.0000 + 3.0000i
-4.0000 - 3.0000i
-1.0000
0
0
>>>>> Residues <<<<<
r = 0.0050 - 0.0026i
0.0050 + 0.0026i
0.0556
0
1
0
2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
3.57
-0.0656
0.0800
>>>>> Inverse Laplace <<<<<
y = -41/625+1/18*exp(-t)+2/25*t+113/11250*exp(-4*t)*cos(3*t)
+59/11250*exp(-4*t)*sin(3*t)
4
4.5
3
4
−41/625+...+59/11250 exp(−4 t) sin(3 t)
3.5
2
3
1
jΩ
2.5
0
2
−1
1.5
−2
1
−3
0.5
−4
0
−4
−2
0
σ
2
0
10
20
30
40
t
Figure 3.18: Prob. 42: Poles/zeros of Y (s) and y(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
50
Chaparro — Signals and Systems using MATLAB
3.58
3.43 (a) The Laplace transform of the error e(t) is given by
E(s) = X(s)
V (s) = X(s)
or
E(s) =
H(s)Y (s) = X(s)
H(s)G(s)E(s)
X(s)
1 + H(s)G(s)
(b) Replacing X(s) = 1/s, H(s) = 1 and G(s) = 1/(s(s + 1)(s + 2)) = 1/D(s) we get
E1 (s)
=
=
X(s)
1
=
1 + H(s)G(s)
s(1 + 1/D(s))
D(s)
(s + 1)(s + 2)
=
s(D(s) + 1)
s(s + 1)(s + 2) + 1
the final value result indicates that
lim e1 (t) = lim sE1 (s) = 0
t!1
s!0
or e1ss = 0.
(c) If x(t) = r(t), then the Laplace transform of the error is
E2 (s) =
X(s)
1
= 2
1 + H(s)G(s)
s (1 + 1/D(s))
and in this case the final value theorem give
lim e2 (t)
t!1
=
=
lim sE2 (s)
s!0
1
=2
s!0 s(1 + 1/D(s))
lim
%% Pr. 3_43
syms e1 e2 t
figure(1)
[r1,p1]=pfeLaplace([0 1 3 2],[1 3 2 1])
e1=r1(1)*exp(p1(1)*t)+r1(2)*exp(p1(2)*t)+r1(3)*exp(p1(3)*t)
figure(2)
[r2,p2]=pfeLaplace([0 1 3 2],[1 3 2 1 0] )
e2=r2(1)*exp(p2(1)*t)+r2(2)*exp(p2(2)*t)+r2(3)*exp(p2(3)*t)+r2(4)*exp(p2(4)*t)
figure(3)
subplot(211)
ezplot(e1,[0,10])
axis([0 10 -1 2]); grid;title(’error for u(t)’)
subplot(212)
ezplot(e2,[0,10])
axis([0 10 0 5]); grid;title(’error for r(t)’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.5
3.59
error for u(t)
2
1.5
1.5
1
1
1
0.5
0.5
0
0
0.5
0
−0.5
jΩ
jΩ
−1
0
1
2
3
4
5
−0.5
−0.5
−1
−1
−1.5
−1.5
5
t
6
7
8
9
10
6
7
8
9
10
error for r(t)
4
3
2
1
−3
−2
−1
0
σ
1
2
3
−3
−2
−1
0
1
2
3
0
0
1
σ
2
3
4
5
t
Figure 3.19: Prob. 43: Poles/zeros of E1 (s) and E2 (s) and corresponding errors e1 (t), e2 (t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
Copyright 2014, Elsevier, Inc. All rights reserved.
3.60
Chapter 4
Frequency Analysis: the Fourier Series
4.1
4.1
Basic Problems
(a) If x(t) = ej⇡t/4 is the non-linear system input, the output is
y(t) = x2 (t) = ej⇡t/2
which cannot be written as a constant (function of the input frequency ⇡/4 only) times x(t). Thus,
the eigenfunction property does not hold for this non-linear system.
(b) For x(t) = ej⇡t/4 the input to the time-varying system, the output is
y(t) = ej⇡t/4 [u(t)
u(t
1)] 6= constant in ⇡/4 ⇥ x(t)
so the eigenfunction property does not hold for this time-varying system.
1
Chaparro — Signals and Systems using MATLAB
4.2
4.2 (a) Replacing x(⌧ ) = ej⌦0 ⌧ in the integral for the averager we get
1
T
Z
t
ej⌦0 ⌧ d⌧
1 ej⌦0 t ej⌦0 (t T )
T
j⌦0

1 e j⌦0 T
ej⌦0 t
j⌦0 T
=
t T
=
where according to the eigenfunction property H(j⌦0 ), the frequency response of the system for ⌦0 , is
the term in the square brackets.
(b) By a change of variable,
=t
⌧ , the equation for the averager is
y(t) =
1
T
Z
T
x(t
)d
0
which is a convolution integral with impulse response h(t) = (1/T )[u(t) u(t T )]. The transfer
function of the system is H(s) = (1/sT )[1 e sT ] and if we let s = j⌦0 we get the above response.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.3
(a)
4.3
i. The sinusoidal components of x1 (t) have periods T1 = 1 and T2 = 1/3, with ratio T1 /T2 = 3
so that x1 (t) is periodic of fundamental period T1 = 3T2 = 1.
The periods of the sinusoidal components of x2 (t) are T1 = 1 and T2 = 2⇡/6, their ratio is
T1 /T2 = 3/⇡, not a rational number so x2 (t) is not periodic.
ii. Trigonometric Fourier series of x1 (t), with fundamental period T0 = 1 and fundamental frequency ⌦0 = 2⇡, is
x1 (t) = 1 + cos(⌦0 t) cos(3⌦0 t)
iii. For x2 (t), since ⌦2 = 6 cannot be expressed as an integer multiple of ⌦1 = 2⇡ or vice versa,
there is no Fourier series for x2 (t).
(b)
i. For the signal to be periodic of period T0 we must have
x(t + T0 ) =
this is possible if T0 = 2⇡
ii. It can be shown that x(t) =
sin(2(t + T0 ) + ⇡)
= x(t)
sin(t + T0 )
2 cos(t), indeed sin(2t + ⇡) =
sin(2t) =
2 cos(t) sin(t)
so
x(t) =
thus X1 = X
1
=
sin(2t) and
2 cos(t) =
ejt
e
jt
1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.4
4.4
(a) x(t) is a train of pulses with T0 = 2⇡ and ⌦0 = 1. The Fourier series coefficients are
X0
=
Xk
=
=
0 by symmetry in a period
Z 0
Z ⇡
1
( 1)e jkt dt +
(1)e
2⇡
⇡
0

1
(e j⇡k + ej⇡k 2)
1
=
2⇡
jk
jkt
dt =
1
2⇡
cos(⇡k)
j⇡k
Z
⇡
(e
jkt
0
since cos(⇡k) = ( 1)k we get that
Xk =
⇢
0
2j/(⇡k)
k even
k odd
(b) Laplace transform of a period
X1 (s) =
1
(1
s
2e
⇡s
+e
2⇡s
)=
⇡s
2e
s
(cosh(⇡s)
so that the Fourier series coefficients are
Xk =
1
( 1)k+1 (cos(⇡k)
X1 (s)|s=jk = j
2⇡
⇡k
1)
or
Xk =
⇢
0
2j/(⇡k)
k even
k odd
Copyright 2014, Elsevier, Inc. All rights reserved.
1)
ejkt )dt
Chaparro — Signals and Systems using MATLAB
4.5
4.5 (i) Fundamental frequency ⌦0 = 5 so
x1 (t) = (0.5ej⇡/4 )ej5t + (0.5e
and X1 = X ⇤ 1 = 0.5ej⇡/4 .
(ii) We have
x2 (t) =
✓
1 jt
(e
2j
jt
e
)
◆2
j⇡/4
)e
j5t
0.25ej2t
= 0.5
0.25e
j2t
and so X0 = 0.5, X1 = X ⇤ 1 = 0.25 and ⌦0 = 2 is the fundamental frequency.
(iii) Fundamental frequency of x3 (t) is ⌦0 = 1 (ratio of fundamental periods of sinusoidal components
T1 /T2 = (2⇡/3)/(2⇡/5) = 5/3 and ⌦0 = 2⇡/3T1 = 1).
x3 (t) = 0.5ej3⌦0 t + 0.5e
j3⌦0 t
+ 0.5ej5⌦0 t + 0.5e
j5⌦0 t
so that X3 = X 3 = 0.5 and X5 = X 5 = 0.5.
See Fig. 4.1 for magnitude and phase line spectra.
x1(t)
0.8
0.6
∠Xk
|Xk|
0.4
0.2
0
0.4
0.2
0
2
4
0
6
0.6
∠Xk
|Xk|
0.2
4
6
2
1
0
2
4
6
8
0
10
0
2
4
0
1
2
6
8
10
3
4
5
x3(t)
0.6
3
∠Xk
|Xk|
0.4
0.2
0
2
3
0.4
0
0
x2(t)
2
1
0
1
2
kΩ0
3
4
5
0
kΩ0
Figure 4.1: Problem 5
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.6
(a) A period is x1 (t) = t[u(t) u(t
period T0 = 1. See Fig. 4.2.
4.6
1)], its fundamental frequency ⌦0 = 2⇡, and its fundamental
(b) Fourier series coefficients using the integral definition:
Xk
Z 1
1
te
T0 0
j2⇡k + 1
4⇡ 2 k 2
=
=
j2⇡kt
dt =
e
j2⇡kt
( j2⇡kt
( j2⇡k)2
1
j
=
k 6= 0
4⇡ 2 k 2
2⇡k
1)|1t=0
If k = 0, the dc value X0 is
1
X0 =
T0
(c) Since x1 (t) = tu(t)
tu(t
Z
1
tdt =
0
t2 1
|
= 0.5
2 t=0
1) with Laplace transform
X1 (s) =
1
s2
L[tu(t
1)] = L[(t
L[tu(t
1)] where
1)u(t
1) + u(t
1)] =
e s
e s
+
s2
s
The FS coefficients are
Xk
=
=
1
1 e s
L[x1 (t)]|s=j2⇡k =
T0
s2
1 e j2⇡k
e j2⇡k
1
=j
2
(j2⇡k)
j2⇡k
2⇡k
s
e
s
|s=j2⇡k
k 6= 0
By inspection, the mean is X0 = 0.5 (it cannot be calculated using the Laplace transform method).
Notice that the zero-mean signal is odd so the Xk are purely imaginary.
(d) The derivative of x(t) is (see bottom plot in Fig. 4.2):
y(t) =
dx(t)
=1
dt
1
X
(t
k)
k= 1
A period of it is given by y1 (t) = u(t + 0.5) u(t 0.5)
(t) and by the Laplace transform we
have the Fourier series coefficients of y(t) of fundamental period T0 = 1 are
✓
e0.5s
0.5s
◆
sin(k⇡)
1 = 1 and so
k⇡
1
j
using the derivative property Xk =
=
k=
6 0
j2⇡k
2⇡k
Yk =
e
s
1 |s=j2⇡k =
which coincide with the ones obtained before. The X0 cannot be calculated from above.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.7
x(t)
1
···
1
0
···
1
dx(t)
dt
1
( 1)
1
0
1
( 1)
t
2
2
( 1)
···
t
( 1)
Figure 4.2: Problem 6
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.7
(a)
i.
ii.
iii.
iv.
4.8
T0 = 2 since ⌦0 = ⇡.
dc value X0 = 3/4
x(t) is even, since the Xk are real.
For the third harmonic
3
(ej3⇡t + e
4 + 9⇡ 2
j3⇡t
)=
6
cos(3⇡t)
4 + 9⇡ 2
then A = 6/(4 + 9⇡ 2 ).
(b) Since x(1) = 1 then letting t = 1 we have
⇡=4
1
X
k=1
1
2k
1
sin(2k
1)
It is also possible to find a similar expression for other values of t which are not in the discontinuities.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.9
4.8 (a) If T1 = T2 = T0 (⌦0 = 2⇡/T0 ) then the sum
z(t) = x(t) + y(t)
X
=
Xk ejk⌦0 t +
k
X
=
X
Yk ejk⌦0 t
k
[Xk + Yk ]e
jk⌦0 t
k
or Zk = Xk + Yk .
(b) The ratio
T1
=2
T2
indicates that the period of w(t) is T1 = 2T2 so that the fundamental frequencies are related as
⌦2 = 2⇡/T2 = 2⇡/(T1 /2) = 2⌦1
so that the sum
w(t) = x(t) + y(t)
1
X
=
=
k= 1
1
X
Xk ejk⌦1 t +
Wk =
⇢
Yk ej2k⌦1 t
k
Xk ejk⌦1 t +
k= 1
so that
X
Xk
Xk + Yk/2
1
X
`= 1,
even
Y`/2 ej`⌦1 t
k odd
k even
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.9 (a) If the periodic signal
x(t) =
4.10
X
Xk ej⌦0 kt
k
then
y(t) = 2x(t)
3 = (2X0
X
3) +
2Xk ej⌦0 kt
k6=0
is also periodic of period T0 with Fourier coefficients
⇢
2X0 3
Yk =
2Xk
k=0
k 6= 0
The signal
z(t)
=
=
x(t
X
2) + x(t)
2)
[Xk (1 + e
2j⌦0 k
k
=
X
X
Xk ej⌦0 k(t
+
Xk ej⌦0 kt
k
)]ej⌦0 kt
k
is periodic of period T0 and with Fourier series coefficients Zk = Xk (1 + e 2j⌦0 k ).
The signal
X
X
w(t) = x(2t) =
Xk ej⌦0 k2t =
Xm/2 ej⌦0 mt
m even
k
is periodic of period T0 /2, with Fourier series coefficients
⇢
Xk/2 k even
Wk =
0
otherwise
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.10
4.11
(a) The sinusoidal components have periods T1 = 1 and T2 = 1/2 so that T2 /T1 = 1/2. x(t) is
periodic of fundamental period T1 = 2T2 = 1 and ⌦0 = 2⇡.
(b) Expressing
x(t) = 0.5 + 2(ej⌦0 t + e
j⌦0 t
4(ej2⌦0 t + e
)
j2⌦0 t
)
we get X0 = 0.5, X1 = X ⇤ 1 = 2 and X2 = X ⇤ 2 = 4 (See Fig. 4.3). Plotting |Xk |2 indicates
the power at each of the harmonics and it can be seen that the highest power is at 2⌦0 = 4⇡ rad/sec.
|Xk |
4
2
0.5
2
1
0
1
2
k
\Xk
⇡
2
1
0
1
2
k
⇡
Figure 4.3: Problem 10
(c) Comparing
y(t) = 2
2 sin(2⇡t) = 2 + 2 cos(2⇡t + ⇡/2)
with the output obtained from applying the eigenfunction property of LTI:
y(t)
=
0.5|H(j0)| + 4|H(j2⇡)| cos(2⇡t + \H(j2⇡))
8|H(j4⇡)| cos(4⇡t + \H(j4⇡))
gives H(j0) = 4, H(j2⇡) = 0.5ej⇡/2 and H(j4⇡) = 0.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.11
4.12
(a) See Fig. 4.4. Fourier series coefficients (⌦0 = ⇡)
x(t)
1
···
2
4
6
···
t
cos(2)
Figure 4.4: Problem 11
Xk
=
=
=
=
1
2
Z

2
0
1 jt
(e + e
2
jt
)e
jk⇡t
dt =

1 ejt(1 k⇡)
e jt(1+k⇡)
+
4 j(1 k⇡)
j(1 + k⇡)
1 ej2 1
e j2 1
4 j(1 k⇡) j(1 + k⇡)
⇥ j2
1
j(e
e j2 ) + j⇡k(ej2 + e
2
2
4(k ⇡
1)
jk⇡(1 cos(2)) + sin(2)
2(1 k 2 ⇡ 2 )
(b) X1 (s) = L[cos(t)(u(t)
L[cos(t)u(t
2)]
2))] = L[cos(t)u(t)
u(t
=
=
Z
j2
)
=
0
j(1 + k⇡) + j(1
cos(t)u(t
⇤
2)]
Z 1
cos(t)e st dt =
cos(⇢ + 2)e s(⇢+2) d⇢
2
0
Z 1
Z 1
e 2s
cos(2) cos(⇢)e s⇢ d⇢
sin(2) sin(⇢)e
e
k⇡)
1
0
=
2
s⇢
d⇢
0
2s
[cos(2)L[cos(t)u(t)] sin(2)L[sin(t)u(t)]]
✓
◆
cos(2)s
sin(2)
2s
e
s2 + 1
s2 + 1
We then have
Xk
=
=
0.5

s
s2 + 1
jk⇡(1
e
2s
(cos(2)s sin(2))
s2 + 1
s=jk⇡
cos(2)) + sin(2)
2(1 k 2 ⇡ 2 )
which coincides with the expression obtained using the integral.
(c) Setting k = 0 in the above expression, we find the mean is X0 = sin(2)/2. Since the signal
x(t) X0 is neither even nor odd the Fourier coefficients Xk should be complex, as they are.
(d) Letting
cos(t)
=
=
A cos(t 2) + B sin(t 2)
p
A2 + B 2 cos(t 2 tan 1 (B/A))
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.13
which gives
p
A2 + B 2 = 1
tan
1
(B/A) =
2
which are satisfied by A = cos(2) and B = sin(2), indeed A2 +B 2 = (cos(2))2 +(sin(2))2 = 1
and tan 1 (B/A) = tan 1 [ tan(2)] = 2. So that the Laplace transform
L[cos(t)u(t
2)]
=
=
=
L[(A cos(t
2) + B sin(t
2))u(t
AL[cos(t 2)u(t 2)] + BL[sin(t
e 2s (cos(2)s sin(2))
s2 + 1
2)]
2)u(t
which coincides with the result using the Laplace transform obtained before.
Copyright 2014, Elsevier, Inc. All rights reserved.
2)]
Chaparro — Signals and Systems using MATLAB
4.12
4.14
(a) The steady state is
y(t) = 4|H(j2⇡)| cos(2⇡t + \H(j2⇡)) + 8|H(j3⇡)| cos(3⇡t
so H(j2⇡) = 0.5ej⇡ =
input/output.
⇡/2 + \H(j3⇡))
0.5, H(j3⇡) = 0. Nothing else can be learned about the filter from the
(b)
yss (t)
=
1
X
2
|H(j3k/2)| cos(3kt/2 + \H(j3k/2))
k2
k=1
=
2|H(j3/2)| cos(3t/2 + \H(j3/2))
=
2 cos(3t/2
⇡/2)
since for frequencies bigger than 2 the magnitude response is zero.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.13
(a) g1 (t) = dx1 (t)/dt =
X
g(t) =
( 0.5[u(t
0.5[u(t)
u(t
k)
k
u(t
4.15
1)] + 0.5 (t 1) so that
X
1)]) +
0.5 (t k 1) =
k
0.5 +
k
X
0.5 (t
k
periodic of fundamental periodT0 = 1.
(b) Fourier series of g(t) and x(t)
g(t)
=
Gk
=
=
Xk
=
dx(t)
=
dt
1
X
Xk jk⌦0 ejk⌦0 t
k= 1,6=0
jk⌦0 Xk (derivative property) ⌦0 = 2⇡
1 e s
G1 (s)|s=jk2⇡ = 0.5
+ 0.5e s |s=jk2⇡ = 0.5 (definition)
s
0.5
k 6= 0
jk2⇡
The dc term cannot be obtained from g(t), it is calculated by
X0 =
Z
1
( 0.5t)dt =
0.25
0
(c) Fourier series of
y(t) = 0.5 + x(t) = 0.25 +
1
X
Xk ej2⇡kt
k= 1,6=0
the only difference is the dc value.
Copyright 2014, Elsevier, Inc. All rights reserved.
k
1)
Chaparro — Signals and Systems using MATLAB
4.14
4.16
(a)
x(t)
=
=
y(t)
(b)
(jej⇡t/4
je
j⇡t/4
) + 2(ej5⇡t/4 + e
j5⇡t/4
)
2 sin(⇡t/4) + 4 cos(5⇡t/4) = 2 cos(⇡t/4 + ⇡/2) + 4 cos(5⇡t/4)
=
2|H(j⇡/4)| cos(⇡t/4 + ⇡/2 + \H(j⇡/4)) + 4|H(j5⇡/4)| cos(5⇡t/4 + \H(j5⇡/4))
=
4 cos(5⇡t/4
5⇡/4) = 4 cos(5⇡(t
1)/4)
i. The filter is band-pass:
|H(j⌦)|
1
⌦
4.5⇡
1.5⇡
1.5⇡
4.5⇡
\H(j⌦)
⇡/2
⌦
⇡/2
Figure 4.5: Problem 14(b)
ii. According to the frequency response of the band-pass filter y(t) can have a second, third and
fourth harmonics, but since the magnitude of the second and fourth Fourier coefficients are
X2 = X4 = 0, the output has only the third harmonic giving
y(t)
=
2|H(j3⇡)| cos(3⇡t + \H(j3⇡))
=
2 cos(3⇡t
⇡/2).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.15
4.17
(a) x(t) = | cos(⇡t)| is periodic of period T0 = 1 (⌦0 = 2⇡). The dc of x(t) is
X0 =
Z
0.5
cos(⇡t)dt =
0.5
2 sin(⇡/2)
2
=
⇡
⇡
If the low-pass filter has frequency response
⇢
A
⌦c  ⌦  ⌦c , ⌦c < 2⇡
H(j⌦) =
0 otherwise
then
Y0 =
2H(j0)
=1
⇡
for H(j0) = A = ⇡/2.
(b) If x(t) is half-wave rectified signal, then T0 = 2 (⌦0 = ⇡) and
1
X0 =
2
Z
0.5
cos(⇡t)dt =
0.5
1
⇡
so that Y0 = 1/2.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.16
4.18
(a) The fundamental frequency is ⌦0 = ⇡ (T0 = 2), so only the Fourier coefficients corresponding
to k = 0 and k = ±1, i.e., frequencies ⌦ = 0, ±⌦0 , are needed as the filter deletes any other
frequency component.
es 2 + e
x1 (t) = r(t + 1) 2r(t) + r(t 1) ! X1 (s) =
s2
✓
◆
1
1
1 cos(⇡k)
Xk =
(2 cos(⇡k) 2) =
k 6= 0
2 k2 ⇡2
k2 ⇡2
2
X0 = 0.5 (by observation), X1 = X 1 = 2
⇡
(b) Yes, y(t) is periodic of period 2⇡ and dc value 2X0 = 1.
(c) The steady state output is
y(t)
=
=
=
H(j0)X0 + H(j⇡)X1 ej⇡t + H( j⇡)X 1 e

8 ej(⇡t ⇡/2) + e j(⇡t ⇡/2)
2 ⇥ 0.5 + 2
⇡
2
8
1 + 2 cos(⇡t ⇡/2)
|{z}
| {z }
⇡
|{z}
A
B
C
Copyright 2014, Elsevier, Inc. All rights reserved.
j⇡t
s
Chaparro — Signals and Systems using MATLAB
4.17
4.19
(a) The signal in [0, 1] is
x1 (t) = u(t)
so that (T0 = 1, ⌦0 = 2⇡)

1
1
Xk =
(1
s s2
=
e
s
r(t) + r(t
)
=
s=j2⇡k

1
s
1)
s/2
e
s2
j
e j⇡
j
+ 2 2 2j sin(⇡k) =
2⇡k 4⇡ k
2⇡k
(es/2
e
s/2
)
s=j2⇡k
k 6= 0
and by inspection X0 = 0.5. Thus the Fourier series for x(t) is
x(t) = 0.5 +
1
X
k= 1,6=0
j jk2⇡t
e
2⇡k
(b) The derivative of x(t) (from the figure) is
dx(t)
g(t) =
=
dt
with a period between
1+
1
X
(t
k)
k= 1
0.5 and 0.5 of
g1 (t) =
u(t + 0.5) + u(t
0.5) + (t)
and same fundamental frequency ⌦0 as x(t) thus

1 s/2
j
Gk =
(e
e s/2 ) + 1
=
2j sin(⇡k) + 1 = 0 + 1 = 1
s
2⇡k
s=j2⇡k
so that
g(t) =
1
X
ejk2⇡t
k= 1
equal to the derivative of the Fourier series of x(t). Using the derivative Fourier series property
Gk = j⌦0 kXk ) Xk =
1
j
=
j2⇡k
2⇡k
Using these and X0 = 0.5 we can then get the Fourier series for x(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.18
4.20
(a) According to the eigenfunction property of LTI the steady state response corresponding to the given
x(t) = 1 + cos(t + ⇡/4) = cos(0t) + cos(t + ⇡/4) is
yss (t) = |H(j0)| cos(0t + \H(j0)) + |H(j)| cos(t + ⇡/4 + \H(j))
Since
1 j0
e
2
1+j
4 2j
H(j) = H(s) |s=j =
=
= 0.447\ 26.6o
1 + 3j
10
H(j0) = H(s) |s=j0 =
yss (t) = 0.5 + 0.447 cos(t + 18.4o )
(b)
i. The input x(t) = 4u(t) = 4 cos(0t)u(t) in the steady state is 4 cos(0t), i.e., a cosine of
frequency zero, so that its response is
yss (t) = 4|H(j0)| cos(0t + \H(j0)) = 4 ⇥ 0.5 = 2
ii. If x(t) = 4u(t), then in the Laplace transform
Y (s) =
s((s +
1.5)2
4
+ (2
1.52 ))
=
A
+ ···
s
where the · · · stands for terms that have poles in the left-hand s-plane that correspond to the
transient so
yss (t) = A = Y (s)s |s=0 = 2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.19 (a) The derivative of a period of x(t) in
y1 (t) =
4.21
0.5  t  0.5 gives a period
dx1 (t)
= 2 (t + 0.25)
dt
2 (t
0.25)
0.5  t  0.5
of the periodic signal y(t). The Laplace transform of y1 (t) is Y1 (s) = 2e0.25s
Fourier series of y(t) of period T0 = 1, and ⌦0 = 2⇡ (just like x(t)) is
Yk =
1
Y1 (s)|s=j2⇡k = 4j sin(⇡k/2)
T0
giving a Fourier series expansion
y(t) =
X
4j sin(⇡k/2)ej2k⇡t
k
(b) A period of x(t) is
x1 (t) = 2u(t + 0.25)
X1 (s) =
Xk =
2 0.25s
(e
s
2u(t
e
0.25)
0.25s
)
1
sin(⇡k/2)
X1 (s) |s=j2k⇡ = 2
T0
⇡k
so that
x(t) =
X
Xk ej2⇡kt
k
The Fourier series
y(t) =
X
dx(t) X
=
j2⇡kXk ej2⇡kt =
Yk ej2⇡kt
dt
k
where
Yk = j2⇡kXk = 4jk⇡
k
sin(⇡k/2)
= 4j sin(⇡k/2)
⇡k
which coincides with the result in part (a).
Copyright 2014, Elsevier, Inc. All rights reserved.
2e
0.25s
so that the
Chaparro — Signals and Systems using MATLAB
4.22
4.20 (a) The pulse p(t) has an average of zero, so its integral is zero in each period, for kT0  t  (k + 1)T0 ,
k an integer, and T0 = 1. If s1 (t) is the integral of p1 (t) for 0  t  1 we have that
s1 (t)
=
Z
t
p1 (⌧ )d⌧ =
0
Z
t
[x1 (⌧ )
1]d⌧ =
0
Z
t
x1 (⌧ )d⌧
0t1
t
0
Notice that x1 (t) = 2 for 0  t  0.25 and for 0.75  t  1, and zero for 0.25  t  0.75, so for the
given times,
s(0) =
Z
0
2d⌧
0
Z
s(0.25) =
s(0.5) =
Z
s(0.75) =
Z
s(1) =
0=0
0.25
2d⌧
0.25 = 0.25
0
0.25
2d⌧
0.5 = 0
0
Z
0.25
2d⌧
0
0.25
2d⌧ +
0
0.75 =
Z
0.25
1
2d⌧
1=0
0.75
Letting the period of p(t) between 0 and 1 be
p1 (t) = x1 (t)
[u(t)
u(t
1)]
=
[2u(t)
=
u(t)
2u(t
2u(t
0.25) + 2u(t
0.25) + 2u(t
0.75)
0.75)
2u(t
u(t
1)]
[u(t)
1)
its integral gives the period
s1 (t) = 0.25r(t)
0.5r(t
0.25) + 0.5r(t
0.75)
0.25r(t
1)
of s(t), 0  t  1, which can be used to verify the above results.
(b) The pulse p(t) has a period between 0 and 1 equal to
p1 (t) = u(t)
2u(t
0.25) + 2u(t
0.75)
u(t
1)
so that the Fourier series coefficients of p(t) are given by (T0 = 1, ⌦0 = 2⇡)
Pk
=
=
=
1
e 0.5s (e0.5s 2e0.25s + 2e 0.25s
T0 s
1
e j⇡k 2(sin(⇡k) 2 sin(⇡k/2))
⇡k
4
( 1)(k+1) sin(⇡k/2)
⇡k
e
0.5s
)|s=j2⇡k
where we have replaced sin(⇡k) = 0. The value of Pk = 0 when k is even since sin(⇡k/2) = 0 for k
even, and for odd k since sin(⇡k/2) = ( 1)(k+1) then Pk = 4/(⇡k). Since the average of p(t) is zero,
we have that
X 4
p(t) =
ej2⇡kt
k⇡
k, odd
Copyright 2014, Elsevier, Inc. All rights reserved.
u(t
1)]
Chaparro — Signals and Systems using MATLAB
4.23
Since
0.25
e
s2
then (T1 = 0.5 and ⌦1 = 4⇡):
S(s) =
0.5s
Sk =
(e0.5s
2e0.25s + 2e
0.25s
e
0.5s
)=
0.25
P (s)
s
1
0.25
S(s)|s=j⌦1 k = 2
P (s)|s=j4⇡k
T1
s
(c)(d) The integral over a period [ T0 /2, T0 /2] = [ 0.5, 0.5] is
Z
0.5
p(⌧ )d⌧
=
0.5
X
=
Z
0.5
ej2⇡k⌧ d⌧
0.5
odd
X 4 ej2⇡k⌧
|0.5
k⇡ j2⇡k 0.5
k, odd
X 4 sin(⇡k)
=0
k⇡ ⇡k
k, odd
k,
=
4
k⇡
since sin(⇡k) = 0 for k odd. Since p(t) has zero mean, the integral over a period is zero, coinciding with
the above.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.24
4.21 (a) The derivative of the period between 0 and 2 of the triangular signal x(t) is
y1 (t) =
dx1 (t)
= u(t)
dt
and the signal
y(t) =
2u(t
X
y1 (t
1) + u(t
2)
2k)
k
is a train of square pulses of period T0 = 2 and average zero. The signal z(t) = y(t) + 1 is also periodic
of the same period as y(t) but average 1. The Fourier series coefficients of y(t) are
Yk
=
=
1 s s
1
e (e
2 + e s )|s=j⇡k =
e j⇡k (cos(⇡k)
2s
j⇡k
⇤
1 ⇥
2
( 1)2k ( 1)k =
k=
6 0, odd
j⇡k
j⇡k
1)
and zero for k even. The Fourier coefficients of z(t) are 1 as d.c. value and Zk = Yk for k odd and zero
for k even and 6= 0.
(b) The Fourier series of y(t) is
y(t)
1
X
=
2 j⇡kt
e
j⇡k
odd
X sin(⇡kt)
4
⇡k
k>0, odd
k= 1,
=
and that of the signal z(t) is
z(t) = 1 + 4
X
k>0,
odd
sin(⇡kt)
⇡k
The signal y(t) is an odd function of t and as such it can be represented by sines, and this is why it has
purely imaginary coefficients for its exponential Fourier series. The signal z(t) is neither even nor odd
and as such it is made up of an even component, the constant 1, and an odd component, y(t).
(c) If we reverse the process in (a) by integrating y1 (t) we get x1 (t) = r(t) 2r(t 1) + r(t 2) which
would give us the periodic signal x(t) by shifting and adding. The Fourier series coefficients of x(t) are
Xk =
Yk
=
j⇡k
2
(⇡k)2
k 6= 0, odd, and X0 = 0.5
and zero for k even. Notice that the integral of y(t) would be zero for each period and would give the
x1 (t) shifted in time in each period.
(d) The signal x(t) is even and as such it can be represented by a cosine Fourier series so the coefficients
are real. We have that
x(t)
=
=
1
X
0.5 +
0.5 +
k= 1, k6=0,
1
X
k=1,
odd
odd
2 j⇡kt
e
(⇡k)2
4 cos(⇡kt ⇡)
(⇡k)2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.25
4.22 (a) The product
z(t)
=
x(t)y(t) =
=
XX
Xk ejk⌦0 t
Xk Ym e
j(k+m)⌦0 t
m
k
n
X
m
k
"
X X
=
X
Xk Yn
k
k
where we let n = k + m and
Zn =
=
Ym ejm⌦0 t
XX
ejn⌦0 t =
ke
jn⌦0 t
n
k
#
Xk Yn
X
Zn ejn⌦0 t
n
X
Xk Yn
k
k
i.e., the convolution sum of the Fourier coefficients Xk and Yk . Notice that the Fourier series of z(t) has
the same fundamental frequency as x(t) and y(t), ⌦0 , so z(t) is periodic of period T0 .
(b) If ⌦1 = 2⌦0 then we have that the product
X
X
z(t) = x(t)y(t) =
Xk ejk⌦0 t
Ym ejm2⌦0 t
=
XX
k
=
Xk Y m e
j(k+2m)⌦0 t
m
"
X X
n
m
k
Xk Y(n
k)/2
k
#
=
XX
k)/2 e
jn⌦0 t
n
k
ejn⌦0 t =
Xk Y(n
X
Zn ejn⌦0 t
n
where we let n = k + 2m. The coefficients
Zn =
X
Xk Y(n
k)/2
k
where Y(n k)/2 is only defined for (n k)/2 an integer, whenever it is not an integer we let the coefficient
be zero.
Again in this case the Fourier series of z(t) has the same fundamental frequency, ⌦0 , as x(t) and y(t),
so z(t) is periodic of period T0 . Indeed, the periods are T0 and T1 = 2⇡/⌦1 = 2⇡/2⌦0 = T0 /2, and
their ratio T1 /T0 = 0.5 so that T0 = 2T1 is the period of z(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.26
4.23 (a) The periodic signal x(t), of period T0 = 0.5 (⌦0 = 4⇡), can be written
x(t)
so X0 = 1/2, X1 = X
(b) A period of y(t) is
1
=
=
sin2 (2⇡t) =
=
1
2
1 j4⇡t
e
4
1
[1 cos(4⇡t)]
2
1 j4⇡t
e
4
1/4.
y1 (t) = sin(2⇡t)u(t) + sin(2⇡(t
0.5))u(t
0.5)
having a Laplace transform
Y1 (s) =
s2
2⇡
e
+ 4⇡ 2
0.25s
[e0.25s + e
0.25s
]
so that the Fourier series coefficients of y(t) are given by (T1 = 0.5, ⌦1 = 4⇡)
Yk
=
=
1
4⇡
Y1 (s)|s=j⌦1 k =
e
2
T1
4⇡ (1 4k 2 )
2
⇡(1 4k 2 )
j⇡k
2 cos(⇡k)
The dc value is Y0 = 2/⇡.
(c) The signals x(t) and y(t) are not equal. For instance when t = 1/8 we have
y(1/8) = | sin(⇡/4)| = 0.707
while
x(1/8) = (sin(⇡/4))2 = 0.5
(d) Passing the signals x(t) through an ideal low-pass filter with magnitude 2 and cut-off frequency
0 < ⌦x < 4⇡ we obtain in steady state as output a dc signal z(t) = 1. On the other hand, passing y(t)
through an ideal low-pass filter of magnitude ⇡/2 and cut-off frequency 0 < ⌦y < 4⇡ gives as output,
in steady state, a dc signal w(t) = 1. Although either x(t) or y(t) can be used to obtain the desired
signal, x(t) has the advantage that the required filter has as magnitude an integer value of 2, instead of
an irrational value of ⇡/2 and if the filter being used is not an ideal filter, there is more flexibility in
obtaining the filter to get a dc value from x(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.2
4.27
Problems using MATLAB
4.24 (a) The Fourier coefficients {Xk } are
Xk =
1
T0
Z
T0
jk⌦0 t
x(t)e
dt =
0
Z
1
te
j2⇡kt
where we used T0 = 1, ⌦0 = 2⇡, and the integral
Z
eax
xeax dx = 2 (ax
a
Indeed,
Z
1
te
j2⇡kt
dt =
0
e
j2⇡kt
( j2⇡k)2
dt =
0
( j2⇡kt
j
2⇡k
1)
1)|1t=0 =
j
2⇡k
The average is calculated separately as
X0 =
Z
1
tdt = 0.5.
0
(b) The Laplace transform of the period x1 (t) is
X1 (s) =
1
e
s
s2
s
e
=
s
e
0.5s
s2
⇥
e0.5s
e
0.5s
The Fourier coefficients are obtained according to (⌦0 = 2⇡/T0 = 2⇡)
Xk =
1
e j⇡k
X1 (s)|s=j2k⇡ =
sin(⇡k)
T0
2j⇡ 2 k 2
⇤
s
e
s
1
j
=0+
j2⇡k
2⇡k
k 6= 0
The average is 0.5 by observation. Since x(t) 0.5 is odd, it can be represented by sines.
(c) The following script is used to find the magnitude spectrum and to obtain an approximate x̂(t). The
approximate signal is given by
x̂(t) = 0.5 +
40
X
k= 40,k6=0
j j2⇡kt
e
= 0.5
2⇡k
40
X
sin(2⇡kt)
k=1
⇡k
% Pr. 4_24
clear all; clf
% magnitude line spectrum
X1(1)=0.5;
for k=1:40,
X1(k+1)=1/(2*pi*k);
end
kk=-40:40;
X=[fliplr(X1) X1(2:41)];
figure(1)
stem(kk,X); grid
xlabel(’k’);ylabel(’|X_k|’)
% approximate signal
t=0:0.001:10;
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.28
x=0.5*ones(1,length(t));
for k=1:40,
x=x-1/(pi*k)*sin(2*pi*k*t);
end
figure(2)
plot(t,x);grid;axis equal
xlabel(’t (sec)’); ylabel(’\hat{x}(t)’)
0.5
1.5
0.4
\hat{x}(t)
|Xk|
1
0.3
0.5
0
0.2
−0.5
0.1
0
−40
−30
−20
−10
0
k
10
20
30
0
0.5
1
1.5
2
2.5
t (sec)
3
3.5
4
40
Figure 4.6: Problem 24: Magnitude line spectrum of Xk and approximate x̂(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
4.5
5
Chaparro — Signals and Systems using MATLAB
4.29
4.25 (a) The period x1 (t) = r(t) r(t 1) u(t 1), and T0 = 2 so that ⌦0 = ⇡. The Fourier coefficients
are


1 1 e s
e s
1 e s (1 + s)
Xk =
=
2
s2
s s=j⇡k
2s2
s=j⇡k

⇢
⇤
1
1 ⇥
j/(2⇡k)
k 6= 0, even
=
( 1)k (1 + j⇡k) 1 =
(2 + j⇡k)/(2⇡ 2 k 2 ) k odd
2 ⇡2 k2
The average value which cannot be obtained from above is
Z
1 1
X0 =
tdt = 0.25
2 0
(b) The Fourier series of y(t) is
y(t) = x( t) =
X
X
ke
jk⌦0 t
k
so that
Yk = X
k
=
8
<
j/(2⇡k)
0.25
:
(2 j⇡k)/(2⇡ 2 k 2 )
k 6= 0, even
k=0
k odd
(c) Adding the above signals z(t) = x(t) + y(t) we get triangular pulses. The Fourier coefficients of
z(t) are
8
k 6= 0, even
< 0
0.5
k=0
Z k = Xk + Yk =
:
2/(⇡ 2 k 2 ) k odd
Notice that the Fourier coefficients of x(t) and y(t) which are neither even nor odd are complex, while
the Fourier coefficients of z(t) are real given that it is an even signal.
A period of z(t) is
z1 (t) = r(t)
2r(t
1) + r(t
2)
and T0 = 2, ⌦0 = ⇡. The Fourier coefficients of z(t) are
Zk
=
1
( 1)k
Z1 (s)|s=j⇡k = 2 2 (1
2
⇡ k
cos(⇡k)) =
⇢
0
2/(⇡ 2 k 2 )
k 6= 0, even
k odd
and by inspection Z0 = 0.5. which coincide with the ones obtained before. The following script gives
an approximation of z(t) using 41 harmonics, and shown in Fig. 4.7.
% Pr. 4_25
clear all; clf
% magnitude line spectra
X1(1)=0.25;
for k=1:2:40,
X1(k+1)=abs(-(2+j*pi*k)/(2*piˆ2*kˆ2));
end
for k=2:2:40,
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.30
X1(k+1)=abs(1/(2*pi*k));
end
kk=-40:40;
X=[fliplr(X1) X1(2:41)];
figure(1)
subplot(311)
stem(kk,X); grid;axis([-40 40 0 1]);ylabel(’|X_k|’)
Y1(1)=0.25;
for k=1:2:40,
Y1(k+1)=abs((2+j*pi*k)/(2*piˆ2*kˆ2));
end
for k=2:2:40,
Y1(k+1)=abs(-1/(2*pi*k));
end
Y=[fliplr(Y1) Y1(2:41)];
subplot(312)
stem(kk,Y); grid; axis([-40 40 0 1]);ylabel(’|Y_k|’)
Z=[fliplr(Y1+X1) Y1(2:41)+X1(2:41)];
subplot(313)
stem(kk,Z); grid; axis([-40 40 0 1])
xlabel(’k’);ylabel(’|Z_k|’)
% approximate of z(t)
t=0:0.001:10;
z=0.5*ones(1,length(t));
for k=1:2:10,
z=z-4*cos(k*pi*t)/(pi*k)ˆ2;
end
figure(2)
plot(t,z);grid
xlabel(’t (sec)’); ylabel(’z_1(t)’)
1
|Xk|
0.4
0.9
0.2
0
−40
0.8
−30
−20
−10
0
10
20
30
40
0.7
0.6
0.4
z1(t)
|Yk|
0.6
0.2
0
−40
0.5
0.4
−30
−20
−10
0
10
20
30
40
0.3
|Zk|
0.6
0.2
0.4
0.1
0.2
0
−40
−30
−20
−10
0
k
10
20
30
40
0
0
1
2
3
4
5
t (sec)
6
7
8
Figure 4.7: Problem 25: Line spectra for x(t), y(t) ans z(t), (right) approximate ẑ(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
9
10
Chaparro — Signals and Systems using MATLAB
4.31
4.26 (a) x(t) is a train of rectangular pulses.The Laplace transform of the period x1 (t) is
X1 (s)
1
(1
s
=
e
s
)=
e
s/2
(es/2
s
e
s/2
)
and T0 = 2, so ⌦0 = ⇡. The Fourier series coefficients are then
Xk =
1
sin(⇡k/2)
X1 (s) |s=j⇡k =
e
2
⇡k/2
jk⇡/2
X0 = 0.5
(b) The following script is used to find and plot the magnitude line spectrum of x(t), and to approximate
the signal with 40 harmonics.
% Pr. 4_26
clear all; clf
% magnitude line spectra
X(1)=0.5;
for k=1:40,
X(k+1)=abs(0.5*sin(pi*k/2)/(pi*k/2));
end
kk=-40:40;
X=[fliplr(X) X(2:41)];
figure(1)
stem(kk,X); grid;axis([-40 40 0 0.6]);ylabel(’|X_k|’)
% approximate of z(t)
t=0:0.001:10;
x=0.5*ones(1,length(t));
for k=1:40,
x=x+(sin(pi*k/2)/(pi*k/2))*cos(pi*k*t-k*pi/2);
end
figure(2)
plot(t,x);grid
xlabel(’t (sec)’); ylabel(’x_a(t)’)
1.2
1
0.5
0.8
0.4
xa(t)
|Xk|
0.6
0.3
0.4
0.2
0.2
0.1
0
−40
0
−30
−20
−10
0
10
20
30
40
−0.2
0
1
2
3
4
5
t (sec)
6
7
8
9
10
Figure 4.8: Problem 26: Magnitude line spectrum and approximate of train of pulses.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.32
4.27 (a) The difference between calculating the Fourier coefficients of the full-wave and of the half-wave
rectified signal is the period Ti , i = 0, 1, as the period signal is the same, i.e.,
x1 (t) = sin(⇡t)u(t) + sin(⇡(t
1))u(t
1),
with Laplace transform
X1 (s) =
⇡
(1 + e
2
s + ⇡2
s
)=
⇡e 0.5s 0.5s
(e
+e
s2 + ⇡ 2
0.5s
)
Full-wave In this case T0 = 1, ⌦0 = 2⇡ and
2⇡e j⇡k
cos(⇡k) =
4⇡ 2 k 2 + ⇡ 2
(1
Xk = X1 (s) |s=j2⇡k =
since e
j⇡k
2
4k 2 )⇡
= cos(⇡k) = ( 1)k .
Half-wave In this case T0 = 2, ⌦0 = ⇡ and
Xk
=
=
The d.c. values are X0 =
2
⇡
1
⇡e j⇡k/2
X1 (s) |s=j⇡k =
cos(⇡k/2)
2
⇡2 k2 + ⇡2
1
e j⇡k/2 cos(⇡k/2)
(1 k 2 )⇡
for the full-wave, and X0 =
1
⇡
for the half-wave signal.
(b) When plotting the magnitude line spectra and obtaining an approximation with MATLAB X1 for the
half-wave signal is not well defined (0/0) and L’Hôpital’s rule need to be applied. Instead we can use
its even-odd decomposition so that if xh (t) is the half-wave signal and xf (t) is the full-wave signal we
have that
xh (t)
=
=
=
0.5[xf (t) + sin(⇡t)]
1
X
1
(1
k= 1
1
X
`= 1, even
(2k)2 )⇡
ej⇡(2k) +
ej⇡t
4j
1
ej⇡t
ej⇡` +
2
(1 ` )⇡
4j
e
j⇡t
4j
j⇡t
e
4j
so that the Fourier coefficients for the half-wave signals are
8
< 1/(⇡(1 k 2 )) k even
1/(4j)
k=1
Xk =
:
0
otherwise
The following script plots the magnitude line spectrum and computes an approximate of the half-wave
signal.
% Pr. 4_27
clear all; clf
% magnitude line spectra
X(1)=2/pi;
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.33
for k=1:40,
X(k+1)=abs(2/(pi*(1-4*kˆ2)));
end
kk=-40:40;
X=[fliplr(X) X(2:41)];
figure(1)
stem(kk,X); grid;axis([-40 40 0 0.8]);ylabel(’|X_k|’)
% approximate of z(t)
t=0:0.001:10;
x=(1/pi)*ones(1,length(t))+0.5*sin(pi*t);
for k=1:40,
x=x+2/(pi*(1-4*kˆ2))*cos(2*pi*k*t);
end
figure(2)
plot(t,x);grid;axis([0 10 -0.1 1.1])
xlabel(’t (sec)’); ylabel(’x_a(t)’)
0.8
1
0.7
0.6
0.8
0.5
xa(t)
|Xk|
0.6
0.4
0.4
0.3
0.2
0.2
0.1
0
0
−40
−30
−20
−10
0
10
20
30
40
0
1
2
3
4
5
t (sec)
6
7
Figure 4.9: Problem 27: Magnitude line spectrum of half-wave rectified signal.
Copyright 2014, Elsevier, Inc. All rights reserved.
8
9
10
Chaparro — Signals and Systems using MATLAB
4.28 The signal x(t) with a period x1 (t) = u(t)
X1 (s) =
1
(1
s
4.34
1), period T0 = 2 ( ⌦0 = ⇡), has
u(t
e
s
)=
e
s/2
s
(es/2
e
s/2
)
so that its Fourier coefficients are
Xk
1
1
X1 (s)|s=j⇡k =
sin(⇡k/2)e
T0
⇡k
1 sin(⇡k/2) j⇡k/2
e
2 ⇡k/2
=
=
On the other hand, y(t) with a period y1 (t) = r(t)
that
1
Y1 (s) = 2 [1 2e s + e
s
and the Fourier coefficients are given by
Yk
=
=
using 1
2r(t
2s
]=
1) + r(t
1 s
[e
s2
2+e
j⇡k/2
2), T0 = 2 ( ⌦0 = ⇡), we have
s
]e
s
1
e j⇡k (cos(⇡k) 1)
⇡2 k2
✓
◆2
1 sin2 (⇡k/2)
1 sin(⇡k/2)
k
(
1)
=
( 1)k
2 ⇡ 2 k 2 /4
2
⇡k/2
cos(⇡k) = 2 sin2 (⇡k/2).
We can then see that
|Yk | =
1 sin(⇡k/2)
2
⇡k/2
2
= 2|Xk |2
Notice that the above does not allow the computation of the dc values as we have in each case a 0/0
situation, but it can be easily seen that
1
X0 = = Y0
2
To verify that y(t) is smoother than x(t) we compute the first few values of the line spectrum of x(t) and
y(t)
k |Xk |
|Yk |
|Xk |2
|Yk |2
0 0.5
0.5
0.25
0.25
1 1/⇡
2/⇡ 2
1/⇡ 2
4/⇡ 4
2
0
0
0
0
3 1/3⇡ 2/9⇡ 2 1/9⇡ 2 4/(81⇡ 4 )
As can be seen, the line spectrum of y(t) goes faster to zero than that of x(t) which means that y(t) is
smoother than x(t) (see Fig. 4.10), i..e., y(t) has smaller higher frequency components than x(t).
% Pr. 4_28
clear all; clf
% magnitude line spectra
X(1)=0.5;Y(1)=X(1);
for k=1:40,
X(k+1)=abs(0.5 *sin(pi*k/2)/(pi*k*0.5));
Y(k+1)=abs(0.5*(sin(pi*k/2)/(pi*k*0.5))ˆ2);
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.35
end
X(1:5)
Y(1:5)
kk=-40:40;
X=[fliplr(X) X(2:41)];
Y=[fliplr(Y) Y(2:41)];
figure(1)
subplot(211)
stem(kk,X); grid;axis([-40 40 0 0.6]);ylabel(’|X_k|’)
subplot(212)
stem(kk,Y); grid;axis([-40 40 0 0.6]);ylabel(’|Y_k|’)
0.5
|Xk|
0.4
0.3
0.2
0.1
0
−40
−30
−20
−10
0
10
20
30
40
−30
−20
−10
0
10
20
30
40
0.5
|Yk|
0.4
0.3
0.2
0.1
0
−40
Figure 4.10: Problem 28: Magnitude line spectra of x(t) and y(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.36
4.29 The periods of the two signals are:
x1 (t) = u(t)
u(t
0  t  T0 = 2
1)
y1 (t) = x1 (2t) = u(2t)
u(2t
1) = u(t)
u(t
0.5)
0  t  T1 = 1
the Fourier series coefficients of these signals are
1 s/2 s/2
sin(⇡k/2)
e
(e
e s/2 ) |s=j⇡k =
e
2s
⇡k
1
sin(⇡k/2)
Yk = e s/4 (es/4 e s/4 ) |s=j2⇡k =
e
s
⇡k
Xk =
j⇡k/2
j⇡k/2
We see that the coefficients for the two signals are identical, but the fundamental frequency for x(t) is
⌦0 = 2⇡/T0 = ⇡ while the one for y(t) is ⌦1 = 2⇡/T1 = 2⇡ = 2⌦0 so that the line spectrum of x(t) is
compressed when compared to that of y(t). Thus compression in a period y(t) = x(2t) corresponds to
expansion in the frequency domain. Thus, x(t) is smoother than y(t) as this displays higher frequencies.
% Pr. 4_29
clear all; clf
% magnitude line spectra
X(1)=0.5;Y(1)=X(1);
for k=1:40,
X(k+1)=abs(0.5 *sin(pi*k/2)/(pi*k*0.5));
end
Y=X;
kk=-40:40;
X=[fliplr(X) X(2:41)];
Y=[fliplr(Y) Y(2:41)];
figure(1)
subplot(211)
stem(pi*kk,X); grid;axis([-40*pi 40*pi 0 0.6]);ylabel(’|X_k|’)
subplot(212)
stem(2*pi*kk,Y); grid;axis([-40*2*pi 40*2*pi 0 0.6]);ylabel(’|Y_k|’)
0.5
|Xk|
0.4
0.3
0.2
0.1
0
−100
−50
0
50
100
0.5
|Yk|
0.4
0.3
0.2
0.1
0
−250
−200
−150
−100
−50
0
50
100
150
200
250
Figure 4.11: Problem 29: The line spectrum of Yk is an expansion of that of Xk (notice the frequencies for
each).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.37
4.30 (a) The period x1 (t) can be expressed as
x1 (t
0.5) = sin(⇡t)u(t) + sin(⇡(t
1))u(t
1)
which has a Laplace transform
X1 (s) =
s2
so that the Fourier coefficients are
Xk =
⇥ 0.5s
⇡
e
+e
2
+⇡
2
⇡(1
4k 2 )
cos(⇡k) =
0.5s
⇤
2( 1)k
(1 4k 2 )⇡
The dc value is X0 = 2/⇡.
(b) Writing the full-wave rectified signal as
1
X
x(t) = X0 +
Xk ej2⇡kt
k= 1,k6=0
the output of the filter is according to the eigenfunction property
1
X
y(t) = X0 H(j0) +
Xk H(j2⇡k)ej2⇡kt
k= 1,k6=0
If y(t) = X(0) = 2/⇡ then H(j0) = 1 and H(j2⇡k) = 0 for k 6= 0.
(c) The following script is used to plot the magnitude spectrum of x(t)
% Pr. 4_30
clear all; clf
% magnitude line spectra
X(1)=2/pi;
for k=1:40,
X(k+1)=abs(2/(pi*(1-4*kˆ2)));
end
kk=-40:40;
X=[fliplr(X) X(2:41)];
figure(1)
stem(pi*kk,X); grid;axis([-40*pi 40*pi 0 0.7]);ylabel(’|X_k|’)
0.6
0.5
|Xk|
0.4
0.3
0.2
0.1
0
−100
−50
0
50
100
Figure 4.12: Problem 30: Magnitude line spectrum for x(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.38
4.31 According to Parseval’s power result we have that
1
T0
Z
T0 /2
T0 /2
|x(t)|2 dt =
1
X
k= 1
|Xk |2
or that the power of the signal in the time domain is matched by the sum of the square of the Fourier
series coefficients.
The power in time is
1
T0
Z
1
2
t dt =
T
0
1
2
The power in the frequency is the sum of
|Xk |2 =
Z
1
2
t dt =
0
4
,
(⇡k)4
and the dc term (0.5)2 or
(0.5)2 + 2
Z
1
t2 dt =
0
t3 1
1
| =
3 0
3
1 < k < 1, k 6= 0, odd
X
k>0,
odd
4
(⇡k)4
Using MATLAB we can find the top value of k that will make this sum equal to 0.9/3 = 0.3 or 90%
of the total power. The script below shows that the dc and 5 harmonics are enough to get the desired
approximation.
% Pr. 4_31
clear all
sum=0.25;k=1;
while sum<(1/3)*.9995,
N=k;
sum=sum+8/(pi*k)ˆ4;
k=k+2;
end
disp(’number of terms’)
N
disp(’power with that many terms’)
sum
% approximate of z(t)
t=0:0.001:100;
x=0.5;
for k=1:2:N
x=x+4*cos(pi*k*t-pi)/(pi *k)ˆ2;
end
figure(1)
plot(t,x);grid;axis([0 10 -0.1 1.1])
xlabel(’t (sec)’); ylabel(’x_a(t)’)
number of terms
N = 5
power with that many terms
sum = 0.3332
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.39
1
0.8
xa(t)
0.6
0.4
0.2
0
0
1
2
3
4
5
t (sec)
6
7
8
9
10
Figure 4.13: Problem 31: Approximation of the triangular signal with N = 5.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.40
4.32 (a) The fundamental period of the sinusoid is T = 1/880 so that T0 = 5T = 5/880 sec., T1 = T0 /4 and
T2 = 3T0 /4. The Fourier series coefficients of !(t) are
Wk
=
=
=
1
1
W1 (s)|s=jk⌦0 = 2 (1 e sT0 /4 e s3T0 /4 + e sT0 )|s=jk⌦0
T0
s
e sT0 /2 sT0 /2
(e
esT0 /4 e sT0 /4 + e sT0 /2 )|s=jk⌦0
s2
2e jk⇡
2⇡
(cos(⇡k) cos(⇡k/2))
⌦0 =
= 352⇡ rad/sec
⌦20 k 2
T0
(b) The signal s(t) = w(t) cos(2⇡fA t) shifts the harmonics of w(t) to a central frequency 2⇡fA .
The number of harmonic frequencies is increased by windowing the sinusoid or sum of sinusoids.
%Problem 4_32
clear all; clc
% parameters
Fs = 880;
%frequency
T = 1/Fs;
%sample period
T0 = 5*T; T1 = T0/4; T2 = T0*3/4;
% a)---------------------------------------------------------% define one period of w signal -> w1
Ts=1/17600;
% overall sample period
t=0:Ts:T0-Ts; Nn=length(t);
x1=[t(1:ceil(Nn/4)) t(ceil(Nn/4)+1)*ones(1,ceil(Nn/4))]; x2=fliplr(x1);
w1=[x1 x2];
N=length(w1);
%number of samples in w1
% plot line spectrum
figure(1)
FSeries(w1,Ts,T0,N);
% harmonics H to approximate w1?
w0=2*pi/T0;
DC=0.001065; H=3;
for k=1:H,
a(k)=2*(cos(k*w0*T0/4)-cos(k*w0*T0/2))/T0/kˆ2/w0ˆ2;
end
a=[DC 2*a];
figure(2)
for N1=2:H+1,
x=a(1)*ones(1,length(t));
for k=2:N1,
x=x+a(k)*cos((k-1)*w0.*(t+T0/2));
end
plot(t,x);
axis([0 max(t) 1.1*min(x) 1.1*max(x)]);
hold on;
plot(t,w1,’r’)
ylabel(’Amplitude’);xlabel(’t (sec)’);
legend(’aprox w1(t)’,’w1(t)’);grid;
hold off
pause(0.1);
clear x;
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
end
clear H a x1
% b)---------------------------------------------------------s = cos(2*pi*Fs*t).*w1; %modulated signal s
figure(3);
FSeries(s,Ts,T0,N);
% line spectrum of s
% how many harmonics H are necessary to approximate s?
w0=2*pi/T0;
DC=0.001065;H=3;
for k=1:H,
a(k)=2*(cos(k*w0*T0/4)-cos(k*w0*T0/2))/T0/kˆ2/w0ˆ2;
end
a=[DC 2*a];
figure(4)
for N1=2:H+1,
x=a(1)*ones(1,length(t));
for k=2:N1,
x=x+a(k)*cos((k-1)*w0.*(t+T0/2));
x1=x.*cos(5*w0.*t);
end
plot(t,x1);
axis([0 max(t) 1.1*min(s) 1.1*max(s)]);
hold on;
plot(t,s,’r’)
ylabel(’Amplitude’); xlabel(’t (sec)’);
legend(’aprox s(t)’,’s(t)’); grid;
hold off
pause(0.1);
clear x;
end
% c)---------------------------------------------------------p = cos(2*pi*Fs*t);
%signal p
figure(5);
FSeries(p,Ts,T0,N);
%line spectrum of p
%sound(p); pause(1); sound(w0*s);pause(2);
% d)---------------------------------------------------------p = sin(2*pi*440*t)+sin(2*pi*550*t)+sin(2*pi*660*t);
%signal p
s = p.*w1; %modulated signal s
figure(6);
FSeries(s,Ts,T0,N);
%line spectrum of s
% sound(100*p); pause(1); sound(100*w0*s);
Copyright 2014, Elsevier, Inc. All rights reserved.
4.41
Chaparro — Signals and Systems using MATLAB
−3
−3
−4
Periodic signal
x 10
4.42
aprox w1(t)
w1(t)
14
2
1
1.5
x(t)
12
1
0
−1
0.5
−2
0.005
0.01
t (sec)
0.015
−3
−3
x 10 Magnitude Line Spectrum
1
x 10
Amplitude
10
0
0
0.02
Phase Line Spectrum
0
8
1
0.01
t (sec)
0.015
5
0.02
−4
Phase Line Spectrum
−1
−0.5
0
0.5
w (rad/sec)
x 10
5
<Xk|
0.6
6
4
|Xk|
0.5
0.8
|Xk|
0.005
−4
x 10 Magnitude Line Spectrum
0
4
0.4
<Xk|
x(t)
2
Periodic signal
x 10
x 10
2.5
3
0
2
−0.5
0.2
1
2
−1
0
−1
−0.5
0
0.5
w (rad/sec)
1
−1
4
x 10
−0.5
0
0.5
w (rad/sec)
1
0
1
2
3
t (sec)
4
x 10
4
−5
0
5
−1
−3
x 10
−0.5
0
0.5
w (rad/sec)
1
4
x 10
1
4
x 10
Figure 4.14: Problem 32. Right to left: window and line spectra, approximation of window, windowed
sinusoid and its line spectra.
−3
x 10
aprox s(t)
s(t)
−3
Periodic signal
2
1.5
Periodic signal
x 10
2
1
x(t)
0
−1
0.5
−2
−2
−4
0
0.005
0.01
t (sec)
0
0.015
−16
Magnitude Line Spectrum
x 10
0.02
0
5
0.5
0.005
0.01
t (sec)
−4
x 10 Magnitude Line Spectrum
Phase Line Spectrum
0
0.2
0
1
2
3
t (sec)
4
0
5
−3
x 10
3
2
0.1
−1.5
−0.5
0
0.5
w (rad/sec)
1
−1
4
x 10
−0.5
0
0.5
w (rad/sec)
0
1
4
x 10
−1
−0.5
0
0.5
w (rad/sec)
0
−0.5
1
−5
−1
Phase Line Spectrum
0.5
<Xk|
0.3
<Xk|
−1
−1
−1.5
−1
−0.5
0
0.5
w (rad/sec)
1
4
x 10
Figure 4.15: Problem 32: from right to left: approximation of windowed signal, line spectra of sinusoid,
windowed sum of sinusoids and line spectra.
Copyright 2014, Elsevier, Inc. All rights reserved.
0.02
−3
x 10
1
4
|Xk|
0.4
0.015
1.5
5
−0.5
|Xk|
Amplitude
x(t)
0
1
1
4
x 10
Chaparro — Signals and Systems using MATLAB
4.43
4.33 (a) The signal x(t) is zero-mean. The Fourier series coefficients are obtained from (⌦0 = 2⇡/T0 = 2⇡)
X1 (s) =
2 0.25s
(e
s
e
0.25s
)|s=j2k⇡ =
sin(⇡k/2)
⇡k/2
so that
x(t)
1
X
=
=
k= 1,6=0
1
X
2
k=1
sin(⇡k/2) j2k⇡t
e
⇡k/2
sin(⇡k/2)
cos(2⇡kt)
⇡k/2
Since x(0) = 1, letting t = 0 in both sides and then multiplying by ⇡ we get that
⇡=4
1
X
sin(⇡k/2)
k=1
If we let
⇡N = 4
N
X
sin(⇡k/2)
k=1
we use MATLAB to find the value of N .
k
k
= 0.95⇡
% Problem 4_33
clear all; clc
N=100; x = 0;
%DC value
for k=1:N
x = x + 4*sin(k*pi/2)/k;
xx(k) =x;
end
format long
display(’Error of approximation for’)
N
e = pi-x
ppi=pi*ones(1,length(xx)); n=1:N;
figure(1)
subplot(211); plot(n,xx); title(’Approximation of PI’); axis([1 N 0 4.5])
hold on; plot(n,ppi,’r’); grid; hold off; legend(’approximate’, ’pi’)
subplot(212); plot(n,xx-pi); title(’Error of approximation’); grid
% N for 95 percent of pi
sum = 0;
%initial approximation
for i = 1:N,
sum = sum + 4*cos(i*pi/2-pi/2)/i;
if (sum >=(0.95*pi))&&(sum<=pi) break;
end
end
display([num2str(i) ’ coeficients needed of Fourier series for 95% approx. of PI ’])
Error of approximation for
N = 100
e = 0.019998000998784
15 coeficients needed of Fourier series for 95\% approx. of PI
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.44
Approximation of PI
4
3
2
approximate
pi
1
0
10
20
30
40
50
n
60
70
80
90
100
70
80
90
100
Error of approximation
1
0.5
0
−0.5
0
10
20
30
40
50
n
60
Figure 4.16: Problem 33: Approximation of ⇡ by series, error of approximation
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.45
4.34 (a) Assuming x(t) and x̂(t) being real and even, so that X̂k are real we have
Z
Z
" =
(x(t) x̂(t))2 dt =
x2 (t) 2x(t)x̂(t) + x̂2 (t)dt
T0
T0
Z
Z
Z XX
X
=
x2 (t)dt 2
x(t)
X̂k k (t)dt +
X̂k X̂`⇤
=
Z
T0
T0
2
x (t)dt
T0
2
XZ
k
T0
k
x(t)X̂k
k (t)dt
+
T0
k
XX
k
`
X̂k X̂`
`
Z
T0
To minimize the error we set its derivative w.r.t. X̂n to zero, i.e.,
Z
Z
d"
1
= 2
x(t) n (t)dt + 2T0 X̂n = 0 so that X̂n =
x(t)
T0 T0
dX̂n
T0
⇤
k (t) ` (t)
⇤
k (t) ` (t)
n (t)dt
% Problem 4_34
clear all; clc
% c)d)-------------------------------------------------------% Fourier Series of a train of pulses of period T0=1 and dc value 1
w0 = 2*pi; T0 = 1; DC=1; N=100;
for k=1:N,
a(k)=sin(k*pi/2)/(k*pi/2);
end
a=[DC 2*a];
Ts = 0.001;
%sample period
t=0:Ts:1-Ts; L=length(t);
%number of samples
x1=[ones(1,L/4) zeros(1,L/2) ones(1,L/4)]; %train signal
x1=2*DC*x1;
%DC gain adaptation
for N1=2:N+1,
x=a(1)*ones(1,length(t));
for k=2:N1,
x=x+a(k)*cos(2*pi*(k-1).*t);
end
%plot figures
figure(1)
plot(t,x); axis([0 max(t) 1.1*min(x) 1.1*max(x)]); hold on
plot(t,x1,’r’); ylabel(’x(t), x_a(t)’); xlabel(’t (sec)’); hold off
figure(3)
plot(t,x); axis([0.175 0.275 1.75 2.25]); hold on
plot(t,x1,’r’); title(’Gibbs Phenomenon’);
ylabel(’x(t), x_a(t)’); xlabel(’t (sec)’);
pause(0.05)
%compute error
e=(x1-x).ˆ2;
error(N1-1)=0;
for k = 1:length(e)
error(N1-1) = error(N1-1) + e(k);
end
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.46
clear x
end
figure(2)
axis([1 N 0 1.1*max(error)]); hold on
plot(error,’linewidth’,2);
title(’e = int((x-x1)ˆ2)’); ylabel(’Amplitude of error’); xlabel(’t (samples)’)
hold off
e = int((x−x1)2)
200
180
2
160
140
Amplitude of error
x(t), xa(t)
1.5
1
120
100
80
60
0.5
40
20
0
0
0.1
0.2
0.3
0.4
0.5
t (sec)
0.6
0.7
0.8
0
0.9
10
20
30
40
50
60
t (samples)
70
80
90
100
Gibbs Phenomenon
2.25
2.2
2.15
2.1
x(t), xa(t)
2.05
2
1.95
1.9
1.85
1.8
1.75
0.18
0.19
0.2
0.21
0.22
0.23
t (sec)
0.24
0.25
0.26
0.27
Figure 4.17: Problem 34: Gibb’s phenomenon: (top–left) square pulse and approximate, (bottom) detail of
approximation around the discontinuity; (top-right) approximation error.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
4.47
4.35 (a) Letting the positive pulses be represented by 1 and the negative ones by 1 the following sequences
represent each of the Walsh functions (the number in parenthesis at the beginning indicates the order of
the function or the number of zero crossings
2
3
(0)
1
1
1
1
1
1
1
1
6 (1)
1
1
1
1
1
1
1
1 7
6
7
6 (2)
1
1
1
1
1
1
1
1 7
6
7
6 (3)
1
1
1
1
1
1
1
1 7
6
7
4 (4)
1
1
1
1
1
1
1
1 5
(5)
1
1
1
1
1
1
1
1
(b) As indicated the sequences corresponding to the functions 0 (t), 1 (t), 3 (t) and 5 (t) are symmetric, while the others can be obtained by circular shifts. If we shift circularly 1 (t) by 2 we get 2 (t) and
circularly shifting 3 (t) by 1 we obtain 4 (t). In MATLAB these shifts are obtained using wshift.
(c) Writing the approximation of x(t), computed at nTs = n/8,
x(nTs ) =
7
X
ak
n = 0, 1, · · · , 7
k (nTs ),
k=0
in a matrix form
x=
T
a
where x is a column vector with entries the values {x(nTs )}, the column vector a consists of the coefficients of the approximation, and
is the matrix generated by the sequences corresponding to the
Walsh functions. Using the orthonormality of the Walsh functions pre-multiplying by
we get the
approximation coefficients
T
x=
a = Ia
where I is the unit matrix. So we have
a=
x
After finding the coefficient vector we use the equation above to obtain the approximation x̂(t).
% Pr 4_35
%% walsh functions
N=8; M=N-2;
W=ones(1,N);
xx=ones(1,N/2); yy=-xx;
x=[xx yy];
W=[W;x]
zz=wshift(’1d’,x,2)
W=[W;zz];
x=[0]
for n=2,
xx=ones(1,N/(2ˆn));yy=-xx;
for i=1:2ˆ(n-1),
x=[x xx yy]
end
M=length(x);x=x(2:M);
W=[W;x]
zz=wshift(’1d’,x,1)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
W=[W;zz]
end
xx=ones(1,1);yy=-xx;
x=[xx yy]
for i=1:3,
x=[x xx yy]
end
W=[W; x]
t=0:(0.5/8):0.5-0.5/8;
x1=t;
a=W*x1’
y=a’*W/8
figure(1)
W1=[W ones(6,1)];
n=0:8
subplot(611)
stairs(n,W1(1,:)); axis([0 8 -1.5
title(’Walsh functions (0--6)’)
subplot(612)
stairs(n,W1(2,:)); axis([0 8 -1.5
subplot(613)
stairs(n,W1(3,:)); axis([0 8 -1.5
subplot(614)
stairs(n,W1(4,:)); axis([0 8 -1.5
subplot(615)
stairs(n,W1(5,:)); axis([0 8 -1.5
subplot(616)
stairs(n,W1(6,:)); axis([0 8 -1.5
1.5])
1.5])
1.5])
1.5])
1.5])
1.5])
figure(2)
plot(x1)
hold on
stairs(y,’r’); legend(’x1(t)’,’y(t’)
hold off
Copyright 2014, Elsevier, Inc. All rights reserved.
4.48
Chaparro — Signals and Systems using MATLAB
4.49
Walsh functions (0−−6)
1
0
−1
0
1
2
3
4
5
6
7
8
0
1
2
3
4
5
6
7
8
0
1
2
3
4
5
6
7
8
0
1
2
3
4
5
6
7
8
0
1
2
3
4
5
6
7
8
0
1
2
3
4
5
6
7
8
1
0
−1
1
0
−1
1
0
−1
1
0
−1
1
0
−1
0.45
x1(t)
y(t
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
1
2
3
4
5
6
7
8
t
Figure 4.18: Problem 35: Walsh functions (top), approximation of step signal using Walsh functions.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
Copyright 2014, Elsevier, Inc. All rights reserved.
4.50
Chapter 5
Frequency Analysis: the Fourier
Transform
5.1
Basic Problems
5.1 (a) The Laplace transforms are
x1 (t) = e
2t
u(t)
x2 (t) = r(t)
x3 (t) = te
2t
,
,
u(t)
X1 (s) =
X2 (s) =
,
1
s+2
1
s2
X3 (s) =
>
2
>0
1
(s + 2)2
>
2
(b) The Laplace transforms of x1 (t) and of x3 (t) have regions of convergence containing the j⌦-axis,
and so we can find their Fourier transforms from their Laplace transforms by letting s = j⌦
(c) The Fourier transforms of x1 (t) and x3 (t) are
X1 (⌦)
=
X3 (⌦)
=
1
1
2 + j⌦
1
(2 + j⌦)2
Chaparro — Signals and Systems using MATLAB
5.2
5.2 (a) In this case we are using the duality of the Fourier transforms so that the Fourier transform of the sinc
is a pulse of magnitude A and cut-off frequency ⌦0 which we will need to determine.
The inverse Fourier transform is
x(t)
=
=
=
1
2⇡
Z
1
A[u(⌦ + ⌦0 )
u(⌦
⌦0 )]ej⌦t d⌦
1
⌦0
Z
A
ej⌦t d⌦
2⇡
⌦0
A
sin ⌦0 t
⇡t
so that A = ⇡ and ⌦0 = 1, i.e.,
sin(t)
t
,
⇡[u(⌦ + 1)
u(⌦
1)]
(b) The Fourier transform of x1 (t) = u(t + 0.5) u(t 0.5) is

1 0.5s
sin(0.5⌦)
X1 (⌦) =
[e
e 0.5s ]
=
s
0.5⌦
s=j⌦
Using the duality property we have:
x1 (t) = u(t + 0.5)
X1 (t) =
sin(⌦/2)
⌦/2
0.5)
,
X1 (⌦) =
sin(t/2)
t/2
,
2⇡[u(⌦ + 0.5)
u(t
u(⌦
0.5)]
using the fact that x1 (t) is even. Then using the scaling property
X1 (2t) =
sin(t)
t
,
,
2⇡
[u((⌦/2) + 0.5) u((⌦/2)
2
⇡[u(⌦ + 1) u(⌦ 1)]
0.5)]
so x(t) = X1 (2t) = sin(t)/t is the inverse Fourier transform of X(⌦) = ⇡[u(⌦ + 1)
Copyright 2014, Elsevier, Inc. All rights reserved.
u(⌦
1)]
Chaparro — Signals and Systems using MATLAB
5.3
5.3 (a) The signal x(t) is even while y(t) is odd.
(b) The Fourier transform of x(t) is
Z
X(⌦) =
Z
=
=
2
1
1
1
e
|t|
e
e
|t|
cos(⌦t)dt
1
Z 1
|t|
e
j⌦t
dt
Z
j
1
e
|t|
sin(⌦t)dt
1
cos(⌦t)dt
0
this is because the imaginary part is the integral of an odd function which is zero. Since cos(.) is an even
function
X( ⌦) = X(⌦)
The Fourier transform X(⌦) is
X(⌦)
=
=
=
2
Z
Z
1
0
1
e
e
te
j⌦t
(1 j⌦)t
1
j⌦
+
dt
dt +
0
1
j⌦t
+e
2
Z
1
e
(1+j⌦)t
dt
0
1
2
=
1 + j⌦
1 + ⌦2
which is real-valued.
(c) For y(t), odd function, its Fourier transform is
Z 1
Y (⌦) =
y(t)e j⌦t dt
1
Z 1
=
j
y(t) sin(⌦t)dt
1
because y(t) cos(⌦t) is an odd function and its integral is zero. The Y (⌦) is odd since
Z 1
Y ( ⌦) =
j
y(t) sin( ⌦t)dt
=
1
Y (⌦)
since the sine is odd.
(d) Let’s use the Laplace transform to find the Fourier transform of y(t):
Y (s) =
with a region of convergence
1<
1
s+1
1
s+1
< 1, which contains the j⌦-axis. So
Y (⌦) = Y (s) |s=j⌦ =
1
j⌦ + 1
1
2j⌦
=
j⌦ + 1
1 + ⌦2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
which as expected is purely imaginary.
Check: Let z(t) = x(t) + y(t) = 2e t u(t) which has a Fourier transform
Z(⌦) =
2
2(1 j⌦)
=
= X(⌦) + Y (⌦)
1 + j⌦
1 + ⌦2
(f) If a signal is represented as x(t) = xe (t) + xo (t) then
X(⌦) = Xe (⌦) + Xo (⌦)
where the first is a cosine transform and the second a sine transform.
Copyright 2014, Elsevier, Inc. All rights reserved.
5.4
Chaparro — Signals and Systems using MATLAB
5.4
5.5
(a) The Fourier pair is
x(t) =
1
2⇡
Z
1
X(⌦)ej⌦t d⌦
1
For ⌦ = 0 the Fourier transform gives
Z 1
,
X(⌦) =
Z
1
x(t)e
j⌦t
dt
1
x(t)dt = X(0) = 2
1
(b) From the inverse Fourier transform
x(0)
=
=
Z 1
Z 1
1
2
2
X(⌦)d⌦ =
d⌦
2⇡
2⇡ 0 1 + ⌦2
1
2
2
tan 1 (⌦)|1
(⇡/2) = 1
0 =
⇡
⇡
(c) ⌦ = s/j
X(s)
=
x(t)
=
2
2
1
1
=
=
+
then
1 + (s/j)2
(s 1)(s + 1)
1 s s+1
et u( t) + e t u(t)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.5
(a) x1 (t) =
x(t + 1) + x(t
5.6
1), time–shift property
X1 (⌦) = X(⌦)( ej⌦ + e
j⌦
)=
2jX(⌦) sin(⌦)
(b) x2 (t) = 2 sin(t)/t by duality
X2 (⌦) = 2⇡[u( ⌦ + 1)
u( ⌦
1)] = 2⇡[u(⌦ + 1)
u(⌦
1)]
by symmetry of x(t).
(c) Compression
x3 (t) = 2x(2t) = 2[u(2t + 1)
u(2t
X3 (⌦) = 2
1)] = 2[u(t + 0.5)
u(t
0.5)]
X(⌦/2)
= X(⌦/2)
2
(d) Modulation: x4 (t) = cos(0.5⇡t)x(t) so
X4 (⌦) = 0.5[X(⌦ + 0.5⇡) + X(⌦
0.5⇡)]
(e) x5 (t) = X(t) so that by duality
X5 (⌦) = 2⇡x( ⌦) = 2⇡[u( ⌦ + 1)
u( ⌦
1)] = 2⇡x(⌦)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.6
(a) x(t) = cos(t)[u(t)
u(t
5.7
1)] = cos(t)p(t), so
X(⌦) = 0.5[P (⌦ + 1) + P (⌦
1)]
where
P (⌦) =
e
s/2
(es/2
s
s/2
e
(b) y(t) = x(2t) = cos(2t)p(2t) = cos(2t)[u(t)
)
|s=j⌦ = 2e
j⌦/2 sin(⌦/2)
⌦
0.5)], so
u(t
Y (⌦) = 0.5[P1 (⌦ + 2) + P1 (⌦
2)]
where
P1 (⌦) = F[u(t)
u(t
0.5)] = 2e
z(t) = x(t/2) = cos(t/2)p(t/2) = cos(t/2)[u(t)
j⌦/4 sin(⌦/4)
⌦
2)] = cos(t/2)p2 (t) so
u(t
Z(⌦) = 0.5[P2 (⌦ + 0.5) + P2 (⌦
P2 (⌦) = F[u(t)
u(t
2)] = 2e
0.5)]
j⌦ sin(⌦)
⌦
Using
P1 (⌦) = 0.5P (⌦/2)
P2 (⌦) = 2P (2⌦)
we have
X(⌦)
=
0.5[P (⌦ + 1) + P (⌦
1)]
Y (⌦)
=
0.5[0.5P ((⌦/2) + 1) + 0.5P ((⌦/2)
Z(⌦)
=
0.5[2P (2⌦ + 1) + 2P (2⌦
1)] = 0.5X(⌦/2)
1)] = 2X(2⌦)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.7 F[ (t
⌧ )] = L[ (t
⌧ )]s=j⌦ = e
j⌦⌧
5.8
so
(a) By linearity and time–shift
F[ (t
1) + (t + 1)] = 2 cos(⌦)
(b) By duality
0.5[ (t
⌧ ) + (t + ⌧ )]
$
cos(⌦⌧ )
cos(⌦0 t)
$
⇡[ (⌦ + ⌦0 ) + (⌦
⌦0 )]
by letting ⌧ = ⌦0 in the second equation.
(c) Considering
F[ (t
1)
(t + 1)] = 2j sin(⌦),
by duality
0.5j[ (t
⌧ ) + (t + ⌧ )]
$
sin(⌦0 t)
$
sin(⌦⌧ )
j⇡[ (⌦ + ⌦0 ) + (⌦ + ⌦0 )]
by letting ⌧ = ⌦0 in the second equation.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.9
5.8 (a)(b) We have
x(t)
dx(t)
dt
d2 x(t)
dt2
=
r(t)
2r(t
1) + r(t
2)
=
u(t)
2u(t
1) + u(t
2)
=
(t)
2 (t
1) + (t
2) = y(t)
and from the last equation and the derivative property
(j⌦)2 X(⌦) = 1
2e
j⌦
+e
j2⌦
so that
X(⌦)
2e
j⌦
+e
2s
[1 cos(⌦)]
⌦2
✓
◆2
sin(⌦/2)
e j⌦
⌦/2
=
=
(c) The Laplace transform
X(s) =
1
(1
s2
2e
s
)=
e s s
(e
s2
2+e
with region of convergence the whole s-plane. So
X(⌦) = X(s) |s=j⌦
which coincides with the above result.
Copyright 2014, Elsevier, Inc. All rights reserved.
s
)
Chaparro — Signals and Systems using MATLAB
5.9
5.10
(a)
X(⌦)
=
=
=
F[1] +
1
X
k=1
2⇡ (⌦) +
2⇡ (⌦) +
F[0.5k cos(k⌦0 t)]
1
X
k=1
1
X
modulation property
1
(2⇡ 0.5k ) [ (⌦ + k⌦0 ) + (⌦
2
0.5k ⇡ [ (⌦ + k⌦0 ) + (⌦
k⌦0 )]
k=1
(b)
F[e
a|t|
]
F[e at u(t)] + F[eat u( t)]
1
1
2a
+
= 2
j⌦ + a a j⌦
a + ⌦2
=
=
using duality
e
a|t|
$
a2
2a
+ ⌦2
2a
$ 2⇡e
a 2 + t2
so
X1 (⌦) =
⇡
e
a
a|⌦|
a|⌦|
.
Copyright 2014, Elsevier, Inc. All rights reserved.
k⌦0 )]
Chaparro — Signals and Systems using MATLAB
5.10
(a)
5.11
i. Fourier transform of
F[x(t)] =
0.5
j⌦ + a
0.5
j⌦
= 2
a j⌦
a + ⌦2
If we let a = 0 then
Y (⌦) =
1
j⌦
ii. Fourier transform of unit step signal
F[u(t)] = F[0.5] + Y (⌦) = 2⇡ ⇥ 0.5 (⌦) + Y (⌦) = ⇡ (⌦) +
1
j⌦
(b) A = Au(t) + Au( t) (assume u(0) = 0.5)
ROC:
L[Au(t)] = A/s
L[Au(= t)] =
The region of convergence 0 <
A/s
>0
ROC:
<0
< 0 is empty so the Laplace transform does not exist and the
Fourier transform cannot be obtained this way.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.11
5.12
(a) y(t) = m(t) cos(10t) has a spectrum
Y (⌦) = 0.5[M (⌦ + 10) + M (⌦
10)]
where when m(t) = cos(t) then
M (⌦) = ⇡[ (⌦
and when m(t) = r(t)
2r(t
M (⌦) =
1) + r(t
e j⌦ j⌦
(e
(j⌦)2
1) + (⌦ + 1)]
2)
2+e
j⌦
)=
2e j⌦
(1
⌦2
cos(⌦))
(b) Using Parseval’s power relation: if x(t) = sin(0.5t)/(⇡t) then X(⌦) = u(⌦ + 0.5)
so in the frequency
Px =
1
2⇡
Z
1
1
|X(⌦)|2 d⌦ =
1
2⇡
Z
0.5
d⌦ =
0.5
Copyright 2014, Elsevier, Inc. All rights reserved.
1
2⇡
u(⌦
0.5)
Chaparro — Signals and Systems using MATLAB
5.12
5.13
(a) A period of z(t) is z1 (t) = d2 x1 (t)/dt2 = (t)
2 (t
1) + (t
2), with period T0 = 2
(⌦0 = ⇡), its Fourier series coefficients are
Zk
=
1
1
Z1 (s)|s=j⇡k = 2e
2
2
=
( 1)k+1 (1
s
( 1)k ) =
(cosh(s) 1)|s=j⇡k
(
2 k odd
k even
0
then
1
X
z(t) =
2ejk⇡t =
k= 1,odd
1
X
2ej(2m+1)⇡t
m= 1
by letting k = 2m + 1. By the derivative property
Xk =
Zk
2
= 2 2 , k odd
2
(jk⌦0 )
k ⌦0
and
1
X
x(t) =
k= 1,odd
1
X
2( 1)k jk⇡t
2( 1)2m+1 j(2m+1)⇡t
e
=
e
k 2 ⌦20
(2m + 1)2 ⌦20
m= 1
(b) The average X0 = 0.5, and x(t)
0.5 is even so Xk , k 6= 0 are real and
z(t) is even and zero mean, so Zk are real and Z0 = 0
(c) The Fourier transform is
Z(⌦)
=
=
1
2⇡ X
T0
Z1 (⌦)
1
X
(⌦
k= 1
2⇡Zk (⌦
k⌦0 ) =
1
X
k= 1
2⇡
Z1 (⌦0 )
(⌦
T0
k⌦0 )
k= 1
and the inverse
z(t) =
X
k
F
1
[2⇡Zk (⌦
k⌦0 )] =
X
Zk ejk⌦0
k
Copyright 2014, Elsevier, Inc. All rights reserved.
k⌦0 )
Chaparro — Signals and Systems using MATLAB
5.13
5.14
(a) y(t) = d(s(t))/dt = 2 (t), and so
S(⌦) =
(b) The phase of S(⌦) is
Y (⌦)
2
=
j⌦
j⌦
⇡/2 for ⌦ > 0, zero at ⌦ = 0 and by odd symmetry ⇡/2 for ⌦ < 0. The
magnitude is |S(⌦)| = 2/|⌦|. See Fig. 5.1.
s(t)
1
t
1
|S(⌦)|
⌦
\S(⌦)
⇡/2
⌦
⇡/2
Figure 5.1: Problem 13
(c) s(t) = 2[u(t)
0.5] gives
S(⌦) =

2
+ 2⇡ (⌦)
j⌦
2⇡ (⌦) =
2
j⌦
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.14
(a) Let X(⌦) = A[u(⌦ + ⌦0 )
u(⌦
1
x(t) =
2⇡
5.15
⌦0 )] its inverse Fourier transform is
Z
⌦0
Aej⌦t d⌦ =
⌦0
so A = 1, ⌦0 = 0.5 and X(⌦) = u(⌦ + 0.5)
u(⌦
A sin(⌦0 t)
⇡t
0.5).
(b) Y (⌦) = H(⌦)X(⌦) = X(⌦) so that y(t) = (x ⇤ x)(t) = x(t), or convolution of a sinc function
with itself is a sinc.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.15
(a)
5.16
i. Modulation property
X(⌦) = P (⌦) + 0.5P (⌦
2 sin(⌦)
P (⌦) =
⌦
⇡) + 0.5P (⌦ + ⇡)
ii. We have
g(t) = x(t
1) = p(t
1) + p(t
1) cos(⇡(t
1)) = p(t
1)
p(t
1) cos(⇡t)
where
p(t
so that p(t
1) cos(⇡t)
=
cos(⇡t)u(t)
cos(⇡t)u(t
=
cos(⇡t)u(t)
cos(⇡(t
2)
2))u(t
2)
1) cos(⇡t) is a sum of causal sinusoids, thus
G(s) = e
and since G(s) = X(s)e
s
s
s
(1
s2 + ⇡ 2
P (s)
e
2s
)
then
s
(es
s2 + ⇡ 2
2⌦ sin(⌦)
X(⌦) = P (⌦) + 2
⇡
⌦2
X(s) = P (s)
e
s
)
We get the same expression for X(⌦) by using the modulation property:
0.5P (⌦
⇡) + 0.5P (⌦ + ⇡)
=
=
(b)
sin(⌦ ⇡) sin(⌦ + ⇡)
+
⌦ ⇡
⌦+⇡
sin(⌦)
sin(⌦)
2⌦ sin(⌦)
+
= 2
.
⌦ ⇡
⌦+⇡
⇡
⌦2
i. The condition is that the j⌦-axis be included in the region of convergence of the Laplace
transform. That is the case when the signal has finite time support, like in here.
ii. z(t) = cos(t)q(t) where q(t) = u(t)
u(t
⇡/2) so that
Z(⌦) = 0.5[Q(⌦ + 1) + Q(⌦
where
j⇡⌦/4
sin(⇡⌦/4)
⌦
which when replaced above does not give the expression given in the problem.
Q(⌦) =
2e
1)]
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.17
5.16 (a) The raised cosine is an even smooth signal with a value of 2 at the origin.
(b) The FT of the pulse p(t) = u(t + 1)
P (⌦)
u(t
=
=
1) is
1 s
[e
e
s
sin(⌦)
2
⌦
s
] |s=j⌦
(c) The FT of
x(t) = (1 + cos(2⇡t))p(t) = p(t) + p(t) cos(2⇡t)
is
1
X(⌦) = P (⌦) + [P (⌦
2
2⇡) + P (⌦ + 2⇡)]
2
x(t)
1.5
1
0.5
0
−2
−1.5
−1
−0.5
0
t
0.5
1
1.5
2
Figure 5.2: Problem 16: Raised cosine x(t)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.17
5.18
(a) Impulse response
h(t)
=
=
1
2⇡
Z
2
1e
j\H(j⌦) j⌦t
e
2
j j2t
(e
2⇡jt
1)
1
d⌦ =
2⇡
j
(e
2⇡jt
j2t
Z
2
e
0
1) =
1
d⌦ +
2⇡
cos(2t)
⇡t
j(⌦t ⇡/2)
1
Z
0
ej(⌦t+⇡/2) d⌦
2
(b) The frequency components of x(t) with harmonic frequencies bigger than 2 are filtered out so
yss (t) = 2|H(j1.5)| cos(1.5t + \H(j1.5)) = 2 cos(1.5t
⇡/2) = 2 sin(1.5t)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.18
5.19
(a) Plot of X(⌦) as function of ⌦:
X(⌦)
1
⇡
⌦
⇡
Figure 5.3: Problem 18
(b)
x(0) =
1
2⇡
Z
⇡
⇡
|⌦|
2
d⌦ =
⇡
2⇡
Z
⇡
0
⌦
1
d⌦ =
⇡
2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.19
5.20
(a) Poles are roots of D(s) = s2 + 2s + 2 = (s + 1)2 + 1 = 0 or
s1,2 =
1 ± j1
the zero is s = 0. It is a band-pass filter with center frequency around 1. Its magnitude response is
using vectors from the zero and the poles to the point in the j⌦–axis where are finding the frequency
response:
⌦
|H(j⌦)|
0 (zero at zero)
p
p
5(1)/[(1)( 4 + 1)] = 1
0
1
1
0 (vectors of two poles and zero have infinite lengths)
(b) Impulse response
H(s)
=
h(t)
=
=
p
p
5(s + 1)
5
(s + 1)2 + 1 (s + 1)2 + 1
p
p
p
5e t (cos(t) sin(t)) u(t) = 5e t 2 cos(t + ⇡/4)u(t)
p
10e t cos(t + ⇡/4)u(t)
(c) The steady state response corresponding to x(t) = B + cos(⌦t) is
y(t)
=
=
B|H(j0)| + |H(j⌦0 )| cos(⌦0 + \H(j⌦0 ))
|H(j⌦0 )| cos(⌦0 + \H(j⌦0 ))
for ⌦0 to be determined by looking at frequencies for which
p
5⌦0
|H(j⌦0 )| = p
=1
or
(2 ⌦20 )2 + 4⌦20
5⌦20 = 4
4⌦20 + ⌦40 + 4⌦20 )
⌦40
5⌦20 + 4 = (⌦20
4)((⌦20
1) = 0
giving values of
⌦0 = ±2, ± 1
so we have that when ⌦ = 1 or 2 the dc bias is filtered out and the cosine has a magnitude of 1.
The corresponding phases are using the pole and zero vectors
⌦0 = 1
⌦0 = 2
) \H(j⌦0 ) = ⇡/2
) \H(j⌦0 ) = ⇡/2
0
tan
tan
1
1
(1)
(2)
tan
Copyright 2014, Elsevier, Inc. All rights reserved.
1
(3)
Chaparro — Signals and Systems using MATLAB
5.20
5.21
(a) Filter corresponding to H1 (j⌦) calculates the derivative of the input, while the filter with frequency
response H2 (j⌦) delays the input by one unit of time.
(b) X(⌦) = 0.5[P (⌦ + ⇡/2) + P (⌦
⇡/2)] then
Y (⌦) = X(⌦)H1 (j⌦)H2 (j⌦) = j⌦X(⌦)e
j⌦
Call y1 (t) the output of the differentiator and y(t) the output of the delay
y1 (t)
=
=
=
dx(t)
d cos(⇡t/2)
dp(t)
= p(t)
+ cos(⇡t/2)
dt
dt
dt
⇡
sin(⇡t/2)p(t) + cos( ⇡/2) (t + 1) cos(⇡/2) (t
2
⇡
sin(⇡t/2)p(t)
2
1)
then
y(t) = y1 (t
1) =
⇡
sin(⇡(t
2
1)/2)p(t
1) =
⇡
cos(⇡t/2)[u(t)
2
u(t
2)]
(c) Since filters are LTI if we reverse the delay and the differentiator we get the same result as before.
Indeed, call z1 (t) the output of the delay and z(t) the output of the differentiator
z1 (t)
z(t)
=
x(t
=
[u(t) u(t 2)] sin(⇡t/2)
dz1 (t)
= [ (t)
(t 2)] sin(⇡t/2) + [u(t)
dt
⇡
0 + cos(⇡t/2)[u(t) u(t 2)].
2
=
=
1) = p(t
1) cos(⇡(t
1)/2)
u(t
Copyright 2014, Elsevier, Inc. All rights reserved.
2)]
⇡
cos(⇡t/2)
2
Chaparro — Signals and Systems using MATLAB
5.21
5.22
(a) We have
x(t)
=
j(ej⇡t/4
=
e
j⇡t/4
) + 2(ej5⇡t/4 + e
j5⇡t/4
)
2 sin(⇡t/4) + 4 cos(5⇡t/4)
The steady state response of the output is
y(t)
=
4|H(j5⇡/4)| cos(5⇡t/4 + \H(j5⇡/4)
=
4 cos(5⇡t/4
5⇡/4)
because the frequency component at ⇡/4 is filtered out.
(b) The Fourier transforms are
X(⌦)
Y (⌦)
=
2⇡ [X1 (⌦
=
2⇡ [j (⌦
=
4⇡e
j5⇡/4
⇡/4) + X
⇡/4)
(⌦
1
(⌦ + ⇡/4) + X5 (⌦
j (⌦ + ⇡/4) + 2 (⌦
5⇡/4) + 4⇡e
j5⇡/4
5⇡/4) + X
5
(⌦ + 5⇡/4)]
5⇡/4) + 2 (⌦ + 5⇡/4)]
(⌦ + 5⇡/4)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.22
5.23
(a) According to the eigenvalue property for x(t) = ej⌦t , 1 < ⌦ < 1, the output in the steady-state
would be y(t) = ej⌦t H(j⌦) so that the differential equation gives
j⌦ej⌦t H(j⌦) =
ej⌦t H(j⌦) + ej⌦t
1
giving H(j⌦) =
1 + j⌦
1
|H(j⌦)| = p
, \H(j⌦) =
1 + ⌦2
tan
1
(⌦)
|Y (⌦)|
1
0.707
⌦
1
1
Figure 5.4: Problem 22
(b) The magnitude response indicates the filter is a low-pass filter, in particular
⌦
0
|H(j⌦)|
1
\H(j⌦)
0
1
p1
2
⇡/4
1
0
⇡/2
(c) The Fourier transform of x(t) is X(⌦) = u(⌦ + 1)
u(⌦
1) so that the Fourier transform of the
output is
Y (⌦) = X(⌦)H(j⌦)
with magnitude response as in Fig. 5.4
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.23
5.24
(a) The signals
x1 (t) = x(t + 1)
1) ! X1 (⌦) = X(⌦)(ej⌦
x(t
x2 (t) = x(t + 1) + x(t) + x(t
(b) X3 (⌦) = 0.5X(⌦
e
j⌦
)
1) ! X2 (⌦) = X(⌦)(1 + e
⇡) + 0.5X(⌦ + ⇡)
(c) Since
Y (⌦) = X(⌦)e
j⌦
! Y (0) = X(0) =
Z
1
x(t)dt = 1.
1
Copyright 2014, Elsevier, Inc. All rights reserved.
j⌦
+ ej⌦ )
Chaparro — Signals and Systems using MATLAB
5.25
5.24 (a) The FT of x(t) is
X(⌦) = e
j⌦
+ ej⌦ = 2 cos(⌦)
(b) The derivative of X(⌦) is
Y (⌦) =
dX(⌦)
=
d⌦
2 sin(⌦)
and according to the FT definition
Y (⌦) =
dX(⌦)
d⌦
=
=
Z
Z
1
1
1
x(t)
de j⌦t
dt
d⌦
x(t)( jt)e
j⌦t
dt
1
so that
y(t) = x(t)( jt) =
jt (t
1)
jt (t + 1) =
j (t
1) + j (t + 1)
which gives
Y (⌦) =
je
j⌦
+ jej⌦ = e
verifying that multiplication by
j(⌦+⇡/2)
+ ej(⌦+⇡/2) = 2 cos(⌦ + ⇡/2) =
2 sin(⌦)
jt in the time domain corresponds to computing the derivative in the
⌦-domain.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.25 (a) (b) The Fourier series coefficients of
k
Ts (t)
=
so that
Ts (t)
=
are
1
1
L[ (t)]|s=jk⌦s =
Ts
Ts
1
X
k= 1
The FT of
Ts (t)
is then
(⌦) = F[
5.26
Ts (t)]
1 jk⌦s t
e
Ts
=
=
⌦s =
2⇡
Ts
1 X
F[1ejk⌦s t ]
Ts
k
2⇡ X
(⌦ k⌦s )
Ts
k
(c) Both
Ts (t)
and
Ts (⌦)
are periodic, the first of period Ts and the second of period 2⇡/Ts .
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.27
5.26 (a) The FT of the equation characterizing the averager is
j⌦Y (⌦)
=
0.5[X(⌦)
so that
Y (⌦) = X(⌦)
X(⌦)e
j2⌦
]
j⌦
sin(⌦)e
⌦
where the FT of x(t) is
X(⌦) =
e j⌦
[2(cos(⌦)
j⌦
1)] =
4
sin2 (⌦/2)
e
j⌦
(b) Calling Z(⌦) = X(⌦)/(j⌦) we have that y(t) = 0.5z(t)
Z(⌦) =
so that z(t) is the integral of x(t) = u(t)
X(⌦)
=
j⌦
2u(t
✓
0.5z(t
sin(⌦/2)
⌦/2
1) + u(t
◆2
e
j⌦
2) and
j⌦
2), or z(t) = r(t)
2r(t
1) + r(t
replacing it in the above expression for y(t) we get
y(t)
=
0.5r(t)
r(t
1) + 0.5r(t
=
0.5r(t)
r(t
1) + r(t
3)
2)
0.5r(t
0.5r(t
2) + r(t
4)
Copyright 2014, Elsevier, Inc. All rights reserved.
3)
0.5r(t
4)
2),
Chaparro — Signals and Systems using MATLAB
5.28
5.27 (a) The Fourier series coefficients of the half-wave rectified signal are
Xk =
1
X1 (s)|s=j⇡k
2
where
X1 (s) = L[sin(⇡t)u(t) + sin(⇡(t
1))u(t
1)] =
⇡(1 + e s )
s2 + ⇡ 2
giving
Xk =
cos(⇡k/2)e j⇡k/2
⇡(1 k 2 )
so that the magnitude of the first three coefficients are
1
⇡
cos(⇡k/2)
|X1 | =
|k=1 =
⇡(1 k 2 )
1
|X2 | =
3⇡
X0 =
(⇡/2) sin(⇡k/2)
1
|k=1 =
2k⇡
4
where to find |X1 | we need to apply the L’Hoppital’s rule because when replacing k = 1 we have a 0/0
situation.
(b) The low-pass filter would have a magnitude of ⇡ and cut-off frequency
0 < ⌦c < ⇡
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.29
5.28 (a) The spectrum of x(t) is
X(⌦) = 4⇡[ (⌦
1000) + (⌦ + 1000)]
the spectrum of y(t) is
Y (⌦) = 0.5[X(⌦
10000) + X(⌦ + 10000)]
This corresponds to the FT of the transmitted signal y(t). If the magnitude of the bandpass filter H(j⌦)
is 10, its center frequency is 10000 and a bandwith slightly larger than 2000, its output is 10y(t), the
received signals.
(b) By multiplying 10y(t) by cos(10000t) the spectrum of the output of the demodulator z(t) is
Z(⌦)
=
5[Y (⌦
10000) + Y (⌦ + 10000)]
=
2.5[X(⌦
=
5X(⌦) + 2.5[X(⌦
20000) + X(⌦)] + 2.5[X(⌦) + X(⌦ + 20000)]
20000) + X(⌦ + 20000)]
which has a lowpass component 5X(⌦). Passing z(t) through a low-pass filter G(⌦) of magnitude
1/5 and cutoff frequency any value slightly bigger than 1000 its output is X(⌦) which is the Fourier
transform of the message x(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.2
5.30
Problems using MATLAB
5.29 (a) The Fourier series average is
X0 =
1
T0
Z
T0 /2
x(t)dt =
T0 /2
1
T0
Z
0.5
dt =
0.5
1
T0
for any value of T0 . So for
1
2
1
=
4
1
=
8
T0 = 2 X01 =
T0 = 4 X02
T0 = 8 X03
T0 = 16 X04 =
1
16
so X0i decreases as T0 increases.
(b) The period
x1 (t) = u(t + 0.5)
u(t
0.5)
with Laplace transform
1 0.5s
[e
s
is the same for all values of T0 . The Fourier coefficients
X1 (s) =
Xk =
1
X1 (s)
T0
s=j2⇡k/T0
=
e
0.5s
]
1 sin(⇡k/T0 )
T0 k⇡/T0
1 sin(k⇡/2)
2 k⇡/2
1 sin(k⇡/4)
T0 = 4 Xk1 =
4 k⇡/4
1 sin(k⇡/8)
T0 = 8 Xk1 =
8 k⇡/8
1 sin(k⇡/16)
T0 = 16 Xk1 =
16 k⇡/16
T0 = 2 Xk1 =
harmonics are getting smaller and the line spectrum denser (⌦0 = 2⇡/T0 decreases as T0 increases).
(c) If T0 ! 1 the spectrum will disappear but it becomes very dense. We need to multiply Xk by T0 to
avoid the decreasing of the spectrum.
(d) The following script simulates the conversion of the Fourier series into the Fourier transform.
% Pr. 5_29
clear all;clf
Ts=0.001;t=-0.5:Ts:0.5;Nx=length(t);
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.31
figure(1)
for i=1:4,
T0=2ˆi;
x=[ones(1,Nx) zeros(1,(T0-1)*Nx) ones(1,Nx) zeros(1,(T0-1)*Nx) ones(1,Nx)];
NN=length(x);
tt=[-NN/2:(NN-1)/2]*Ts;
Omega=0:pi/T0:20;
N=length(Omega);
X1=sin(Omega)./Omega;
X1(1)=1;X2=fliplr(X1);
X=[X2 X1];
O=[-fliplr(Omega) Omega];
subplot(211)
plot(tt,x)
axis([min(tt) max(tt) 0 1.2])
grid;xlabel(’t (sec)’);ylabel(’x(t)’)
subplot(212)
stem(O,X)
axis([min(O) max(O) -0.5 1.2]);grid;xlabel(’\Omega_0’);ylabel(’X_{k T_0}’)
hold on
pause(1)
end
hold off
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.32
1
x(t)
0.8
0.6
0.4
0.2
0
−15
−10
−5
0
t (sec)
5
10
15
0.5
Xk T
0
1
0
−0.5
−15
−10
−5
0
Ω0
5
10
15
Figure 5.5: Problem 29: Pulses and normalized line spectrum approximating Fourier transform of single
pulse at origin.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.33
5.30 (a)(b) x1 (t) is an even square pulse with Laplace transform
1 s/2
[e
s
X1 (s) =
s/2
e
]
with region of convergence the whole s-plane (the pole is cancelled by a zero at zero) so that the Fourier
transform of x1 (t) is
X1 (⌦) = X1 (s)|s=j⌦ =
sin(⌦/2)
.
⌦/2
The signal x2 (t) can be written
x2 (t) = sin(2⇡t)[u(t)
u(t
0.5)] = sin(2⇡t)u(t) + sin(2⇡(t
0.5))u(t
0.5)
so that its Laplace transform is
X2 (s) =
2⇡
[1 + e
2
s + 4⇡ 2
s/2
]=
s/4
[es/4 + e
s2 + 4⇡ 2
2⇡e
s/4
]
The poles of X2 (s) are s1,2 = ±j2⇡ and the zeros are the values of s that make e
s/2
=
1 = ej⇡
which are infinite sk = ±j2⇡k, so that the poles are cancelled by zeros at the same frequency. The
region of convergence is thus the whole s-plane. Therefore the Fourier transform is
X2 (⌦) = X2 (s) |s=j⌦ =
4⇡e
j⌦/4
4⇡ 2
cos(⌦/4)
⌦2
The signal x3 (t) has a Laplace transform
X3 (s) =
1 s
[e
s2
2+e
s
]
with a region of convergence the whole s-plane. Again the pole at zero, s = 0, is cancelled by a zero
also at zero ( the zeros are values of s such that es
X3 (⌦) =
2+e
2(1
s
= es (1
e
) = 0 or sk = ±j2⇡k. So
s 2
cos(⌦))
⌦2
% Pr. 5_30
clear all;clf
%% Numerical computation
Ts=0.0001;
t1=0:Ts:1+Ts;N=length(t1);
x=[sin(2*pi*t1) zeros(1,N)];
N1=length(x);
t=0:N1-1;t=t*Ts;
[Xm,Xa,W]=AFourierT(x,Ts);
figure(1)
subplot(211)
plot(t,x)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.34
axis([0 max(t) -1.5 1.5])
xlabel(’t’)
ylabel(’x(t)’)
grid
M=length(W)/2;M1=M
subplot(212)
plot(W(M1-20:M1+20),Xm(M1-20:M1+20))
axis([W(M1-20) W(M1+20) 0 1.2])
grid
xlabel(’\Omega (rad/sec)’)
ylabel(’|X(\Omega)|’)
% symbolic computations
syms t w x
x1=heaviside(t+0.5)-heaviside(t-0.5);
X1=int(x1*exp(-j*w*t), t,-0.5,0.5)
figure(2)
subplot(211)
ezplot(x1,[-1,2]);grid;axis([-1 2 -2 2])
subplot(212)
ezplot(abs(X1),[-30,30]);grid;axis([-30 30 -0.25 1.25])
x2=sin(2*pi*t)*(heaviside(t)-heaviside(t-1))
X2=int(x2*exp(-j*w*t), t,0,0.5)
figure(3)
subplot(211)
ezplot(x2,[-1,2]);grid;axis([-1 2 -2 2])
subplot(212)
ezplot(abs(X2),[-30,30]);grid;axis([-30 30 -0.25 1.25])
x3=t*(heaviside(t)-heaviside(t-1))+(2-t)*(heaviside(t-1)-heaviside(t-2))
X3=int(x3*exp(-j*w*t), t,-Inf,Inf)
figure(4)
subplot(211)
ezplot(x3,[-1,3]);grid;axis([-1 3 -2 2])
subplot(212)
ezplot(sqrt(X3*conj(X3)),[-30,30]);grid;axis([-30 30 -0.25 1.25])
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
heaviside(t+1/2)−heaviside(t−1/2)
2
5.35
1.5
t (heaviside(t)−heaviside(t−1))+(2−t) (heaviside(t−1)−heaviside(t−2))
2
1
1
1
x(t)
0.5
0
0
0
−0.5
−1
−1
−1
−2
−1
−0.5
0
0.5
t
1
1.5
−1.5
2
0
0.2
0.4
0.6
0.8
1
t
1.2
1.4
1.6
1.8
2
−2
−1
−0.5
0
0.5
1
t
1.5
2
2.5
3
4 (1/w2 sin(1/2 w)2 exp(−i w) conj(1/w2 sin(1/2 w)2 exp(−i w)))1/2
2 abs(1/w sin(1/2 w))
1
1
1
|X(Ω)|
0.8
0.5
0.6
0.5
0.4
0
−30
0.2
−20
−10
0
w
10
20
30
0
0
−60
−40
−20
0
Ω (rad/sec)
20
40
−30
−20
−10
0
w
10
Figure 5.6: Problem 30: left to right — signals xi (t), i = 1, 2, 3 and their corresponding magnitude spectra
|Xi (⌦)|, i = 1, 2, 3.
Copyright 2014, Elsevier, Inc. All rights reserved.
20
30
Chaparro — Signals and Systems using MATLAB
5.36
5.31 (a) This is a decaying exponential for both negative and positive times.
(b) The signal is absolutely integrable,
Z
1
1
|x(t)|dt = 2
Z
1
2e
2t
dt = 4
e
2t
2
0
|1
t=0 = 2
(c) Using the integral definition of the Fourier transform
X(⌦)
=
2
Z
0
e2t e
1
t(2 j⌦)
2e
2
=
j⌦
2
=
2
j⌦
8
4 + ⌦2
=
+
j⌦t
|0 1
dt + 2
Z
1
e
0
t(2+j⌦)
2e
2 + j⌦
2t
e
j⌦t
|1
0
2
2 + j⌦
(d) The Laplace transform of X(s) is
X(s) =
with ROC:
2
2
2
8
+
=
s+2 s+2
4 s2
 2, which includes the j⌦-axis. so that
X(⌦) = X(s)|s=j⌦ =
8
4 + ⌦2
%% Pr. 5_31
syms t w x
x=2*exp(-2*abs(t));
figure(1)
X=fourier(x)
subplot(211)
ezplot(x,[-2,2]); grid; axis([-2 2 0 2.2])
subplot(212)
ezplot(abs(X),[-30,30]);grid;axis([-20 20 0 2.2]);
xlabel(’\Omega (rad/sec)’); ylabel(’|X(\Omega)|’)
Copyright 2014, Elsevier, Inc. All rights reserved.
dt
Chaparro — Signals and Systems using MATLAB
5.37
2/exp(2 abs(t))
2
1.5
1
0.5
0
−2
−1.5
−1
−0.5
0
t
0.5
1
1.5
2
5
10
15
20
8/abs(w2 + 4)
2
|X(Ω)|
1.5
1
0.5
0
−20
−15
−10
−5
0
Ω (rad/sec)
Figure 5.7: Problem 31
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.38
5.32 For the signal
x(t) =
1
[u(t)
T0
u(t
T0 )]
we have:
(a) For T0 = 1
e
s/2
[es/2
s
sin(⌦/2)
X(⌦) =
e
⌦/2
X(s) =
e
s/2
]
j⌦/2
The magnitude is zero at ⌦ = 2⇡k.
For T0 = 10
e 5s 5s
[e
e 5s ]
10s
sin(5⌦) j5⌦
X(⌦) =
e
5⌦
X(s) =
the magnitude is zero for ⌦ = k⇡/5, so that when we expand the signal in the time domain, the corresponding Fourier transform is contracted.
(b) As the time support increases/decreases the frequency support decreases/increases.
%% Pr. 5_32
syms x t
figure(1)
for k=0:2,
T0=10ˆk;
x=(1/T0)*(heaviside(t)-heaviside(t-T0));
X=fourier(x)
ezplot(abs(X),[-12,12]);grid;axis([-12 12 -0.25 1.25])
hold on
pause(1)
end
hold off
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.39
1/100 abs((−1+exp(−100 i w))/w)
1.2
1
0.8
0.6
0.4
0.2
0
−0.2
−10
−5
0
w
5
10
Figure 5.8: Problem 32
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.40
5.33 For the signals
x(t) = u(t + 0.5)
u(t
0.5)
y(t) = x(t) + x(t) cos(⇡t) = x(t)[1 + cos(⇡t)]
by looking at these signals it is hard to determine which is smoother. We need to look at their spectra.
(b) The Fourier transform of x(t) is given by
X(⌦) =
sin(⌦/2)
⌦/2
(c) The Fourier transform of y(t) is, using the modulation property,
Y (⌦) = X(⌦) + 0.5X(⌦
⇡) + 0.5X(⌦ + ⇡)
It would seem that the shifting of the spectrum X(⌦) would generate higher frequencies for y(t), but
that might not be so. Using MATLAB to compute the spectra of these two signals would help us decide
if we are right or not.
(d) To decide which one is smoother by means of their spectra we make both unit energy. Signal y(t)
shows less energy in the higher frequencies than x(t) so y(t) is smoother.
% Pr. 5_33
clear all;clf
Ts=0.001;
t=-0.5:Ts:0.5;t1=-1:Ts:-0.5;t2=0.5:Ts:1;N1=length(t1);N2=length(t2);N=length(t);
x=[zeros(1,N1) ones(1,N) zeros(1,N2)]; tt=[t1 t t2];
y=x.*(1+cos(pi*tt)); I=sum(y.ˆ2)/N; y=y/sqrt(I);
I2=sum(y.ˆ2)/N; % checking both are unit energy
I1=sum(x.ˆ2)/N;
[Xm,Xa,W]=AFourierT(x,Ts);
[Ym,Ya,W]=AFourierT(y,Ts);
figure(1)
subplot(221)
plot(tt,x); axis([-1 1 0 1.5]);grid;title(’x(t)’)
subplot(223)
plot(tt,y); axis([-1 1 0 1.5]);grid;title(’y(t)’)
subplot(222)
plot(W,20*log10(Xm)); axis([-200 200 -80 0]); grid; title(’magnitude spectrum of X(\Omega)’)
subplot(224)
plot(W,20*log10(Ym)); axis([-200 200 -80 0]); grid; title(’magnitude spectrum of Y(\Omega)’)
% symbolic computation
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.41
syms x t y w
x=heaviside(t+0.5)-heaviside(t-0.5);
Ex=int(xˆ2,t,-0.5, 0.5)
x=x/sqrt(Ex);
y=x*(1+cos(pi*t));
Ey=int(yˆ2,t,-0.5, 0.5)
y=y/sqrt(Ey);
figure(1)
subplot(221)
ezplot(x,[-0.6 0.6])
subplot(222)
ezplot(y,[-0.6 0.6])
X=fourier(x)
Y=fourier(y)
subplot(223)
ezplot(10*log10(abs(X)ˆ2),[-30 30]);grid
subplot(224)
ezplot(10*log10(abs(Y)ˆ2),[-30 30]);grid
x(t)
1.5
0
magnitude spectrum of X(Ω)
−20
1
−40
0.5
0
−1
−60
−0.5
0
0.5
1
y(t)
1.5
−80
−200
0
−100
0
100
200
magnitude spectrum of Y(Ω)
−20
1
−40
0.5
0
−1
−60
−0.5
0
0.5
1
−80
−200
−100
0
100
200
Figure 5.9: Problem 33: signals and their magnitude spectra (in dB).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.42
5.34 (a) The triangular pulse x(t) is even
x(t) = r(t + 1)
2r(t) + r(t
1)
y(t) = u(t + 1)
2u(t) + u(t
1)
and its derivative is
which is an odd signal composed of two pulses of duration 1.
(b) The Fourier transform of x(t) is computed from its Laplace transform
X(s) =
1 s
[e
s2
2+e
s
]=
es
[1
s2
2e
s
+e
2s
]=
es
(1
s2
e
s 2
)
which cancels out the poles at s = 0 so that the region of convergence is the whole s-plane. By letting
s = j⌦ we have that
X(⌦) =
2
[cos(⌦)
⌦2
1] =
sin2 (⌦/2)
(⌦/2)2
which is real given that x(t) is even.
(c) Because of the derivative
Y (⌦) = j⌦X(⌦) = j⌦
sin2 (⌦/2)
(⌦/2)2
which is imaginary given that y(t) is odd. The magnitude
|Y (⌦)| = |X(⌦)||⌦|
which is the product of the sinc square and the absolute value of ⌦. Thus x(t) is smoother than its
derivative y(t).
%% Pr. 5_34
syms x
t w y X Y
x=(t+1)*(heaviside(t+1)-heaviside(t))+(1-t)*(heaviside(t)-heaviside(t-1));
y=heaviside(t+1)-2*heaviside(t)+heaviside(t-1);
figure(1)
subplot(211)
ezplot(x,[-1.5,1.5]);grid
subplot(212)
ezplot(y,[-1.5,1.5]);grid
X=int(x*exp(-j*w*t),t,-Inf,-Inf);
Y=int(y*exp(-j*w*t),t,-Inf,-Inf);
figure(2)
subplot(211)
XX=X*conj(X);
ezplot(10*log10(XX),[-100,100]);grid;axis([-100 100 -80 1]);ylabel(’X(\Omega)’)
subplot(212)
YY=Y*conj(Y);
ezplot(10*log10(YY),[-100,100]);grid;axis([-100 100 -80 1]);ylabel(’Y(\Omega)’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.43
(t+1) (heaviside(t+1)−heaviside(t))+(1−t) (heaviside(t)−heaviside(t−1))
10 log(16/w2 sin(1/2 w)2 conj(1/w2 sin(1/2 w)2))/log(10)
1
0
0.8
−20
X(Ω)
0.6
0.4
0.2
−40
−60
0
−1.5
−1
−0.5
0
t
0.5
1
−80
−100
1.5
−80
−60
0
−20
Y(Ω)
1
0.5
0
−20
0
w
20
40
60
80
100
80
100
−40
−60
−0.5
−1
−1.5
−40
10 log(16/w sin(1/2 w)2 conj(1/w sin(1/2 w)2))/log(10)
heaviside(t+1)−2 heaviside(t)+heaviside(t−1)
−80
−100
−1
−0.5
0
t
0.5
1
1.5
−80
−60
−40
−20
0
w
20
40
60
Figure 5.10: Problem 34: signals and their magnitude spectra (in dB).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.44
5.35 (a) The signal x(t) is composed of two pulses, a non-causal positive pulse starting at
1 and ending at
zero, and a negative causal pulse from 0 to 1, the integral of this signal is a triangular signal y(t) from
1 to 1. See the script below.
(b) The Fourier transform is given by
X(⌦) =
1
(2 cos(⌦)
j⌦
2) = j
(sin(⌦/2))2
⌦/4
which is imaginary given that x(t) is odd.
(c) According to the integration property the Fourier transform of y(t) is
X(⌦)
Y (⌦) =
=
j⌦
✓
sin(⌦/2)
⌦/2
◆2
which is real given that y(t) is even. It can also be obtained from the Laplace transform. The y(t) is
given as
y(t) = r(t + 1)
2r(t) + r(t
1)
with Laplace transform
Y (s) =
1 s
(e
s2
2+e
s
)=
1 s/2
(e
s2
e
s/2 2
)
with region of convergence the whole s-plane excluding the origin. Thus,
Y (⌦) =
1
( 4 sin2 (⌦/2)) =
⌦2
✓
sin(⌦/2)
⌦/2
◆2
which is real given that y(t) is even. It can be generalized that when the signal is even the FT is real and
when the signal is odd the FT is imaginary.
(d) The signal y(t) is smoother since it goes faster to zero as ⌦ increases. Integration smoothes out a
signal.
%% Pr. 5_35
syms x
t y X Y
x=heaviside(t+1)-2*heaviside(t)+heaviside(t-1)
y=int(x);
figure(1)
subplot(211)
ezplot(x,[-2,3]);grid
subplot(212)
ezplot(y,[-2,3]);grid
X=int(x*exp(-j*w*t),t, -1,1);
Y=int(y*exp(-j*w*t),t,-1,1);
figure(2)
subplot(211)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.45
XX=X*conj(X);
ezplot(sqrt(XX),[-50,50]);grid;axis([-50 50 0 1.5]);ylabel(’X(\Omega)’)
subplot(212)
YY=Y*conj(Y);
ezplot(sqrt(YY),[-50,50]);grid;axis([-50 50 0 1.5]);ylabel(’Y(\Omega)’)
heaviside(t+1)−2 heaviside(t)+heaviside(t−1)
4 (1/w sin(1/2 w)2 conj(1/w sin(1/2 w)2))1/2
1.5
1
0.5
X(Ω)
1
0
0.5
−0.5
−1
−2
−1.5
−1
−0.5
0
0.5
t
1
1.5
2
2.5
0
−50
3
−40
−30
−20
−10
2
heaviside(t+1) t+heaviside(t+1)−...−heaviside(t−1)
10
2
20
30
40
50
30
40
50
2 1/2
4 (1/w sin(1/2 w) conj(1/w sin(1/2 w) ))
1.5
1
0
w
2
0.8
1
Y(Ω)
0.6
0.4
0.5
0.2
0
−2
−1.5
−1
−0.5
0
0.5
t
1
1.5
2
2.5
3
0
−50
−40
−30
−20
−10
0
w
10
Figure 5.11: Problem 35: signals and their magnitude spectra.
Copyright 2014, Elsevier, Inc. All rights reserved.
20
Chaparro — Signals and Systems using MATLAB
5.46
5.36 Voltage across capacitor The transfer function is
VC (s)
1/s
1
=
= 2
Vs (s)
1 + s + 1/s
s +s+1
corresponding to a low-pass filter.
Voltage across inductor The transfer function is
VL (s)
s
s2
=
= 2
Vs (s)
1 + s + 1/s
s +s+1
corresponding to a high-pass filter.
Voltage across resistor The transfer function is
VR (s)
1
s
=
= 2
Vs (s)
1 + s + 1/s
s +s+1
corresponding to a band-pass filter.
%% Pr 5_36
clear all; clf
%% in descending order
n=[0 0 1]; d=[1 1 1];
figure(1)
wmax=20;
freq_resp_s(n,d,wmax)
n1=[1 0 0]; d1=d;
figure(2)
freq_resp_s(n1,d1,wmax)
n2=[0 1 0];d2=d;
figure(3)
freq_resp_s(n2,d2,wmax)
Magnitude response
Phase response in degrees
0
Magnitude response
Phase response in degrees
Magnitude response
Phase response in degrees
1
−150
0
5
Ω
10
0
0.4
5
Ω
0
10
0
Poles/Zeros
0.5
5
Ω
10
0
5
Ω
10
Imaginary Part
0
−0.5
−1
1
5
Ω
10
1
0.5
0
−0.5
−1
−1 −0.5 0
0.5
Real Part
0
Poles/Zeros
1
0.5
0.5
0
2
−0.5
−1
−1 −0.5 0
0.5
Real Part
100
50
0
Poles/Zeros
1
Imaginary Part
0
−50
0.2
Imaginary Part
0
0.6
150
< H(j Ω)
−100
< H(j Ω)
|H(j Ω)|
0.5
1
50
0.8
|H(j Ω)|
−50
< H(j Ω)
|H(j Ω)|
1
1
−1 −0.5 0
0.5
Real Part
1
Figure 5.12: Problem 36: left to right: low-pass, band-pass and high-pass filters.
Copyright 2014, Elsevier, Inc. All rights reserved.
0
0
5
Ω
10
Chaparro — Signals and Systems using MATLAB
5.47
5.37 (a) The impulse response of the given filter is obtained by duality. It is of the form h(t) = A[u(t + t0 )
u(t
t0 )] where A and t0 are obtained by finding its Fourier transform
H(j⌦)
Z
=
t0
Aej⌦t dt = A
t0
ej⌦t t0
|
j⌦ t0
2j sin(⌦t0 )
A
j⌦
=
so that t0 = ⇡ and 2A = 1/⇡ or A = 1/2⇡. Thus
h(t) =
1
[u(t + ⇡)
2⇡
u(t
⇡)] = 0.16[u(t + ⇡)
u(t
⇡)].
which is non-causal since h(t) 6= 0 for t < 0.
(b) The impulse response of the bandpass filter is
g(t) = 2h(t) cos(5⇡t) = 0.32
which is real. Its magnitude response is
G(j⌦) = H(j(⌦
5⇡)) + H(j(⌦ + 5⇡))
%% Pr. 5_37
syms H w t h g G
H=sinc(w);
h=real(ifourier(H,t));
figure(1)
subplot(211)
ezplot(H,[-2*pi,2*pi]);grid;axis([-2*pi 2*pi -0.5 1.2])
xlabel(’\Omega’);ylabel(’H(j\Omega)’)
subplot(212)
ezplot(h,[-20,20]);grid;axis([-20 20 -0.05 0.2])
xlabel(’t’); ylabel(’h(t)’)
g=2*h*cos(5*t);
G=int(g*exp(-j*w*t),t,-100,100)
figure(2)
subplot(211)
ezplot(g,[-10,10]);grid;axis([-10 10 -0.5 0.5]);xlabel(’t’);title(’ ’)
xlabel(’t’);ylabel(’g(t)’)
subplot(212)
ezplot(sqrt(G*conj(G)),[-30,30]);
grid;axis([-30 30 -0.1 1.1])
xlabel(’\Omega’);title(’ ’)
xlabel(’\Omega’);ylabel(’G(j\Omega)’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
5.48
sin(π w)/(π w)
0.5
0.5
g(t)
H(jΩ)
1
0
0
−0.5
−6
−4
−2
0
Ω
2
4
−0.5
−10
6
2
−8
−6
−4
−2
0
t
2
4
6
8
10
2
(π conj(heaviside(π + t)) − π conj(heaviside(t − π)))/(4 π ) + (π heaviside(π + t) − π heaviside(t − π))/(4 π )
0.2
1
0.15
0.8
G(jΩ)
h(t)
0.1
0.05
0.6
0.4
0.2
0
0
−0.05
−20
−15
−10
−5
0
t
5
10
15
20
−30
−20
−10
0
Ω
10
Figure 5.13: Problem 37: non–causal low-pass (left) and bandpass filters (right).
Copyright 2014, Elsevier, Inc. All rights reserved.
20
30
Chaparro — Signals and Systems using MATLAB
5.49
5.38 The transfer functions are
(s 1)(s 1 + j⇡)(s 1 j⇡)
(s 1)((s 1)2 + ⇡ 2 )
=
(s + 1)(s + 1 j⇡)(s + 1 + j⇡)
(s + 1)((s + 1)2 + ⇡ 2 )
(s + j⇡)(s j⇡)
s2 + ⇡ 2
H2 (s) =
=
(s + 1)(s + 1 + j⇡)(s + 1 j⇡)
(s + 1)((s + 1)2 + ⇡ 2 )
s 1
s 1
H3 (s) =
=
(s + 1)(s + 1 + j⇡)(s + 1 j⇡)
(s + 1)((s + 1)2 + ⇡ 2 )
H1 (s) =
H1 (s) is the transfer function of an all-pass filter. H2 (s) corresponds to a notch type of filter (the notches
are at ±⇡) and behaves like a low-pass in the low frequencies and goes to zero at high frequencies. H3 (s)
corresponds to a low-pass filter.
%% Pr. 5_38
clear all; clf
%% in descending orde
n=[1 -3 3+piˆ2 -(1+piˆ2)];
d=[1 3 3+piˆ2 (1+piˆ2)];
figure(1)
wmax=20;
freq_resp_s(n,d,wmax)
n1=[0 1 0 piˆ2]; d1=d;
figure(2)
freq_resp_s(n1,d1,wmax)
n2=[0 0 1 -1];;d2=d;
figure(3)
freq_resp_s(n2,d2,wmax)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
Magnitude response
Phase response in degrees
1
50
0
−50
−100
< H(j Ω)
0.4
|H(j Ω)|
0.6
0.2
0.6
0.4
0
5
10
Ω
15
20
−50
−100
0.2
−150
−150
0
5
10
Ω
15
0
20
0
5
Poles/Zeros
10
Ω
15
20
0
5
10
Ω
15
20
Poles/Zeros
3
3
2
2
Imaginary Part
Imaginary Part
Phase response in degrees
0
0.8
100
< H(j Ω)
|H(j Ω)|
Magnitude response
150
0.8
0
5.50
1
0
−1
−2
−3
1
0
−1
−2
−3
−4
−2
0
Real Part
2
4
−4
Magnitude response
−2
0
Real Part
2
4
Phase response in degrees
150
0.15
< H(j Ω)
|H(j Ω)|
100
0.1
0.05
50
0
−50
−100
−150
0
0
5
10
Ω
15
20
0
5
10
Ω
15
20
Poles/Zeros
Imaginary Part
3
2
1
0
−1
−2
−3
−4
−2
0
Real Part
2
4
Figure 5.14: Problem 38: frequency responses and poles/zeros of H1 (s), H2 (s) (top) and H3 (s) (bottom)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chapter 6
Application of Laplace Analysis to
Control
6.1
Basic Problems
6.1 (a) Nodal equations (circuit (a) in Fig. 6.1)

V1 (s)/1
0
=

2+s
1
1
1+s

V2 (s)
V3 (s)
then

2 + s V1 (s)
1
0

V3 (s) =
2+s
1
det
1
1+s
det
=
V1 (s)
s2 + 3s + 1
)
V3 (s)
1
= 2
V1 (s)
s + 3s + 1
(b) With the voltage follower (circuit (b) in Fig. 6.1)
V3 (s)
V3 (s) V2 (s)
1
=
=
V1 (s)
V2 (s) V1 (s)
(s + 1)(s + 1)
there is no loading in this case so we obtain the desired transfer function.
(c) Three stages with transfer functions
H1 (s) =
1000
1
1
, H2 (s) =
, H3 (s) =
s + 1000
s+1
1000
as shown in circuit (c) of Fig. 6.1 will give the desired transfer function G(s).
1
Chaparro — Signals and Systems using MATLAB
1⇥
+
1⇥
1⇥
v2 (t)
+
+
v1 (t)
6.2
1F
1F
+
+
vi (t)
1⇥
+
+
v2 (t) 1F
v3 (t) v1 (t) 1F
v3 (t)
(b)
(a)
1⇥
+
1⇥
+
10
3
+
1F
F
999 ⇥
+
1⇥
vo (t)
(c)
+
Figure 6.1: Problem 1: Cascade of two RC circuits (a) with loading and(b) no loading; (c) cascading 3
circuits to implement given G(s)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.3
6.2 (a) Using Kirchkoff’s voltage laws we have
(i)
Vi (s) = I(s)[R1 + R2 ] + Vo (s)
(ii)
Vi (s) = R1 I(s) + V (s)
(iii)
Vo (s) =
AV (s)
where Vi (s), Vo (s), V (s), I(s) are Laplace transforms of vi (t), vo (t), v (t) and the current i(t) through
R1 and R2 (the current into the negative terminal is assumed zero). From (i)
I(s) =
Vi (s) Vo (s)
R1 + R2
We then have in (ii)
(iv) Vi (s)
=
R1 (Vi (s) Vo (s))
+ V (s)
R1 + R 2
which can be rewritten as after replacing V (s) in (iii)

R1
R1 Vo (s) + V (s)(R1 + R2 )
Vi (s) 1
=
R 1 + R2
R 1 + R2
✓
◆
R2
Vo (s)
R2
Vi (s) = Vo (s) +
1+
R1
A
R1
which represents a negative feedback as shown in Fig. 6.2.
Notice that (iv) becomes
Vi (s)
R2
R1
Vo (s)
+
R1 + R 2
AR1
Figure 6.2: Problem 2: negative feedback equivalent of op-amp inverting amplifier.
R1 (Vi (s) Vo (s)) Vo (s)
R 1 + R2
A
after replacing equation (iii). If we let A ! 1 we get Vo (s)/Vi (s) =
the feedback signal is then zero giving the same result.
Vi (s) =
R2 /R1 . According to Fig. 6.2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.4
6.3 (a) The transfer function of the RC circuit is
Vo (s)
1/RC
=
Vi (s)
s + 1/(RC)
An equivalent negative feedback with a feed–forward transfer function G(s), and feedback transfer function H(s) = 1 gives
Vo (s)
G(s)
=
Vi (s)
1 + G(s)
Comparing the two we get that G(s) = 1/(RCs). Considering an integrator has a transfer function 1/s
then we have the equivalent representations for the RC circuit shown in Fig. 6.4.
vi (t)
+
e(t) 1
RC
(.)dt
vo (t)
Figure 6.3: Problem 3: negative feedback equivalent of RC circuit.
(b) If vi (t) = Au(t), Vi (s) = A/s, then
Vo (s) =
A/RC
B
D
=
+
s(s + 1/(RC))
s
s + 1/RC
Since 1/RC > 0, i.e., the pole of Vo (s) is in the left-hand s-plane, then in the steady state vo (t) = B,
where
A/RC
B = Vo (s)s|s=0 =
=A
1/(RC)
so that in the steady–state the error signal e(t) = vi (t)
vo (t) will be zero.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.5
6.4 (a) The transfer function of the RLC circuit with output Vo (s) = Vc (s) is
Vo (s)
1/Cs
1/LC
=
= 2
Vi (s)
R + Ls + 1/Cs
s + (R/L)s + 1/LC
Letting, R = L = C = 1 the differential equation corresponding to the above transfer function is
d2 vo (t) dvo (t)
+
+ vo (t) = vi (t)
dt2
dt
which can be implemented using two integrators and an adder as shown in Fig. 6.4(a).
(b) Letting the negative feedback be the one shown in Fig. 6.4(b), comparing it to the above transfer
function (let again R = L = C = 1) we have
Vo (s)
1/s
G(s)
=
=
Vi (s)
1 + s + 1/s
1 + G(s)H(s)
so that
G(s) =
1
s
1
) H(s) = s2 + 1
s
G(s)H(s) = s +
(c) E(s) = Vi (s)
(s2 + 1)Vo (s) and
vi (t) +
vo(2) (t)
vo(1) (t)
(.)dt
vo (t)
(.)dt
(a)
vi (t)
+
e(t)
G(s) =
1
s
vo (t)
H(s) = s2 + 1
(b)
Figure 6.4: Problem 4: feedback equivalents of RLC circuit: (a) from differential equation, (b) from transfer
function (R = L = C = 1).
1
A
Bs + C
= + 2
+ s + 1)
s
s +s+1
p
2
2
since s + s + 1 = (s + 1/2) + 3/4, its roots are s1,2 = 1/2 ± j 3/4, in the left-hand s–plane, and
the steady state response is vo (t) = A where A = 1. The steady–state error is then
Vo (s) =
s(s2
lim [e(t) = vi (t)
t!1
d2 vo (t)
dt2
vo (t)] = 1
0
1 = 0.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.6
6.5 (a) The transfer function of a stable second–order all–pass filter is of the form
T (s) =
(s ↵ + j )(s ↵
(s + ↵ + j )(s + ↵
j )
(s ↵)2 +
=
j )
(s + ↵)2 +
2
2
=
N (s)
N ( s)
for ↵ > 0 and
0. The poles of T (s) are in the left-hand s-plane, and the poles an zeros are symmetric
with respect to the j⌦–axis, i.e., have the same imaginary parts and opposite real parts. If we call the
numerator N (s), the denominator of T (s) is N ( s).
For a negative feedback system with feed-forward transfer function G(s) and feedback transfer function
H(s) we have
G(s)
N (s)
=
1 + G(s)H(s)
N ( s)
which gives
G(s) =
N (s)
N ( s) N (s)H(s)
Thus if we let H(s) = 1, then
G(s)
=
=
N (s)
(s
=
2
N ( s) N (s)
(s + ↵) +
(s ↵)2 + 2
4↵s
For a positive feedback we let H(s) =
G(s)
=
=
For the given
we have also that ↵ =
p
2/2,
↵)2 +
2
(s
2
↵)2 +
+ (s
2
↵)2
2
1 and then
N (s)
(s
=
N ( s) + N (s)
(s + ↵)2 +
(s ↵)2 + 2
2(s2 + ↵2 + 2 )
2
↵)2 +
2
p
s2
2s + 1
N (s)
p
T (s) =
=
2
N ( s)
s + 2s + 1
p
= 2/2. Thus for the negative feedback implementation we let
H(s) = 1
G(s) =
p
2s + 1
p
2 2s
s2
and for the positive feedback implementation we let
H(s) =
G(s) =
1
s
2
p
2(s2
2s + 1
+ 1)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.7
6.6 (a) Replacing F (s) we have
E(s)
=

X(s) 1
=
X(s)D(s)
D(s) + N (s)
G(s)
1
= X(s)
1 + G(s)
1 + N (s)
D(s)
If X(s) = 1/s then for the error to go to zero in the steady state, the roots of D(s) + N (s) should be
in the left–hand s-plane and D(s) must cancel the pole of E(s) at zero contributed by X(s), i.e., D(s)
must be of the form D(s) = sD1 (s).
(b) For G(s) = 1/(s + 1)(s + 2) and X(s) = 1/s the Laplace transform of the error is
E(s) =
D(s)
(s + 1)(s + 2)
=
s(1 + D(s))
s(s2 + 3s + 3)
According to the initial value theorem we have that
(1 + 1/s)(1 + 2/s)
=1
1 + 3/s + 3/s2
p
3/2 ± j 3/4 since s2 + 3s + 3 = (s + 3/2)2 + 3/4. A partial
e(0) = lim sE(s) = lim
s!1
s!1
The poles of E(s) are s = 0 and s1,2 =
fraction expansion for E(s) is
E(s) =
A
Bs + C
+ 2
s
s + 3s + 3
where
A = sE(s)|s=0 =
D(0)
2
=
1 + D(0)
3
in this case the steady state error is 2/3. The error is not zero in the steady–state because D(s) does not
cancel the pole due to X(s).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.7
(a) h(t) = hp (t)e
t
=e
t
6.8
sin(t)u(t) so
H(s) =
1
(s + 1)2 + 1
For feedback system
H(s) =
Hc (s)Hp (s)
Hc (s)
= 2
1 + Hc (s)Hp (s)
s + 1 + Hc (s)
after replacing Hp (s) = 1/(s2 + 1). Then
s2
Hc (s)
1
s2 + 1
=
) Hc (s) =
2
+ 1 + Hc (s)
(s + 1) + 1
(s + 1)2
(b) Unit-step response s(t)
S(s)
=
=
H(s)
1
=
s
s((s + 1)2 + 1)
A
B
B⇤
+
+
s
s ( 1 + j) s ( 1
j)
where
A =
B
=
sS(s)|s=0 = 0.5
1
|s=
s(s + 1 + j)
1+j
1
= p ej3⇡/4
2 2
thus
s(t) = [0.5 + 0.707 cos(t + 3⇡/4)]u(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.8
6.9
(a) Transfer function of feedback system
G(s)
1
= 2
=p
H(s) =
1 + F (s)G(s)
s + 2s + ↵
↵
p
↵ 1
1((s + 1)2 + ↵
1)
with inverse Laplace transform
h(t) = p
1
e
↵ 1
t
p
sin( ↵
1t)u(t)
so that ↵ = 4.
(b)
i. When F (s) = 0, the system is open-loop, Y (s) = X(s)G(s) so
G(s) =
Y (s)
s(s + 1)
= 2
X(s)
s +1
corresponding to an unstable system because of poles at s = ±j.
ii. When F (s) 6= 0, i.e., the feedback loop is closed, the transfer function of the overall system is
H(s) =
Y (s)
s2 + 1
G(s)
=
=
X(s)
s(s + 1)
1 + G(s)F (s)
then solving for F (s) in the last equation
F (s)
=
=
G(s) H(s)
1
1
=
H(s)G(s)
H(s) G(s)
s(s + 1)
s2 + 1
2s3 s2 1
=
s2 + 1
s(s + 1)
s(s + 1)(s2 + 1)
iii. Poles of F (s) are 0, 1, ±j, three of which are in j⌦-axis of the s-plane, so the corresponding
system is unstable.
iv. H(s) is not proper rational so we divide to obtain
H(s) =
s2 + 1
s+1
1
=1+
=1+
s(s + 1)
s(s + 1)
s
2
) h(t) = (t) + u(t)
s+1
The feedback system is not BIBO stable because there is a pole at s = 0.
Copyright 2014, Elsevier, Inc. All rights reserved.
2e t u(t)
Chaparro — Signals and Systems using MATLAB
6.9
(a) Output of system A: x(t) = (t)
y(t) = e
2t
u(t)
(b) When x(t) = (t), y(t) = e
1/(s + 2) so
[u(t)
0.5(1
2t
6.10
u(t
e
2t
1)] and by superposition
)u(t) + 0.5(1
e
2(t 1)
)u(t
1)
u(t) which is the impulse response, thus H(s) = Y (s)/X(s) =
dy(t)
+ 2y(t)
dt
=
x(t)
=
dz(t)
dt
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.10
6.11
(a) Laplace transforms
(s + 1)W (s) = X(s)
(s + 2)Y (s) = W (s)
replacing W (s) in the second equation gives
(s + 2)Y (s) =
so that
X(s)
Y (s)
1
1
)
=
= 2
s+1
X(s)
(s + 1)(s + 2)
s + 3s + 2
d2 y(t)
dy(t)
+3
+ 2y(t) = x(t)
2
dt
dt
(b) i. For the first system, the Laplace transform of its differential equation is
sW (s)
w(0) + W (s) = 0 ) W (s) =
1
) w(t) = e t u(t)
s+1
ii. For the second system with input w(t) = e t u(t)
sY (s)
y(0) + 2Y (s) =
1
1
) Y (s) =
s+1
(s + 1)(s + 2)
so that
Y (s) =
1
s+1
1
) y(t) = (e
s+2
t
e
2t
)u(t)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.11
6.12
(a) Using linearity
V (s) = 0 !
Y (s)
X(s)
=
=
X(s) = 0 !
Y (s)
V (s)
=
=
(b) Letting X(s) = 1/(s + 1) and V (s) = 1/s
we have
Y (s)
=
=
1/s
1 + 1/(s(s + 1))
s+1
2
s +s+1
1
1 + 1/(s(s + 1))
s(s + 1)
s2 + s + 1
1/(s + 1) = 1/(s(s + 1)) and using superposition
s+1
s(s + 1)
X(s) + 2
V (s)
s2 + s + 1
s +s+1
1
1
2
+ 2
= 2
2
s +s+1 s +s+1
s +s+1
and so
p
3/4
then
3/4 (s + 0.5)2 + 3/4
p
p
4 3 0.5t
y(t) =
e
sin( 3/4t)u(t)
3
Y (s) = p
2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.12
6.13
(a) Let G(s) = 1/(s(s + 1/Q)) be the Laplace transform in the feedforward loop and with unit gain
in the feedback then
H(s) =
G(s)
1/(s(s + 1/Q))
1
=
= 2
1 + G(s)
1 + 1/(s(s + 1/Q))
s + s/Q + 1
(b) Writing s2 + s/Q + 1 = (s + 1/(2Q))2 + (1
p1,2 =
1/(4Q2 )) the poles are
p
1
±j 1
2Q
1/(4Q2 )
which have a magnitude of one and the angle measured with respect to the negative real–axis is
p
p
1 1/(4Q2 )
1
= tan
= tan 1 ( 4Q2 1)
1/2Q
The real part
1
1
= 1 cos( ) ! Q =
2Q
2 cos( ))
(c) When Q = 0.5, 0.707, 1 the angle
= 0, ⇡/4, ⇡/2. For
1
when
(s +
+ (1 1/(4Q2 ))
1
Q = 0.5 ! H(s) =
(s + 1)2
1
p
Q = 0.707 ! H(s) =
(s + 1/ 2)2 + 1/2
1
Q ! 1 ! H(s) = 2
s +1
H(s) =
1/(2Q))2
and the corresponding impulse responses are
h(t) = te t u(t)
p
p
1
h(t) = p e t/ 2 sin(t/ 2)u(t)
2
h(t) = sin(t)u(t)
As Q increases the impulse response becomes more oscillatory.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.13
6.14
(a) The feedforward transfer function is
G(s) = Gc (s)Gp (s) =
K 1 + K2 s
s(s + 1)
so that
K1 +K2 s
H(s)
=
Y (s)
G(s)
s(s+1)
=
=
1 +K2 s
X(s)
1 + G(s)
1 + Ks(s+1)
=
K1 + K2 s
s2 + s(1 + K2 ) + K1
(b) (i) K1 = 1, K2 = 1 then H(s) = (s + 1)/(s2 + 2s + 1) = 1/(s + 1), no zero and pole at
X(s) = 1/s then
1
1
1
Y (s) =
=
s(s + 1)
s s+1
and the steady–state is yss (t) = 1 and thus the steady–error is |"(t)| = |1 1| = 0.
(ii) K1 = 0, K2 = 1 then H(s) = s/(s2 + 2s) = 1/(s + 2), no zero and pole at
X(s) = 1/s then
1
0.5
0.5
Y (s) =
=
s(s + 2)
s
s+2
1. For
2. For
and the steady–state is yss (t) = 2 and thus the steady–error is |"(t)| = |1 0.5| = 0.5.
(iii) K1 =p1, K2 = 0 then H(s) = 1/(s2 + s + 1) = 1/((s + 0.5)2 + 0.75), no zero and pole at
0.5 ± j 0.75. For X(s) = 1/s then
Y (s) =
1
1
Bs + C
= +
2
s((s + 0.5) + 0.75)
s ((s + 0.5)2 + 0.75)
and the steady–state is yss (t) = 1 and thus the steady–error is |"(t)| = |1
Copyright 2014, Elsevier, Inc. All rights reserved.
1| = 0.
Chaparro — Signals and Systems using MATLAB
6.15
6.14 The ordinary differential equation for this system is
a0 y(t) + a1 ẏ(t) + ÿ(t) = b0 x(t) + b1 ẋ(t)
The derivative of the given state equations are
(i)
v̇1 (t) = ẏ(t)
(ii)
v̇2 (t) = ÿ(t) + a1 ẏ(t)
b1 ẋ(t)
From the differential equation we have that
ÿ(t) + a1 ẏ(t)
b1 ẋ(t) =
ao y(t) + bo x(t)
and since y(t) = v1 (t) equation (ii) is equivalently written as
(ii) v̇2 (t) =
ao v1 (t) + bo x(t)
Likewise, from the definition of v2 (t) we have that equation (i) can be rewritten using the expression for
v2 (t) as
(i) v̇1 (t) = ẏ(t) = v2 (t) a1 y(t) + b1 x(t) = v2 (t) a1 v1 (t) + b1 x(t)
after replacing y(t) = v1 (t).
The state and the output equations are then



v̇1 (t)
a1 1
v1 (t)
=
v̇2 (t)
a0 0
v2 (t)

⇥
⇤ v1 (t)
y(t) = 1 0
v2 (t)
+

b1
b0
x(t)
The block diagram for the realization is shown in Fig. 14.
b1
x(t)
b0
+
R
v2 (t)
+
v1 (t)
R
y(t)
a1
a0
Figure 6.5: Problem 14
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.15
6.16
(a) The matrix/vectors for the new form are


a1 1
b1
Ao =
, bo =
a0 0
b0
, cTo =
and the transformed vectors and matrix are
(i) cTc = cTo F, (ii) bc = F
1
⇥
1
bo , (iii) Ac = F
0
1
⇤
Ao F
If we let the transformation matrix be
F=

f11
f21
f12
f22
and assume that it is invertible. Then equation (i) gives

⇤ f11
⇥
⇤ ⇥
b 1 b0 = 1 0
| {z } | {z } f21
cT
c
f12
f22
then
cT
o
f11 = b1 , f12 = b0
Equation (ii) givess
Fbc = bo

b1
b0
f21 f22
f21 = b0

1
0
=

b1
b0
then
Finally, equation (iii) gives
FAc = Ao F




b1 b0
a1
a0
a1 1
b1
=
b0 f22
1
0
a0 0
b0
a1 b0 + f22 = a0 b1 ! f22 = a1 b0 a0 b1
Then the matrix is
F=
with the condition that det [F] = a1 b0 b1
(b) Replacing a1 =
1, a0 =

b1
b0
a0 b21
b0
f22
b0
a 1 b0
a 0 b1
b20 6= 0.
2 and b1 = 1 and b0 =

1
F=
2
2 we find that the matrix
2
4
is not invertible because its determinant is zero, so there is no possible transformation in this case.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.17
6.16 For the realization (1) we have the following equations
y1 (t) = v1 (t)
2v2 (t)
v̇1 (t) = x1 (t) + v1 (t) + 2v2 (t)
v̇2 (t) = v1 (t)
which in the Laplace transform are
(i)
Y1 (s) = V1 (s)
(ii)
V1 (s)(s
(iii)
sV2 (s) = V1 (s)
2V2 (s)
1) = 2V2 (s) + X1 (s)
Replacing V2 (s) = V1 (s)/s from equation (iii) in equation (ii) we have that
V1 (s)(s
1
2/s) = X1 (s)
so that V1 (s) = X1 (s)/(s 1 2/s) and and using (iii) 2V2 (s) = 2V1 (s)/s = X1 (s)(2/s)/(s 1 2/s)
so that equation (i) becomes
1 2/s
Y1 (s) =
X1 (s)
s 1 2/s
so that
H1 (s) =
s 2
Y1 (s)
= 2
X1 (s)
s
s 2
For the realization (2) we have the following equations
y2 (t) = w1 (t)
ẇ1 (t) = x2 (t) + y2 (t) + w2 (t)
ẇ2 (t) =
2x2 (t) + 2y2 (t)
or in the Laplace domain
(i)
Y2 (s) = W1 (s)
(ii)
sW1 (s) = X2 (s) + Y2 (s) + W2 (s)
(iii)
sW2 (s) =
2X2 (s) + 2Y2 (s)
Replacing W2 (s) from equation (iii) into equation (ii) we get
W1 (s) = (1/s
2/s2 )X2 (s) + (1/s + 2/s2 )Y2 (s)
which replaced in equation (i) gives
(1
1/s
2/s2 )Y2 (s) = (1/s
2/s2 )X2 (s)
so that the system transfer function is
H2 (s) =
Y2 (s)
s 2
= 2
X2 (s)
s
s 2
Indicating that the two realizations are different realizations of the same system.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.2
6.18
Problems using MATLAB
6.17 (a) The Laplace transform of the error is
E(s)
=
X(s)
=
X(s)

Y (s) = X(s) 1
G(s)
X(s)
=
1 + G(s)
1 + G(s)
s(s + 1)(s + 2)
1 + s(s + 1)(s + 2)
(b) For x(t) = u(t) then
E1 (s) =
(s + 1)(s + 2)
1 + s(s + 1)(s + 2)
According to the final value theorem
e1ss = lim sE1 (s) = lim
s!0
s!0
s(s + 1)(s + 2)
=0
1 + s(s + 1)(s + 2)
(c) If x(t) = r(t), X(s) = 1/s2 , we then have
E2 (s) =
(s + 1)(s + 2)
s(1 + s(s + 1)(s + 2))
and the final value theorem gives
e2ss = lim sE2 (s) = lim
s!0
s!0
(s + 1)(s + 2)
2
= =2
1 + s(s + 1)(s + 2)
1
larger than e1ss as r(t) is harder to follow that u(t).
% Pr 6_17
clear all; clf
% computation e_1(t)
num=[0 1 3 2] % high order to low order
den=[1 3 2 1]% high order to low order
figure(1)
subplot(211)
[r,p]=pfeLaplace(num,den);
t=0:0.001:20;
e1=r(1)*exp(p(1).*t)+r(2)*exp(p(2).*t)+r(3)*exp(p(3).*t);
subplot(212)
plot(t,e1); grid; ylabel(’e_1(t)’); xlabel(’t’)
% computation of e_2(t)
num=[0 0 1 3 2] % high order to low order
den=[1 3 2 1 0]% high order to low order
figure(2)
subplot(211)
[r,p]=pfeLaplace(num,den);
t=0:0.001:20;
e2=r(1)*exp(p(1).*t)+r(2)*exp(p(2).*t)+r(3)*exp(p(3).*t)+r(4)*exp(p(4).*t);
subplot(212)
plot(t,e2);grid; ylabel(’e_1(t)’); xlabel(’t’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.19
1.5
1
1
0.5
0.5
0
0
jΩ
jΩ
1.5
−0.5
−0.5
−1
−1
−1.5
−1.5
−3
−2
−1
0
1
2
3
−3
−2
−1
0
σ
1
3
2
e1(t)
0.6
e1(t)
2
2.5
0.8
0.4
0.2
1.5
1
0.5
0
−0.2
1
σ
0
2
4
6
8
10
t
12
14
16
18
20
0
0
2
4
6
8
10
t
12
14
16
18
20
Figure 6.6: Problem 17: poles/zeros of E1 (s) and e1 (t) (left), poles/zeros of E2 (s) and e2 (t) (right).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.18
(a) Transfer function
H(s) =
6.20
s 1
s 1
1
=
=
s2 + s 2
(s + 2)(s 1)
s+2
the system is BIBO stable because of the cancellation of the pole s = 1 by the zero at the same
place.
(b)
H(s) =
W (s) Y (s)
X(s) W (s)
where
W (s)(s2 + s
Y (s) = (s
d2 w(t) dw(t)
+
dt2
dt
dw(t)
1)W (s) ! y(t) =
w(t)
dt
2) = X(s) !
2w(t) = x(t)
The state variables are v1 (t) = ẇ(t) and v2 (t) = w(t). And so




v̇1 (t)
1 2
v1 (t)
1
=
+
x(t)
v̇2 (t)
1 0
v2 (t)
0
|
{z
}
| {z }
A1
y(t) =
⇥
|
1
{z
cT
1
1
⇤
}

b1
v1 (t)
v2 (t)
(c) Block diagram is shown in Fig. 6.7 (controller form)
+
+
R
R
Figure 6.7: Problem 18: v1 (t) is output of first integrator, and v2 (t) the output of the second integrator.
(d) The matrices coincide with the controller form given by MATLAB.
% Pr 6_18
% State representation
num=[0 1 -1]
den=[1 1 -2]
[A,B,C,D]=tf2ss(num,den)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
num = 0
den = 1
A =
-1
1
B =
1
0
C =
1
D =
0
1
1
-1
-2
2
0
-1
Copyright 2014, Elsevier, Inc. All rights reserved.
6.21
Chaparro — Signals and Systems using MATLAB
6.19
6.22
(a) Using the given state variables we have
v̇1 (t) = ẏ(t) = v2 (t)
v̇2 (t) = ÿ(t) + ẏ(t)
v1 (t) + x(t)
ẋ(t) = 2y(t)
x(t) = 2v1 (t)
x(t)
and y(t) = v1 (t). The state and output equations can be written using the following matrix and
vectors


1 1
1
A2 =
, b2 =
2 0
1
⇥
⇤
T
c2 = 1 0
(b) The controller from before and the new observer realizations are shown in Fig. 6.8
y(t)
+
Controller
1
x(t)
+
R
1
v1 (t) R v2 (t)
2
Observer
x(t)
1
+
2
R v2 (t)
+
R v1 (t)
y(t)
1
Figure 6.8: Problem 19
(c) A2 = AT1 , b2 = cT1 , and cT2 = bT1
(d) Yes, making the changes suggested we transform the diagram in part 1 into the diagram in part
2. The duality is due to the transpose which exchanges the order of the state variables, and by the
exchange of the b and c vectors due to the interchange of the input and the output.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.23
6.20 (a)(b) To find the transfer function let the input v(t) = (t), y(t) = h(t) and initial conditions equal
zero, then in the Laplace domain


⇥
⇤ s
1
s 1
1
1
1 0
H(s) = cTo (sI Ao ) 1 b = 2
= 2
2 s+1
1
s +s 2
s +s 2
The denominator of H(s) is D(s) = s2 + s 2 = (s 1)(s + 2) is the determinant of sI Ao , or
the characteristic equation. Notice the pole-zero cancellation so that the simplified transfer function is
H(s) = 1/(s + 2).
% Pr. 6_20
% Observer
Ao=[-1 1; 2 0]
bo=[1 ;-1]
co=[1 0]’
% Transfer function
[num,den]=ss2tf(Ao,bo,co’,0)
roots(den)
% Diagonalization
[V,D]=eigs(Ao)
A=(inv(V))*Ao*V
b=(inv(V))*bo
c=V’*co
[num,den]= ss2tf(A,b,c’,0)
roots(den)
Ao = -1
1
2
bo =
0
1
-1
co =
1
0
num = 0
den = 1
ans = -2
1.0000
1
-1.0000
-2
1
V =-0.7071
-0.4472
0.7071
-0.8944
D = -2
0
0
1
A = -2.0000
0.0000
0
1.0000
b = -1.4142
0
c = -0.7071
-0.4472
num = 0
1
-1
den = 1
1
-2
ans =-2
1
Showing that the two realizations correspond to the same transfer function.
(c)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.24
%Controller
Ac=Ao’
bc=co’
cc=bo’
[V,D]=eigs(Ao)
A=(inv(V))*Ao*V
b=(inv(V))*bo
c=V’*co
[num,den]= ss2tf(A,b,c’,0)
roots(den)
Ac = -1
2
1
0
bc = 1
0
cc =1
-1
V =-0.7071
-0.4472
0.7071
-0.8944
D =-2
0
0
1
A =-2.0000
0.0000
0
1.0000
b =-1.4142
0
c =-0.7071
-0.4472
num = 0
1
-1
den =1
1
-2
ans =-2
1
Again showing that the two realizations correspond to the same transfer function and that the observer
and the controller forms represent the same system.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
6.25
6.21 The characteristic function corresponding to this realization is

s+2
1
det(sI Ao ) = det
= s2 + 2s + 1 = (s + 1)2
1
s
i.e., we have a double pole at s =
H(s)
=
cTo (sI
1. The transfer function in this case is

⇥
⇤
1
s
1
1
0
Ao ) 1 b =
1 s+2
(s + 1)2
% Pr 6_21
%multiple poles
Ao=[-2 1; -1 0]
bo=[1 ;-1]
co=[1 0]’
[num,den]= ss2tf(Ao,bo,co’,0)
roots(den)
Ao =
-2
-1
1
0
bo =
1
-1
co =
1
0
num = 0
1.0000
den = 1.0000
-1.0000
2.0000
1.0000
ans =
-1.0000 + 0.0000i
-1.0000 - 0.0000i
To obtain the minimal realization let
H(s) =
Y (s) W (s)
= (s
W (s) X(s)
1)
1
(s + 1)2
so that we get
y(t) = ẇ(t)
w(t)
ẅ(t) + 2ẇ(t) + w(t) = x(t)
Copyright 2014, Elsevier, Inc. All rights reserved.

1
1
=
s 1
(s + 1)2
Chaparro — Signals and Systems using MATLAB
6.26
which provide the necessary equations for the minimal realization. A block diagram is shown in Fig. 6.9.
+
+
R
R
Figure 6.9: Problem 21
Copyright 2014, Elsevier, Inc. All rights reserved.
Chapter 7
Fourier Analysis in Communications
and Filtering
7.1
7.1
Basic Problems
(a) By voltage division
H(s) =
Vo (s)
1
1
=
=
Vi (s)
1 + RCs
1 + s/100
(b) If km = 104 and kf = 102 the values of Rn and Cn are unity. The normalized transfer function is
T (S) = 1/(S + 1).
(c) Notice that
H(s)
=
=
1
1
=
1 + (km Rn )(Cn /(km kf ))s
1 + (s/kf )
1
= T (S)
for S = s/kf = s/100
1+S
If s = j⌦ then S = j⌦/100 so that H(j⌦) = T (j⌦/100), so that the frequency response H(j⌦0 )
is exactly the same as that of T (j⌦0 /100), i.e., when the frequency scale is divided by 100.
1
Chaparro — Signals and Systems using MATLAB
7.2
7.2
(a) The dc gain is |H(j0)| = 1.
The poles are s1,2 = e±j3⇡/4 , and no zeros. The magnitude response corresponds to that of a
low-pass filter with dc gain of 1, flat in the low-frequencies and decaying as ⌦ increases.
(b) Magnitude squared response
|H(j⌦)|2
=
1
(1
⌦2 ) 2
+ 2⌦2
has maximum when the denominator has a minimum that satisfies
d[(1
⌦2 )2 + 2⌦2 ]
=0 )
d⌦
4(1
⌦2 )⌦ + 4⌦ = 0, or ⌦3 = 0
i.e., the maximum magnitude response occurs at ⌦ = 0.
(c) Yes, from the magnitude square function we have
|H(j1)|2
(1/2)
=
= 1/2
|H(j0)|2
1
i.e., ⌦ = 1 is the half–power frequency.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.3
7.3
(a) Magnitude response
|H(j⌦)| =
j⌦/Q
=p
⌦2 + j⌦/Q + 1
(1
⌦
0
1
1
It is a band-pass filter.
|⌦/Q|
⌦2 )2 + (⌦/Q)2
|H(j⌦)|
0
1
0
(b) The given transfer function can be written
H(s) =
s2
BW s
+ BW s + 1
The half-power frequencies are frequencies that make
|H(j⌦i )|
|H(j⌦i )|
1
=
= p , i = 1, 2
|H(j1)|
1
2
then for ⌦1 and replacing 1 = ⌦2 ⌦1 , BW = 1/Q in the denominator,
|H(j⌦1 )|2
=
=
=
=
BW 2 ⌦21
(⌦2 ⌦1 ⌦21 )2 + BW 2 ⌦21
BW 2 ⌦21
2
⌦1 (⌦2 ⌦1 )2 + BW 2 ⌦21
BW 2
(⌦2 ⌦1 )2 + BW 2
BW 2
1
=
2BW 2
2
and similarly for ⌦2 .
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.4
7.4
(a) |H(j0)| = K|z1 |/|p1 | = 1, so K = |p1 |/|z1 |
(b) Low-pass, high-pass and all-pass can be obtained with this first-order system. Band-pass and stopband require second or higher-order systems, as poles must be complex conjugates.
(c) For the low-pass filter, |H1 (j0)| = 1, the half-power frequency ⌦hp is such that
|H1 (j⌦hp )|2 = |H1 (j0)|2 /2 = 1/2
1
1
=
2
⌦hp + 1
2
so ⌦hp = 1.
(d) The filter with H2 (s) = (s 1)/(s + 1) is an all-pass filter. Its pole is s =
Given this symmetry the magnitude response is unity for all values of ⌦.
1 and zero s = 1.
(e) The filter with H3 (s) = s/(s + 1) is a high-pass filter, |H(j0)| = 0 and when ⌦ ! 1 the
magnitude response grows and becomes 1 at 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.5
7.5
(a) The magnitude square of the filter is
|H(j⌦)|2 =
(1
|
1
⌦ ) + ⌦2 /Q2
{z
}
2 2
D(⌦)
To maximize it, we equivalently minimize D(⌦) so
dD(⌦)
= 2(1
d⌦

⌦2 )( 2⌦) + 2⌦/Q2 = 2⌦ 2(⌦2
1) +
1
=0
Q2
which gives as possible frequencies that minimize D(⌦)
⌦=0
⌦1,2 = ±
p
1
1/(2Q2 )
where the second possibility is limited to real frequencies so that 1
considered) or
1
Q > p = 0.707
2
1/(2Q2 ) > 0 (zero is already
So the maximum magnitude response occurs at frequencies
0p
1
1/(2Q2 )
when Q  0.707
when Q > 0.707
p
(b) When Q = 1/ 2 = 0.707 the magnitude-squared at ⌦ = 1 is
|H(j)|2 =
1
1
=
1/Q2
2
so that ⌦ = 1 is the half-power frequency since |H(j0)| = 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.6
7.6
(a) Transfer function
H(s) =
Y (s)
1
= 2
X(s)
s + 2s + 1
Since H(s) has no zeros, the filter is a low-pass filter.
(b) If x(t) = 2u(t) then
Y (s) = H(s)
2
2
A
B
C
=
= +
+
2
s
s(s + 1)
s
s + 1 (s + 1)2
where
A=2
so that
y(t) = 2u(t)
C=
2
B=
2
2e t (1 + t)u(t)
in the steady state, yss (t) = 2.
(c) If x1 (t) = 2[u(t)
y1 (t)
=
=
=
1)] then the filter output is
u(t
y(t)
y(t
1)
t
2u(t)
2e (1 + t)u(t)
2[u(t)
u(t
1)]
2u(t
1)
t
2e [(1 + t)u(t)
2e
(t 1)
(1 + t
e tu(t
1)u(t
1)
1)]
(d) The difference between the outputs and the inputs of the filter in the above cases is
y(t)
y1 (t)
x(t) =
x1 (t) =
2e t (1 + t)u(t)
2e t [(1 + t)u(t)
etu(t
1)]
both of which tend to zero as t ! 1 and indicating that the responses eventually follow the input
exactly.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.7
7.7 (a) ⌦c = 40⇡ ⇥ 103 rad/sec.
(b) Figure 7.1(a) shows the conventional AM receiver. The filters are LTI but the demodulator is LTV. If
the ideal bandpass filter has a magnitude ↵, a center frequency ⌦c and a bandwidth coinciding with that
of the message, its output is
p(t) = ↵m(t) cos(⌦c t)
and in frequency the output of the demodulator is
S(⌦) = 0.5 [P (⌦ + ⌦c ) + P (⌦
⌦c )]
↵
[M (⌦ + ⌦c ) + M (⌦
2
⌦c )]
Replacing
P (⌦) =
we get
↵
[2M (⌦) + M (⌦ + 2⌦c ) + M (⌦ 2⌦c )]
4
When passing s(t) through an ideal lowpass filter with unit gain and bandwidth 2⇡BW (rad/sec) we get
as output (↵/2)m(t) so that if ↵ = 2 the output of the LP filter is m(t).
(c) When we interchange the demodulator and the BP filter, we have the BP and the LP in cascade which
being ideal do not overlap and so result in that the output y(t) is always zero independent of x(t) and
m(t).
S(⌦) =
cos(40⇥
r(t)
p(t)
BP
cos(40⇥
103 t)
s(t)
m(t)
(a)
LP
103 t)
r(t)
x(t)
y(t)
BP
LP
(b)
4
1
5
LP
15
20
25
f (KHz)
BP
Figure 7.1: Problem 7: possible AM receivers; BP, LP bandpass and lowpass ideal filters.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.8
7.8 (a) Using voltage division
Vc (s)
1/sC
1
=
=
Vi (s)
1 + Ls + 1/Cs
LCs2 + Cs + 1
which compared with the transfer function of the Butterworth filter gives
LC = 1
p
C= 2
p
p
so that C = 2 and L = 1/ 2.
(b) Again by voltage division
p
VR (s)
1
Cs
2s
p
=
=
=
2
2
Vi (s)
1 + Ls + 1/Cs
LCs + Cs + 1
s + 2s + 1
This is a bandpass filter as it has s = 0 as a zero, so that for ⌦ = 0 this filter has zero magnitude, and as
frequency becomes infinity the frequency response is also zero.
(c) The transfer function would be
VLC (s)
Ls + 1/Cs
LCs2 + 1
s2 + 1
p
=
=
=
Vi (s)
1 + Ls + 1/Cs
LCs2 + Cs + 1
s2 + 2s + 1
which corresponds to a notch filter with a notch at ⌦ = 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.9
7.9 Using the loss function
↵(⌦) = 10 log10

⌦
1+
⌦hp
2N
!
) ⌦hp =
⌦
(100.1↵(⌦)
which gives for ⌦ = 2000
⌦hp =
2000
= 1280.9 rad/sec.
(101.94 1)0.1
When ↵(⌦p ) = ↵max we have
⌦p = ⌦hp (100.1↵max
1)1/2N
which gives after replacing the values on the right term ⌦p = 999.82 (rad/sec).
Copyright 2014, Elsevier, Inc. All rights reserved.
1)1/2N
Chaparro — Signals and Systems using MATLAB
7.2
7.10
Problems using MATLAB
7.10 (a) The difference between the two arguments of the cosines is

L1 L0
⇡
2⇡(f0 ⌫)
=
c
2
which gives
L1 = L0 +
c
4(f0
⌫)
= (10 + 38.5) ⇥ 103 = 48.5 ⇥ 103 meters
(b) The received signal can be written
r(t) = 1.9 cos(2⇡ ⇥ 1950t
2⇡ ⇥ 0.065)
with period T1 = 1/1950 = 5.13 ⇥ 10 4 . The input signal is periodic of period T0 = 1/f0 = 1/2000 =
5 ⇥ 10 4 . The output of the channel has a different frequency than the input and as such it is not LTI.
(c) The following script computes and plots x(t) and r(t) sampled at the given rate Fs .
% Pr. 7_10
clear all; clf
Fs=10000; Ts=1/Fs;
t=0:Ts:(1999)*Ts;
f0=2000;nu=50;L0=10000;L1=48500;c=3*10ˆ8;
x=cos(2*pi*f0*t);
r=cos(2*pi*(f0-nu).*(t-L0/c))+0.9*cos(2*pi*(f0-nu).*(t-L1/c))
figure(1)
subplot(211)
plot(t(1:100),x(1:100));ylabel(’x(t)’);xlabel(’t’)
subplot(212)
plot(t(1:100),r(1:100));ylabel(’r(t)’);xlabel(’t’)
Input and output signals are shown in the left of Fig. 10. (d) The following script shows how to do the multipath
using parameters that change at random.
clear all;
Fs=10000; Ts=1/Fs;
t=0:Ts:(99)*Ts;
f0=2000;nu=50;L0=1000;L1=10000;c=3*10ˆ8;
figure(2)
for k=1:10,
eta=rand(1,1);
nuk=nu*eta;L0k=L0*eta;L1k=L1*eta;
alpha0=1-eta;alpha1=alpha0/10;
r=alpha0*cos(2*pi*(f0-nuk).*(t-L0k/c))+alpha1*cos(2*pi*(f0-nuk).*(t-L1k/c))
plot(t,r)
pause(0.1)
hold on
end
hold off
ylabel(’r(t)’);xlabel(’t’)
Copyright 2014, Elsevier, Inc. All rights reserved.
7.11
1
1
0.5
0.8
0
0.6
−0.5
0.4
−1
0.2
0
0.001
0.002
0.003
0.004
0.005
t
0.006
0.007
0.008
0.009
0.01
r(t)
x(t)
Chaparro — Signals and Systems using MATLAB
1.5
0
−0.2
1
−0.4
r(t)
0.5
0
−0.6
−0.5
−0.8
−1
−1.5
0
0.001
0.002
0.003
0.004
0.005
t
0.006
0.007
0.008
0.009
0.01
−1
0
0.001
0.002
0.003
0.004
0.005
t
0.006
0.007
0.008
0.009
0.01
Figure 7.2: Problem 10: input and received signals (left); received signals affected by random parameters of
multipath (right).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.12
7.11 The following script is used in finding the answers in this problem.
% Pr 7_11
clear all; clf
alphamax=0.5 ;alphamin=30; Wp=1500; Ws=3500;
% Butterworth
D=(10ˆ(0.1*alphamin)-1)/(10ˆ(0.1*alphamax)-1);
E=Ws/Wp;
N=ceil(log10(D)/(2*log10(E)))
%Whp=Wp/(10ˆ(0.1*alphamax)-1)ˆ(1/(2*N))
Whp=Ws/(10ˆ(0.1*alphamin)-1)ˆ(1/(2*N))
alpha_p=10*log10(1+(Wp/Whp)ˆ(2*N))
alpha_s=10*log10(1+(Ws/Whp)ˆ(2*N))
% Chebyshev
N=ceil(acosh(Dˆ(0.5))/acosh(E))
eps=sqrt(10ˆ(0.1*alphamax)-1)
Whp1=Wp*cosh(acosh(1/eps)/N)
alpha_p= 10*log10(1+(epsˆ2)*(cos(N*acos(1)))ˆ2)
alpha_s=10*log10(1+(epsˆ2)*cosh(N*acosh(Ws/Wp))ˆ2)
%% Check with MATLAB
[N1,Whp1]=buttord(Wp,Ws,alphamax,alphamin,’s’)
[N2,Wn]=cheb1ord(Wp,Ws,alphamax,alphamin,’s’)
The orders and the half-power frequency (Butterworth) and the passband frequency (Chebyshev) are
verified using MATLAB functions buttord and cheb1ord.
(a) The lowpass Butterworth filter that satisfies the specifications is of minimum order Nb = 6, while
the corresponding Chebyshev filter has minimum order Nc = 4. Typically for the same specifications
N c < Nb
(b) The half-power frequency of the designed Butterworth filter is ⌦hp = 1787.4 (calculated so that the
loss ↵(⌦p ) = ↵max ). Another possible value for which ↵(⌦s ) = ↵min is ⌦hp = 1968.4.
To compute the half-power frequency of the Chebyshev filter we need the ripple factor ✏ which we find
to be 0.3493. We obtain ⌦hp = 1639.7.
(c) For the designed Butterworth filter with the first value of ⌦hp we get
↵(⌦p ) = 0.5 dB
↵(⌦s ) = 35.023 dB
and for the second half-power frequency
↵(⌦p ) = 0.1635 dB
↵(⌦s ) = 30 dB
The values of the loss function for the Chebyshev filter are
↵(⌦p ) = 0.5 dB
↵(⌦s ) = 36.65 dB
These values do not depend on the half–power frequency but rather on ⌦p which is the normalized
frequency.
(d) The formulas for the order of the Butterworth and the Chebyshev filters depend on the ratio of ⌦p
and ⌦s , so the orders of the filters do not change.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.13
7.12 Since the dc loss is not zero, the normalized loss specifications are
↵max = ↵1
↵(0) = 0.5
↵min = ↵2
↵(0) = 30
with a dc loss of 20 dB. The following script is used to find the answers
% Pr 7_12
clear all; clf
alphamax=0.5 ;alphamin=30; Wp=1500; Ws=3500;
alpha0=20;
% Butterworth
K=10ˆ(alpha0/20)
D=(10ˆ(0.1*alphamin)-1)/(10ˆ(0.1*alphamax)-1);
E=Ws/Wp;
N=ceil(log10(D)/(2*log10(E)))
Whp=Wp/(10ˆ(0.1*alphamax)-1)ˆ(1/(2*N))
alpha_p=10*log10(1+(Wp/Whp)ˆ(2*N))
alpha_s=10*log10(1+(Ws/Whp)ˆ(2*N))
% Chebyshev
N=ceil(acosh(Dˆ(0.5))/acosh(E))
eps=sqrt(10ˆ(0.1*alphamax)-1)
Whp1=Wp*cosh(acosh(1/eps)/N)
alpha_p= 10*log10(1+(epsˆ2)*(cos(N*acos(1)))ˆ2)
alpha_s=10*log10(1+(epsˆ2)*cosh(N*acosh(Ws/Wp))ˆ2)
alpha1=alpha0+10*log10(1+(epsˆ2)*cosh(N*acosh(0))ˆ2);
Kc=10ˆ(alpha1/20)
The following are the results
% Butterworth
K = 10 % dc gain
N =6 % minimum order
Whp =1.7874e+03 % half-power frequency
alpha_p = 0.5000 % loss at Wp
alpha_s =35.0228 % loss at Ws
% Chebyshev
N = 4 % min order
eps = 0.3493 % ripple factor
Whp1 = 1.6397e+03 % half-power frq
alpha_p = 0.5000 % loss at Wp
alpha_s = 36.6472 % loss at Ws
Kc =10.5925 % dc gain
Notice the computation of the dc gain in the Chebyshev filter. In this case the dc loss depends on the
order of the filter and so it is not necessarily 0 dB, so to get the dc gain Kc we use

K2
2
↵(0) = 10 log10
10 log10 (1 + ✏2 CN
(0))
2 (0) = 20 log10 K
1 + ✏2 CN
as indicated in the script.
(d) The minimum orders of the filters depend on the ratio of the two frequencies and since it remains the
same these do not change.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.14
7.13 (a)–(c) The following script is used to design the three filters. To get the Butterworth or the Chebyshev
filters get rid of the comments symbols in front of the corresponding functions.
% Pr 7_13
clear all; clf
alphamax=0.5; alphamin=20; Wp=1000;Ws=2000;
W=0:2500;
% Butterworth
[Nb,Whp]=buttord(Wp,Ws,alphamax,alphamin,’s’)
[b,a]=butter(Nb,Whp,’s’);
% Chebyshev 1
%[Nc,Wn]=cheb1ord(Wp,Ws,alphamax,alphamin,’s’)
%[b,a]=cheby1(Nc,alphamax,Wn,’s’)
% Elliptic
%[Ne,Wn]=ellipord(Wp,Ws,alphamax,alphamin,’s’)
%[b,a]=ellip(Ne,alphamax,alphamin,Wn,’s’)
H=freqs(b,a,W);
alpha=-20*log10(abs(H));
M=length(H);
alpha1=alphamax*ones(1,M);
alpha2=alphamin*ones(1,M);
Ang=unwrap(angle(H));
figure(1)
subplot(221)
plot(W,abs(H));grid;axis([0 2500 0 1.1]);ylabel(’|H|’);xlabel(’\Omega’)
subplot(222)
plot(W,Ang);axis([0 2500 1.1*min(Ang) 1.1*max(Ang)]);grid
ylabel(’<H’);xlabel(’\Omega’)
subplot(223)
splane(b,a)
subplot(224)
plot(W,alpha); axis([0 2500 1.1*min(alpha) 1.1*max(alpha)])
ylabel(’\alpha(\Omega)’);xlabel(’\Omega’)
hold on
plot(W,alpha1,’r’)
hold on
plot(W,alpha2,’r’)
hold off
grid
The order of the three filters decreases from the Butterworth to the Chebyshev to the elliptic. The magnitude frequency responses are equally good and the phase responses are approximately linear in the
passband.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.15
0
−1
0.8
−2
−3
0.6
−3
−5
−6
500 1000 1500 2000 2500
Ω
0
500 1000 1500 2000 2500
Ω
α(Ω)
0
500 1000 1500 2000 2500
Ω
0
−500
−1000
−500
σ
0
0
0
−1000
−400 −300 −200 −100
σ
500 1000 1500 2000 2500
Ω
0
500 1000 1500 2000 2500
Ω
20
10
5
−1000
500 1000 1500 2000 2500
Ω
30
20
15
0
40
500
10
−500
−6
0
1000
25
500
−5
0
30
1000
−4
0.2
jΩ
0
0.4
α(Ω)
0.2
0
−4
<H
−2
0.6
|H|
0.8
0.4
0
0
0.8
−1
0.6
−2
<H
|H|
1
0.4
−3
0.2
0
−4
0
500
1000 1500 2000
Ω
2500
0
500
1000 1500 2000
Ω
2500
0
500
1000 1500 2000
Ω
2500
1500
1000
80
500
60
α(Ω)
jΩ
jΩ
0
1
−1
<H
|H|
1
0
40
−500
20
−1000
−1500
−600
−400
σ
−200
0
0
Figure 7.3: Problem 13: frequency response, poles/zeros and loss functions of Butterworth, Chebyshev (top)
and elliptic (bottom) filters.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.16
7.14 (a) The Chebyshev low-pass filter is designed using the following script:
%% Pr 7_14
clear all; clf
alphamax=0.1; alphamin=60; Wp=1000;Ws=2000;
W=0:2500;
% Chebyshev 1
[Nc,Wn]=cheb1ord(Wp,Ws,alphamax,alphamin,’s’)
[b,a]=cheby1(Nc,alphamax,Wn,’s’)
H=freqs(b,a,W);
alpha=-20*log10(abs(H));
M=length(H);
alpha1=alphamax*ones(1,M);
alpha2=alphamin*ones(1,M);
alpha3=3*ones(1,M);
Ang=unwrap(angle(H));
figure(1)
subplot(221)
plot(W,abs(H));grid;axis([0 2500 0 1.1]); ylabel(’|H|’);xlabel(’\Omega’)
subplot(222)
plot(W,Ang);axis([0 2500 1.1*min(Ang) 1.1*max(Ang)])
ylabel(’<H’);xlabel(’\Omega’)
subplot(223)
splane(b,a)
subplot(224)
plot(W,alpha); axis([0 2500 1.1*min(alpha) max(alpha)])
ylabel(’\alpha(\Omega)’);xlabel(’\Omega’)
hold on
plot(W,alpha1,’r’)
hold on
plot(W,alpha2,’r’)
hold on
plot(W,alpha3,’g’)
hold off
grid
eps=sqrt(10ˆ(0.1*alphamax)-1)
Whp1=Wp*cosh(acosh(1/eps)/Nc)
(b) The half-power frequency is computed by finding first the ripple factor as shown in the following
script that follows the above script (i.e., it uses the necessary values computed before).
eps=sqrt(10ˆ(0.1*alphamax)-1)
Whp1=Wp*cosh(acosh(1/eps)/Nc)
The value obtained is ⌦hp = 1051.9 (rad/sec). In the above script an additional line, corresponding to
the 3 db, is used to determine approximately this value.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.17
0
−2
0.8
−4
0.6
−6
<H
|H|
1
−8
0.4
−10
0.2
−12
0
0
500
1000 1500 2000
Ω
2500
1000
1000 1500 2000
Ω
2500
0
500
1000 1500 2000
Ω
2500
60
α(Ω)
jΩ
500
80
500
0
−500
−1000
−300
0
40
20
−200
−100
σ
0
Figure 7.4: Problem 14: Chebyshev low-pass: frequency response, poles/zeros, and loss.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.18
7.15 The following script is used to compute the different signals, filters, and to plot them.
% Pr 7_15
clear all; clf
syms t w
x=cos(100*pi*t)-2*cos(50*pi*t);
y=x+cos(120*pi*t);
figure(1)
subplot(211)
ezplot(x,[0:1]) % desired signal
subplot(212)
ezplot(y,[0:1]) % signal with hum
X=fourier(x);
% butterworth filter
N=5;
%wn=[2*pi*59.9 2*pi*60.1]; [b,a]=butter(N,wn,’stop’,’s’);C=1 % band-eliminating
% [b,a]=butter(2*N,110*pi,’high’,’s’);C=2 % high-pass
[b,a]=butter(N,[20*pi 90*pi],’s’);C=2 % band-pass
% frequency responses
W=0:1:150*pi;
Hm=abs(freqs(b,a,W));
figure(2)
subplot(211)
plot(W/(2*pi),Hm); axis([0 75 0 1.1]);xlabel(’f (Hz)’); ylabel(’|H|’)
M=2*N
% generation of frequency response from coefficients
n=M:-1:0;
U=(j*w).ˆn;
num=b*conj(U’); den=a*conj(U’);
H=num/den; % Butterworth LPF
% output of filter
Y1=X*H;
y1=real(ifourier(Y1,t));
subplot(212)
if C==1,
ezplot(y1,[0:1])
else
ezplot(x-y1,[0:1])
end
title(’denoised signal’)
The most natural of the three approaches is the one using the stopband filter, the other depend on information on the desired signal that might or might not be available. The only needed information for the
stopband filter is the frequency of the hum.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.19
cos(100 π t)−2 cos(50 π t)
3
2
1
0
−1
0
0.1
0.2
0.3
0.4
0.5
t
0.6
0.7
0.8
0.9
1
0.8
0.9
1
cos(100 π t)−2 cos(50 π t)+cos(120 π t)
4
3
2
1
0
−1
−2
0.1
0.2
0.3
0.4
0.5
t
0.6
0.7
1
1
0.8
0.8
0.6
0.6
0.6
0.4
0.4
0.2
0.2
0
0
10
20
30
40
f (Hz)
50
60
0
70
|H|
1
0.8
|H|
|H|
0
0.4
0.2
0
10
20
denoised signal
40
f (Hz)
50
60
0
70
0
10
20
denoised signal
3
2
1
1
0
0
40
f (Hz)
50
60
70
1
0
−1
−1
−1
30
denoised signal
3
2
−2
30
−2
−2
0
0.1
0.2
0.3
0.4
0.5
t
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
t
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
t
0.6
0.7
0.8
0.9
1
Figure 7.5: Problem 15: top: original and original with hum signals; bottom left to right: notch filter and
filtered signal, high-pass filter and denoised signal, an bandpass filter and denoised signal.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.20
7.16 % Pr 7_16
clear all; clf
%% signal generation
Ts=5/512;t1=0:Ts:1-Ts;t2=1:Ts:2-Ts;t3=2:Ts:5;M=length(t3);t=[t1 t2 t3];
x1=[t1 2-t2 zeros(1,512-length(t1)-length(t2))];
x2=[ones(1,200) zeros(1,512-200)];
[X1,W]=AFT(x1,Ts);
[X2,W]=AFT(x2,Ts);
%% low-pass filtering to get m1 and m2
N=10;whp=10;
[b,a]=butter(N,whp,’s’); % low-pass filter
H=freqs(b,a,W);
Z1=H.*X1;
[m1,t]=AIFT(Z1,Ts);
Z2=H.*X2;
[m2,t]=AIFT(Z2,Ts);
figure(1)
subplot(221)
plot(t,x1); title(’triangular pulse x_1(t)’);axis([0 5 -0.1 1.2]);grid
subplot(222)
plot(W,abs(X1));axis([-40 40 -0.1 1.5]); title(’spectrum |X_1|’);grid
hold on
plot(W,abs(H),’r’)
hold off
subplot(223)
plot(t,x2); title(’rectangular pulse x_2(t)’);axis([0 5 -0.1 1.2]);grid
subplot(224)
plot(W,abs(X2));axis([-40 40 -0.1 2.5]); title(’spectrum |X_2|’);grid
hold on
plot(W,abs(H),’r’)
hold off
figure(2)
subplot(221)
plot(t,m1); title(’message m_1(t)’);axis([0 5 -0.1 1.2]);grid
subplot(222)
plot(t,m2); title(’message m_2(t)’);axis([0 5 -0.5 1.2]);grid
subplot(223)
plot(W,abs(Z1));axis([-20 20 -0.1 1.5]);title(’|M_1|’); grid
subplot(224)
plot(W,abs(Z2));axis([-20 20 -0.1 2.5]);title(’|M_1|’); grid
%% received signal
m11=m1.*cos(20*t);
m22=m2.*cos(100*t);
u=m11+m22;
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.21
[U,W]=AFT(u,Ts);
%% bandpass filtering
Wn=[15,25];
[bb,aa]=butter(N,Wn,’s’) % bandpass filter
Hp=freqs(bb,aa,W);
M=Hp.*U;
[mhat,t]=AIFT(M,Ts);
figure(3)
subplot(221)
plot(W,abs(U));axis([-120 120 -0.1 1.5]);title(’Spectrum |U| of received signal and
hold on
plot(W,abs(Hp),’r’)
hold off
subplot(222)
plot(t,mhat); title(’output of BPF’);axis([0 5 -1.1 1.1]);grid
%% demodularion and LPF
y=mhat.*cos(20*t);
[Y1,W]=AFT(y,Ts);
subplot(223)
plot(W,abs(Y1));axis([-60 60 -0.1 1.2]); grid; title(’LPF of demodulated signal’)
hold on
plot(W,abs(H),’r’)
hold off
M=H.*Y1;
[m,t]=AIFT(M,Ts);
subplot(224)
plot(t,3*m);axis([0 5 -0.5 1.5]);grid; title(’ recovered m_1(t)’); % scaled by 3
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.22
spectrum |X1|
triangular pulse x1(t)
message m1(t)
message m2(t)
1.5
1
1
1
0.8
0.8
1
0.6
0.5
0.6
0.4
0.4
0.5
0
0.2
0.2
0
0
0
0
1
2
3
4
5
rectangular pulse x2(t)
−40
−20
20
40
0
spectrum |X2|
2.5
1
0
1
2
3
4
5
|M1|
1.5
0.4
1
0.2
0.5
0
0
1
2
3
4
5
1
2
3
4
5
|M1|
2
1
1.5
0.6
0
2.5
2
0.8
−0.5
1.5
1
0.5
0.5
0
−40
0
−20
0
20
40
−20
Spectrum |U| of received signal and BPF
1.5
−10
0
10
output of BPF
1
0.5
1
0
0.5
−0.5
0
−1
−100
−50
0
50
100
LPF of demodulated signal
0
1
2
3
4
5
4
5
recovered m1(t)
1.5
1
1
0.8
0.6
0.5
0.4
0
0.2
0
−60 −40 −20
0
20
40
60
−0.5
0
1
2
3
Figure 7.6: Problem 16: demodulation of AM signals.
Copyright 2014, Elsevier, Inc. All rights reserved.
20
0
−20
−10
0
10
20
Chaparro — Signals and Systems using MATLAB
7.17 (a)
% Pr 7_17
clear all; clf
%% signal generation
Ts=5/512;t1=0:Ts:1-Ts;t2=1:Ts:2-Ts;t3=2:Ts:5;M=length(t3);t=[t1 t2 t3];
x1=[t1 2-t2 zeros(1,512-length(t1)-length(t2))];
x2=[ones(1,200) zeros(1,512-200)];
[X1,W]=AFT(x1,Ts);
[X2,W]=AFT(x2,Ts);
%% low-pass filtering to get m1 and m2
N=10;whp=10;
[b,a]=butter(N,whp,’s’); % low-pass filter
H=freqs(b,a,W);
Z1=H.*X1;
[m1,t]=AIFT(Z1,Ts);
Z2=H.*X2;
[m2,t]=AIFT(Z2,Ts);
figure(1)
subplot(221)
plot(t,x1); title(’triangular pulse x_1(t)’);axis([0 5 -0.1 1.2]);grid
subplot(222)
plot(W,abs(X1));axis([-40 40 -0.1 1.5]); title(’spectrum |X_1|’);grid
hold on
plot(W,abs(H),’r’)
hold off
subplot(223)
plot(t,x2); title(’rectangular pulse x_2(t)’);axis([0 5 -0.1 1.2]);grid
subplot(224)
plot(W,abs(X2));axis([-40 40 -0.1 2.5]); title(’spectrum |X_2|’);grid
hold on
plot(W,abs(H),’r’)
hold off
figure(2)
subplot(221)
plot(t,m1); title(’message m_1(t)’);axis([0 5 -0.1 1.2]);grid
subplot(222)
plot(t,m2); title(’message m_2(t)’);axis([0 5 -0.5 1.2]);grid
subplot(223)
plot(W,abs(Z1));axis([-20 20 -0.1 1.5]);title(’|M_1|’); grid
subplot(224)
plot(W,abs(Z2));axis([-20 20 -0.1 2.5]);title(’|M_1|’); grid
%% received signal
m11=m1.*cos(50*t);
m22=m2.*sin(50*t);
s=m11+m22;
[S,W]=AFT(s,Ts);
figure(3)
Copyright 2014, Elsevier, Inc. All rights reserved.
7.23
Chaparro — Signals and Systems using MATLAB
7.24
subplot(221)
plot(W,abs(S));axis([-120 120 -0.1 1.5]);title(’Spectrum |S| of received signal’); grid
%% demodularion and LPF
y1=s.*cos(50*t);
y2=s.*sin(50*t);
[Y1,W]=AFT(y1,Ts);
[Y2,W]=AFT(y2,Ts);
subplot(222)
plot(W,abs(Y1));axis([-60 60 -0.1 1.2]); grid; title(’LPF of cos demodulated signal’)
hold on
plot(W,abs(H),’r’)
hold off
subplot(223)
plot(W,abs(Y2));axis([-60 60 -0.1 1.2]); grid; title(’LPF of sin demodulated signal’)
hold on
plot(W,abs(H),’r’)
hold off
M1=H.*Y1;
M2=H.*Y2;
[m1,t]=AIFT(M1,Ts);
[m2,t]=AIFT(M2,Ts);
subplot(224)
plot(t,m1);axis([0 5 -0.1 1]);grid; title(’ recovered m_1(t)’); hold on
plot(t,m2,’r’);axis([0 5 -0.1 1]);grid; title(’ recovered m_2(t)’); hold off
legend(’m_1(t)’,’m_2(t)’); grid
The following two functions are used too compute the direct and inverse Fourier transforms.
function [X,W] = AFT(x,Ts)
% Analog Fourier transform
% implemented using FFT
N=length(x);
X=fft(x)*Ts; W=[0:N-1]*2*pi/N-pi;W=W/Ts;
X=fftshift(X);
function [x,t] = AIFT(X,Ts)
% Analog Fourier transform
% implemented using FFT
N=length(X);
X=fftshift(X);
x=real(ifft(X))/Ts;t=[0:N-1]*Ts;
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
7.25
spectrum |X1|
triangular pulse x1(t)
message m1(t)
message m2(t)
1.5
1
1
1
0.8
0.8
1
0.6
0.5
0.6
0.4
0.4
0.5
0
0.2
0.2
0
0
0
0
1
2
3
4
5
rectangular pulse x2(t)
−40
−20
20
40
0
spectrum |X2|
2.5
1
0
1
2
3
4
5
|M1|
1.5
0.4
1
0.2
0.5
0
0
1
2
3
4
5
1
2
3
4
5
|M1|
2
1
1.5
0.6
0
2.5
2
0.8
−0.5
1.5
1
0.5
0.5
0
−40
0
−20
1.5
0
20
40
−20
Spectrum |S| of received signal
−10
0
10
20
LPF of cos demodulated signal
1
0.8
1
0.6
0.4
0.5
0.2
0
0
−100
−50
0
50
100
LPF of sin demodulated signal
1
0
20
60
m1(t)
0.8
m2(t)
0.6
0.6
40
recovered m2(t)
1
0.8
0.4
0.4
0.2
0.2
0
0
−60 −40 −20
−60 −40 −20
0
20
40
60
0
1
2
3
4
5
Figure 7.7: Problem 17: demodulation of QAM signals.
Copyright 2014, Elsevier, Inc. All rights reserved.
0
−20
−10
0
10
20
Chaparro — Signals and Systems using MATLAB
Copyright 2014, Elsevier, Inc. All rights reserved.
7.26
Chapter 8
Sampling Theory
8.1
Basic Problems
8.1 (a) The maximum frequency in a speech signal is fmax = 5 kHz, so that its sampling frequency should
be
fs 2fmax = 10kHz or 10, 000 samples/sec
The number of samples in an hour of sampling speech is
Samples/hour
3, 600 sec/hour ⇥ 10, 000 samples/sec = 3.6 ⇥ 107 samples/hour
and the number of bits is
Bits/hour
3.6 ⇥ 107 samples/hour ⇥ 8 bits/sample = 288 ⇥ 106 bits/hour
(b) Since fmax = 22 kHz can be considered the maximum frequency in a music signal, then the sampling
frequency should be
fs 2fmax = 44 kHz
(c) We need to use the higher of the above sampling frequencies to accommodate both signals, so fs 44
kHz. If fs does not satisfy the Nyquist condition it would cause aliasing, and the signal will sound
distorted.
1
Chaparro — Signals and Systems using MATLAB
8.2
8.2 (a) To find X(⌦), we use duality or find the inverse Fourier transform of a pulse of amplitude A and
bandwidth ⌦0 , that is
X(⌦) = A[u(⌦ + ⌦0 ) u(⌦ ⌦0 )]
so that
x(t)
=
=
Z ⌦0
1
A j⌦t
Aej⌦t d⌦ =
e
2⇡
2⇡jt
⌦0
A
sin(⌦0 t)
⇡t
⌦0
⌦0
which when compared with the given x(t) = sin(t)/t gives that A = ⇡ and ⌦0 = 1 or
X(⌦) = ⇡[u(⌦ + 1)
u(⌦
1)]
indicating that x(t) is band-limited with a maximum frequency ⌦max = 1 (rad/sec).
(b) To sample without aliasing the sampling frequency should be chosen to be
fs =
which gives a sampling period
Ts 
1
Ts
2
⌦max
2⇡
⇡
= ⇡ sec/sample
⌦max
(c) The spectrum of y(t) = x2 (t) is the convolution in the frequency
Y (⌦) =
1
(X(⌦) ⇤ X(⌦))
2⇡
which would have a maximum frequency ⌦max = 2, giving a sampling frequency which is double the
one for x(t). The sampling period for y(t) should be
Ts 
⇡
.
2
(d) The signal x(t) = sin(t)/t is zero whenever t = ±k⇡, for k = 1, 2, · · · so that choosing Ts = ⇡ (the
Nyquist sampling period) we obtain the desired signal xs (0) = 1 and x(nTs ) = 0.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.3
8.3 (a) The Fourier transform is
X(⌦) = 2⇡[u(⌦ + 0.5)
u(⌦
0.5)]
x(t) is clearly band-limited with ⌦max = 0.5 (rad/sec).
(b) According to the Nyquist sampling rate condition, we should have that
⌦s =
or the sampling period
Ts 
2⇡
Ts
⇡
⌦max
2⌦max
= 2⇡
The given value satisfies the Nyquist sampling rate condition so we can sample the signal with no aliasing. The given sampling period is the Nyquist sampling period.
Plotting the sinc function it can be seen that it is zero at values of 0.5t = ±⇡k or t = ±2⇡k for an integer
k. The sampled signal using Ts = 2⇡ is
x(nTs ) =
sin(0.5 2⇡n)
sin(⇡n)
=
0.5n 2⇡
⇡n
which is 1 for n = 0, and 0 for any other value of n.
(c) It seems the signal cannot be reconstructed from the samples, that frequency aliasing has occurred.
Ideally, that is not the case. The spectrum of the sampled signal xs (t) for Ts = 2⇡ (⌦s = 1) is
Xs (⌦) =
1
1 X
X(⌦
Ts
k= 1
k⌦s ) =
1
1 X
X(⌦
2⇡
k) = 1
k= 1
Passing this signal through an ideal low-pass filter with amplitude 2⇡ and cut-off frequency ⌦s /2 = 1/2
the reconstructed signal, the output of this filter, is the inverse Fourier transform of a pulse in frequency,
i.e., a sinc function, that coincides with the original signal.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.4
(a) X(⌦) = ej⌦ + e
j⌦
8.4
= 2 cos(⌦) which has no maximum frequency, so x(t) is not bandlimited.
(b) Y (⌦) = X(⌦)H(j⌦) = 2 cos(⌦)[u(⌦ + 1)
y(t) is band-limited.
u(⌦
1)] with maximum frequency of 1 and so
(c) It is not time limited, as
y(t)
=
=
Z 1
Z
1
1
j⌦t
2 cos(⌦)e d⌦ =
2⇡
2⇡
1
sin(t + 1) sin(t 1)
+
⇡(t + 1)
⇡(t 1)
1
[ej⌦(t+1) + ej⌦(t
1
Copyright 2014, Elsevier, Inc. All rights reserved.
1)
]d⌦
Chaparro — Signals and Systems using MATLAB
8.5
8.5
(a) Inverse Fourier transform
1
x(t) =
2⇡
Z
1
ej⌦t d⌦ =
1
sin(t)
⇡t
of infinite support in time but finite support in frequency.
(b) y(t) = (x ⇤ x)(t) then Y (⌦) = X(⌦)X(⌦) = X(⌦) so that y(t) = x(t)
(c) 2⇡fmax = 1 then fs
2fmax = 1/⇡ so Ts  ⇡.
(d) If Ts = ⇡ we get samples
x(nTs ) =
⇢
1/⇡
n=0
sin(n⇡)/(n⇡ 2 ) = 0 n =
6 0
Ts = ⇡ barely satisfies Nyquist.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.6
8.6 (a) The Fourier transform of x(t) is
X(⌦) = 0.5M (⌦
⌦c ) + 0.5M (⌦ + ⌦c )
where M (⌦) is the Fourier transform of m(t). The maximum frequency present in x(t) is
⌦max = ⌦c + 2⇡ ⇥ 22 ⇥ 103 = 2⇡(10 + 22)103 = 64⇡ 103
(b) The sampling frequency is
⌦s =
2⇡
Ts
2 ⇥ 64⇡ ⇥ 103 = 128⇡ ⇥ 103
so that
Ts 
1
10
64
3
sec/sample
(c) The bandwidth of the message is B = 2⇡ ⇥ 22 ⇥ 103 = 44⇡ ⇥ 103 rad/sec, using this frequency x(t)
can be sampled at 2B = 88⇡ ⇥ 103 rad/sec which is much smaller than the one found above.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.7
8.7 (a) If the signal x(t) is band-limited y(t) = x2 (t) has a Fourier transform Y (⌦) = (1/2⇡)(X(⌦)⇤X(⌦))
having a bandwidth double that of x(t), or
⌦max y = 2⌦M = 4000⇡
so y(t) is band-limited.
(b) Filtering with a low-pass filter of cut-off frequency 5000⇡ would not change the maximum frequency
of Y (⌦) so that
⇡
1
Ts 
=
= 0.25 ⇥ 10 3
4000⇡
4000
(c) No. For x(t),
⇡
Ts1 
= 0.5 ⇥ 10 3
2000⇡
and if Ts = 0.25 ⇥ 10
3
then Ts1  2Ts , so that we need to use Ts to sample both x(t) and y(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.8
8.8
(a) The maximum frequency of s(t) is fmax = 12 ⇥ 103 Hz thus according to Nyquist fs
24 ⇥ 103 Hz.
2fmax =
(b) The different spectra are shown in Fig. 8.1. By the modulation property the sampler shifts the
spectrum of s(t) up and down to center frequencies 10m (in kHz) for m = 0, ±1, ±2, · · · giving
the spectrum Ss (f ) in Fig. 8.1. If we filter the sampled signal with a low-pass filter of magnitude
Ts = 1/fs = 10 4 and bandwidth 2 kHz we recover the original message.
M (f )
1
2
f (kHz)
2
S(f )
1/2
12
8
8
10 12
f (kHz)
Ss (f )
1/Ts
···
12
s(t)
···
8
2
2
8
10
f (kHz)
12
ss (t)
LPF
fs1 = 10 kHz
Figure 8.1: Problem 8
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.9
8.9
(a) If F(cos(t)) = X(⌦), then F(x2 (t)) = (X ⇤ X)(⌦)/(2⇡), i.e., the convolution of X(⌦) with
itself, having twice the bandwidth of X(⌦), so the maximum frequency of x(t) is ⌦max = 2, and
Ts  ⇡/2. Thus x(t) is band-limited with twice the maximum frequency of cos(t).
Using cos2 (t) = 0.5(1 + cos(2t)) we see that its maximum frequency is 2 and it is band-limited
and Ts  ⇡/2.
(b) In general F(xN (t)) would be N convolutions of X(⌦) with itself, and the bandwidth being
N ⇥bandwith of cos(t), i.e., N , so the maximum frequency is ⌦max = N and Ts  ⇡/N .
If N = 3 , cos3 (t) = 0.25(3 cos(t) + cos(3t)) with ⌦max = 3, and Ts  ⇡/3.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.10 (a) If Ts = 1 then
⌦s =
2⇡
Ts
8.10
2⌦max
or ⌦max  ⇡. To reconstruct the original signal we choose the cutoff frequency of the ideal low-pass
filter to be
⌦max < ⌦c < 2⇡ ⌦max
and the magnitude Ts = 1.
( b) Since Ts  ⇡/⌦max , and Ts = 1 then ⌦max  ⇡. If ⌦max = ⇡ for an ideal low-pass filter, then
⌦c = ⇡ to recover the original signal. Thus the maximum frequency has to be smaller than ⇡ to make it
possible to use an ideal or a non-ideal low-pass filter to recover the original signal.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.11
8.11
(a) x(t) is not band-limited as the maximum frequency of x(t) is infinite, although the Fourier series
coefficients make the contribution of high frequencies very small.
(b) Total power
Px =
1
1
p
X
X
( 0.5|k| )2 = 2
0.5k
k= 1
1=
k=0
2
1 0.5
1=3
(c) The power of the approximating signal is
Px̂ =
N
N
p
X
X
( 0.5|k| )2 = 2
0.5k
k= N
k=0
1=
2(1
0.5N +1 )
1 0.5
1 = 4(1
0.5N +1 )
1
Letting Px̂ = 0.9Px = 2.7 we have
0.5N +1 ) 1
⇠
3.7
log(1 3.7/4)
=1
) N=
4
log(0.5)
2.7 = 4(1
N +1
0.5
where we chose an integer larger than the argument of d.e.
⇡
1 =3
(d) The maximum frequency of x̂(t) is N ⌦0 = N = 3 as ⌦0 = 1, and thus Ts  ⇡/3 is a sampling
period that can be used to avoid aliasing when sampling x̂(t) with it, and minimizes the aliasing
effect when used to sample x(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.12
8.12
(a) The sample values for Ts = 0.5 are
nTs
0
0.5
1.0
1.5
2.0
x(nTs )
cos(0) = 1
cos(⇡/2) = 0
cos(⇡) = 1
cos(3⇡/2) = 0
cos(2⇡) = 1
x(nTs ) = 0 nTs > 2.
The binary code for nTs = 0, 0.5, 1, 1.5, 2, 2.5 · · · is
01 00 10 00 01 00 · · ·
corresponding to the quantized signal
x̂(nTs ) =
(nTs ) + 0 ((n
1)Ts )
2
((n
2)Ts ) + 0 ((n
where
= 2/4 = 0.5, so that the quantization error is
"(nTs )
=
x(nTs )
=
0.5 (nTs ) + 0 ((n
3)Ts ) +
((n
4)Ts )
x̂(nTs )
1)Ts ) + 0 ((n
2)Ts ) + 0 ((n
3)Ts ) + 0.5 ((n
4)Ts )
(b) The sample values for Ts = 0.25 are
nTs x(nTs )
0
cos(0) = 1
0.25 cos(⇡/4) = 0.707
0.5 cos(⇡/2) = 0
0.75 cos(3⇡/4) = 0.707
1.0 cos(⇡) = 1
1.25 cos(5⇡/4) = 0.707
1.5 cos(3⇡/2) = 0
1.75 cos(7⇡/4) = 0.707
2.0 cos(2⇡) = 1
The binary code for nTs = 0, 0.25, · · · , 1.75, 2., 2.25, · · ·
01 01 00 11 10 11 00 01 01 00, · · ·
corresponding to the quantized signal
x̂(nTs )
=
(nTs ) +
2
+
where as before
"(nTs )
=
((n
((n
((n
4)Ts )
1)Ts ) + 0 ((n
((n
5)Ts )
1)Ts )
((n
0 ((n
6)Ts ) +
3)Ts )
((n
7)Ts )
7)Ts )
= 0.5, so that the quantization error is
0.5 (nTs ) + 0.207 ((n
+0 ((n
+0.5 ((n
4)Ts )
1)Ts ) + 0 ((n
0.207 ((n
2)Ts )
5)Ts ) + 0 ((n
0.207 ((n
3)Ts )
6)Ts ) + 0.207 ((n
8)Ts )
Copyright 2014, Elsevier, Inc. All rights reserved.
7)Ts )
Chaparro — Signals and Systems using MATLAB
8.13
8.13
(a) For x(t) to be sampled without aliasing we need ⌦s > 2⌦max = 2.
(b) If y(t) = x2 (t) then Y (⌦) = [X ⇤ X](⌦)/(2⇡) which gives a triangular spectrum in [ 2 2]
frequency band, i.e., it is band-limited.
(c) The maximum frequency of z(t) is ⌦max = 2 (rad/sec) so ⌦s
4 (rad/sec) and Ts  ⇡/2 sec.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.14
8.14
(a) The samples of the sampled signals are obtained by letting t = nTs
x1 (0.5n) = cos(⇡n)
x2 (0.5n) = cos(⇡n + 4⇡n) = cos(⇡n)
which coincide. The sampling period for x1 (t) should be T1s  ⇡/⌦max = 1/2 for no aliasing.
For x2 (t) we would need a sampling period T2s  ⇡/⌦max = 1/6 < T1s thus aliasing occurs
when we sample x2 (t) with T1s .
(b) We want
x2 (0.5n) = cos(⇡n + 0.5 n) = x1 (0.5n) = cos(⇡n)
which is obtained by letting 0.5 = 2⇡k, for an integer k 6= 0, i.e.,
= 4⇡k, k = ±1, ±2, · · ·
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.15
8.15
(a) The sampling frequency is ⌦s = 4⇡ then Ts = 0.5 sec/sample.
(b) The spectrum of x(t) is
X(⌦) = r(⌦ + ⇡)
2r(⌦) + r(⌦
⇡)
where r(.) is the ramp function. By duality, we have that if z(t) = r(t + ⇡)
Fourier transform is
Z(⌦)
=
=
=
2 + e s⇡
|s=j⌦
s2
1 cos(⇡⌦)
sin2 (⇡⌦/2)
=
4
2
⌦2
⌦2
✓
◆2
sin(⇡⌦/2)
⌦/2
Z(s)|s=j⌦ =
es⇡
then
so that
Z(t) , 2⇡z( ⌦) = 2⇡z(⌦)
x(t) =
Z(t)
1
=
2⇡
2⇡
✓
sin(⇡t/2)
t/2
◆2
(c) An ideal low-pass filter of dc gain Ts = 1/2 and bandwidth ⇡ < B < 3⇡.
Copyright 2014, Elsevier, Inc. All rights reserved.
2r(t) + r(t
⇡) its
Chaparro — Signals and Systems using MATLAB
8.2
8.16
Problems using MATLAB
8.16 (a) Because both of these signals have finite time support they are not band-limited, their support in
frequency is infinite. For x(t), its Fourier transform is
X(⌦) =
1
(1
s
e
s
)|s=j⌦ =
1
e
j⌦
j⌦/2
2j sin(⌦/2) =
sin(⌦/2)
e
⌦/2
j⌦/2
For y(t) we have that
dy(t)
= u(t)
dt
2u(t
1) + u(t
2) = x(t)
x(t
1)
1) =
4
e
j⌦
so that
j⌦Y (⌦) =
using
1
e
s
s
(es
sin2 (✓) = 12 (cos(2✓)
2+e
s
) |s=j⌦ =
2
e
j⌦
j⌦
(cos(⌦)
j⌦
sin2 (⌦/2)
1). So that
Y (⌦) = e
j⌦
✓
sin(⌦/2)
⌦/2
◆2
= X 2 (⌦)
(b) The energy of x(t) is unity (the area under |x(t)|2 ), i.e., Ex = 1. According to Parseval, 90% of the
energy of x(t) is within the frequency band [ ⌦0 , ⌦0 ] or
Z ⌦0
1
0.9 =
|X(⌦)|2 d⌦
2⇡
⌦0
Z ⌦0
2
1
sin(⌦/2
=
d⌦
2⇡
⌦/2
⌦0
Using MATLAB symbolic computation we find the integral
% Pr. 8_16
clear all; clf
syms x t X X1 Y Y1 w z
x=heaviside(t)-heaviside(t-1);
X=fourier(x);
X1=(abs(X))ˆ2;
figure(1)
subplot(211)
ezplot(x,[-1,2]);grid;axis([-1 2 -2 2])
subplot(212)
ezplot(X1,[-30,30]);grid;axis([-10 10 -0.25 1.25])
for k=1:70,
omega0=0.1*k;
z=int(X1,w,0,omega0);
zz(k)=subs(2*z)/(2*pi);
if zz(k)<=0.9,
omega0
else
return
end
end
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.17
This script gives that ⌦0 = 5.3 (rad/sec) can be considered the maximum frequency in the sampling of
x(t).
For y(t), the energy is
Ey = 2
Z
1
t2 dt = 2
0
t3 1
2
|t=0 =
3
3
Ninety percent of the energy for this signal is in the frequency band [ ⌦1 , ⌦1 ] or
2
0.9
3
=
=
1
2⇡
1
2⇡
Z
Z
⌦1
⌦1
⌦1
⌦1
|X(⌦)|4 d⌦
sin(⌦/2
⌦/2
4
d⌦
because |Y (⌦)| = |X(⌦)|2 .
Again, we use MATLAB symbolic computation to find the value of ⌦1 .
y=t*(heaviside(t)-heaviside(t-1))+(2-t)*(heaviside(t-1)-heaviside(t-2));
Y=Xˆ2
Y1=(abs(Y))ˆ2;
figure(2)
subplot(211)
ezplot(y,[-1,2]);grid;axis([-1 2 -2 2])
subplot(212)
ezplot(Y1);grid;axis([-5 5 -0.25 1.25])
for m=1:35,
omega1=m*0.1;
v=int(Y1,w,0,omega1);
zz(m)=subs(2*v)/(2*pi);
if zz(m)<=0.6,
omega1
else
return
end
end
This script gives that ⌦1 = 2.6 (rad/sec) < ⌦0 can be used as a good approximation to the maximum
frequency of y(t).
(c) The signal y(t) is smoother than x(t) (this signal displays higher frequencies than y(t)) so that we
expect that ⌦max y < ⌦max x . Accordingly the sampling period Tsy to sample without aliasing y(t) is
larger than the one required to sample x(t). If we choose as maximum frequencies the values ⌦0 and
⌦1 for the signals x(t) and y(t) we calculated above, we should have that ⌦0 > ⌦1 and choosing the
Nyquist sampling periods (the values that give an equality in the Nyquist sampling rate condition)
Tsy =
⇡
⇡
>
= Tsx
⌦1
⌦0
Thus aliasing would be caused by using Tsy to sample x(t).
(d) On the other hand, Tsx would be appropriate to sample x(t) as well as y(t).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
heaviside(t)−heaviside(t−1)
2
8.18
1
1
0
0
−1
−1
−2
−1
−0.5
0
0.5
t
t (heaviside(t)−heaviside(t−1))+(2−t) (heaviside(t−1)−heaviside(t−2))
2
1
1.5
2
−2
−1
−0.5
abs((−1+exp(−i w))/w)2
1
0.5
0.5
0
0
−8
−6
−4
−2
0
w
2
0.5
t
1
1.5
2
16/w2 sin(1/2 w)2 exp(−i w) conj(1/w2 sin(1/2 w)2 exp(−i w))
1
−10
0
4
6
8
10
−5
−4
−3
−2
−1
0
w
1
Figure 8.2: Problem 16. Left: x(t) and |X(⌦)|2 . Right: y(t) and |Y (⌦)|2 .
Copyright 2014, Elsevier, Inc. All rights reserved.
2
3
4
5
Chaparro — Signals and Systems using MATLAB
8.19
8.17 (a) For the Gaussian signal we notice that the signal and its spectrum look very similar, and that the
spectrum is narrower that the signal. For x1 (t), we notice that it has discontinuities and its spectrum has
high frequencies because of them. See Figs. 8.3 and 8.4.
(b) Computing (t) and (⌦) we verify the uncertainty bound. It is 1 for the Gaussian signal (the only
signal that will give this value) and 1.2197 for the square pulse x1 (t). You need to make some simple
changes to the script for x1 (t), the script shown is for the Gaussian signal.
% Pr. 8_17
clear all; clf
syms x t X X1 w z
sigma=1
%x=heaviside(t+sigma)-heaviside(t-sigma);
x=exp(-tˆ2/(2*sigmaˆ2));
X=fourier(x,w);
XX=X*conj(X);
figure(1)
subplot(211)
ezplot(x,[-4*sigma,4*sigma]);grid;
subplot(212)
ezplot(XX,[-4*sigma,4*sigma]);grid;
Ex=int(xˆ2,t,-4*sigma,4*sigma)
figure(2)
subplot(211)
ezplot((xˆ2)*(tˆ2)/Ex,[-4*sigma,4*sigma]);grid;
subplot(212)
ezplot(XX*(wˆ2)/Ex,[-4*sigma,4*sigma]);grid;
z=int((xˆ2)*(tˆ2),t, -4*sigma, 4*sigma)/Ex
zz=subs(sqrt(z)) % Delta(t)
v=int((Xˆ2)*(wˆ2)/(2*pi),w, -4*sigma,4*sigma)/Ex
vv=subs(sqrt(v)) % Delta(W)
2*zz*vv
1/exp(t2/2)
t2/(π1/2 erf(4) exp(t2))
1
0.2
0.8
0.15
0.6
0.1
0.4
0.05
0.2
0
−4
0
−3
−2
−1
0
t
1
2
3
4
−4
−3
−2
(2 π)/(exp(w2/2) exp(conj(w)2/2))
−1
0
t
1
2
3
4
2
3
4
(2 π1/2 w2)/(erf(4) exp(w2/2) exp(conj(w)2/2))
6
5
1
4
3
0.5
2
1
0
0
−4
−3
−2
−1
0
w
1
2
3
4
−4
−3
−2
−1
0
w
1
Figure 8.3: Problem 17: Gaussian signal x(t) and its spectrum (both are real) (left); integrands used to
calculate (t) and (⌦) (right)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
heaviside(t + 1) − heaviside(t − 1)
8.20
(t2 (heaviside(t − 1) − heaviside(t + 1))2)/2
0.8
1
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0
−4
−3
−2
−1
0
t
1
2
3
4
((cos(w) i − sin(w))/w − (cos(w) i + sin(w))/w) ((cos(conj(w)) i − sin(conj(w)))/conj(w) − (cos(conj(w)) i + sin(conj(w)))/conj
−4
4
2
3
1.5
2
1
1
0.5
0
−4
−3
−2
−1
0
t
1
2
3
4
(w2 ((cos(w) i − sin(w))/w − (cos(w) i + sin(w))/w) ((cos(conj(w)) i − sin(conj(w)))/conj(w) − (cos(conj(w)) i + sin(conj(w)))/conj
0
−3
−2
−1
0
w
1
2
3
4
−4
−3
−2
−1
0
w
1
2
3
Figure 8.4: Problem 17: Rectangular pulse x1 (t) and its spectrum (left); integrands used to calculate
and (⌦) (right
Copyright 2014, Elsevier, Inc. All rights reserved.
4
(t)
Chaparro — Signals and Systems using MATLAB
8.21
8.18 (a) The Fourier transform is
X(⌦) =
2
s2
1
|s=j⌦ =
2
1 + ⌦2
x(t) is not band-limited, the frequency support of X(⌦) is infinite.
(b) The energy of the signal is
Ex = 2
Z
1
e
2t
dt = 2
0
e
2t
2
|1
0 =1
thus 99% of the energy in the frequency domain is
0.99
=
1
2⇡
Z
⌦0
⌦0
2
1 + ⌦2
2
d⌦
for some value of ⌦0 which can be obtained using the following script:
% Pr. 8_18
clear all; clf
syms x t X X1 w v
x=exp(-abs(t));
X=fourier(x);
X1=X*conj(X);
figure(1)
subplot(211)
ezplot(x,[-10,10]);grid;axis([-10 10 -0.2 1.2])
subplot(212)
ezplot(X1,[-5, 5]);grid;axis([-5 5 -0.2 4.2])
for m=1:34,
omega1=m*0.1;
v=int(X1,w,0,omega1);
zz(m)=subs(2*v)/(2*pi);
if zz(m)<=.9900,
zz(m)
omega1
else
m
end
end
The maximum frequency is found to be 3.3 (rad/sec).
(c) For a sampling frequency ⌦s = 5⌦0 = 16.5 the sampling period would be Ts = 2⇡/⌦s =
2⇡/16.5 = 0.3808 sec/sample.
(d) Looking at the spectrum |X(⌦)|, an anti-aliasing filter would be an ideal low-pass filter with a magnitude of 1 and a cut-off frequency ⌦c = ⌦0 = 3.3 (rad/sec).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.22
1/exp(abs(t))
1
0.8
0.6
0.4
0.2
0
−0.2
−10
−8
−6
−4
−2
0
t
2
2
4
6
8
10
2
3
4
5
2
4/((w + 1) (conj(w) + 1))
4
3
2
1
0
−5
−4
−3
−2
−1
0
w
1
Figure 8.5: Problem 18: signal x(t) and |X(⌦)|2 .
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
8.23
8.19 (a)–(c) The sampled signal is given as
x(nTs ) = x[n] = 0.8 cos(2⇡n 0.025) + 0.15
The following script performs the sampling, quantization and coding.
0  n  40
% Pr 8_19
clear all; clf
% analog signal
t=0:0.025:1; x=0.8*cos(2*pi*t)+0.15;
% sampled signal
Ts=0.025; N=length(t); n=0:N-1;
xs=0.8*cos(2*pi*n*Ts)+0.15;
figure(1)
subplot(211)
plot(t,x)
hold on
% quantized signal
Q=2; % quantization levels is 2Q
[d,y,e]=quantizer(x,Q);
stem(t,y)
hold off
subplot(212)
stem(t,e)
% binary signal
z=coder(y,d)
x(t),xs(nTs),xq
1
0.5
0
−0.5
−1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
nTs
0.6
0.7
0.8
0.9
1
0.5
e(nTs)
0.4
0.3
0.2
0.1
0
Figure 8.6: Problem 19: original signal with discrete signal and quantized signal superposed. Quantization
error.
The functions used are given below.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
function [d,y,e]=quantizer(x,Q)
% Input: x, signal to be quantized at 2Q levels
% Outputs: y quantized signal
%
e, quantization error
%
d quantum
% USE [d,y,e]=quantizer(x,Q)
%
N=length(x);
d=max(abs(x))/Q;
for k=1:N,
if x(k)>=0,
y(k)=floor(x(k)/d)*d;
else
y(k)=-(floor(abs(x(k))/d)*d+d);
end
if y(k)==2*d,
y(k)=d;
end
end
e=x-y;
function z1=coder(y,delta)
% Coder for 4-level quantizer
% input: y quantized signal
% output: z1 binary sequence
% USE z1=coder(y)
%
z1=’00’; % starting code
N=length(y);
for n=1:N,
y(n)
if y(n)== delta
z=’01’;C
elseif y(n)==0
z=’00’;
elseif y(n)== -delta
z=’11’;
else
z=’10’;
end
z1=[z1 z];
end
M=length(z1);
z1=z1(3:M) % get rid of starting code
Copyright 2014, Elsevier, Inc. All rights reserved.
8.24
Chapter 9
Discrete–time Signals and Systems
9.1
Basic Problems
9.1 See Fig. 9.1 for some of the answers.
Expressing x[n] = [n + 1] + [n] + [n 1] + 0.5 [n 2] we then have
(a) x[n 1] is x[n] delayed by 1 (shifted right 1 sample); x[ n] is the reflection of x[n], and x[ n + 2]
is x[n] reflected and shifted right by 2 samples, or x[ n + 2] = 0.5 [ n] + [ n + 1] + [ n + 2] +
[ n + 3] = 0.5 [n] + [n 1] + [n 2] + [n 3] because [n] is even.
(b)(c) Even
8
n = 1, 0, 1
< 1
0.25 n = 2, 2
xe [n] = 0.5(x[n] + x[ n])
:
0
otherwise
and the odd component is
xo [n] = 0.5(x[n]
x[ n])
1
8
<
:
0.25
0.25
0
n= 2
n=2
otherwise
Chaparro — Signals and Systems using MATLAB
9.2
x[n]
1
0.5
n
xe [n]
1
0.25
n
xo [n]
0.25
n
0.25
x[ n + 2]
1
0.5
n
Figure 9.1: Problem 1
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.2
9.3
(a) The discrete frequency of x[n] is
2⇡ ⇥ 7
20
so that the fundamental period is N0 = 20 and m = 7.
!0 = 0.7⇡ =
(b) x(t)|t=nTs = x(nTs ) = cos(⇡nTs ), so Ts = 0.7 sec/sample, and the sampling frequency ⌦s =
2⇡/Ts = ⇡ ⇥ (20/7) rad/sec which satisfies Nyquist since ⌦max = ⇡ rad/sec. i.e., ⌦s > 2⌦max .
The discrete–time signal here coincides with the one given above.
(c) To make cos(⇡nTs ) look like cos(⇡t) we need to divide its fundamental period into large number
of points, e.g., the fundamental period of x(t) is T0 = 2, letting Ts = T0 /N for N
2 would
satisfy Nyquist but also would provide a discrete signal that looks like the analog signal when N is
large. For instance, in this case Ts  1 so that Ts = 1 (N = 2) and Ts = 0.1 (N = 20) both satisfy
Nyquist but the latter one gives a signal that looks like the analog signal while the other does not.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.3
9.4
(a) The discrete frequency for the given signals are
(i)
x[n] :
(ii)
y[n] :
(iii)
z[n] :
(iv)
v[n] :
2⇡
) periodic with period N0 = 2
2
2⇡m
!0 = 1 6=
, not periodic
N0
not periodic, as y[n] is not periodic
3⇡
2⇡
!0 =
=
3, ) periodic with period N0 = 4
2
4
!0 = ⇡ =
(b) x1 [n] is periodic of fundamental period N1 = 4, and y1 [n] is periodic of fundamental period
N2 = 6 so that
N1
4
2
= =
N2
6
3
then the sum z1 [n] = x1 [n] + y1 [n] is periodic of period 3N1 = 2N2 = 12, i.e., three periods of
x1 [n] fit in 2 of y1 [n].
Similarly, v1 [n] is periodic of period 12. Indeed,
v1 [n + 12] = x1 [n + 12]y1 [n + 12] = x1 [n]y1 [n]
since 12 is three times the period of x1 [n] and two times the period of y1 [n].
The compressed signal w1 [n] = x1 [2n] has period N1 /2 = 2:
w1 [n + 2] = x1 [2(n + 2)] = x1 [2n + 4] = x1 [2n] = w1 [n]
since x1 [2n] is periodic of period 2.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.4
9.5
(a) x[n] = ej(n/8 1) = cos(n/8 1) + j sin(n/8 1) so !0 = 1/8 which cannot be expressed as
2⇡m/N0 for non-divisible integers m and N0 . So x[n] is not periodic.
x1 [n] has a discrete frequency !1 = ⇡/8 = 2⇡/16 so it is periodic with fundamental period
N1 = 16.
(b)
i. !1 = ⇡/5 = 2⇡/10 and !2 = ⇡/10 = 2⇡/20 so that N1 = 10 and N2 = 20 are the
fundamental periods of the two components of the signal. Since N1 /N2 = 1/2 then 2N1 =
N2 = 20 is the fundamental period of x[n] and the fundamental frequency is 2⇡/20 = 0.1⇡.
ii. The power of x[n] is
Px =
x2 [n]
19
1 X 2
x [n]
20 n=0
=
(cos(⇡n/5) + sin(⇡n/10))2
=
cos2 (⇡n/5) + 2 cos(⇡n/5) sin(⇡n/10) + sin2 (⇡n/10)
since
2 cos(⇡n/5) sin(⇡n/10) = sin(3⇡n/10)
sin(⇡n/10)
then
2
19
X
cos(⇡n/5) sin(⇡n/10)
n=0
=
19
X
(sin(3⇡n/10)
sin(⇡n/10)) = 0 + 0 = 0
n=0
because we are adding the values over periods of the sinusoids. Thus
Px
=
19
19
19
1 X 2
1 X
1 X 2
2
x [n] =
cos (⇡n/5) +
sin (⇡n/10) = Px1 + Px2
20 n=0
20 n=0
20 n=0
where x1 [n] = cos(⇡n/5) and x2 [n] = sin(⇡n/10).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.5
9.6
(a) Energy of x[n]
"x =
10
X
n2 =
n=0
Using the formula
N
X
k2 =
k=1
(b) Calling p[n] = u[n]
10 ⇥ 11 ⇥ 21
= 385
6
N (N + 1)(2N + 1)
6
11] so x[n] = r[n]p[n] we have
u[n
xe [n] = 0.5(r[n]p[n] + r[ n]p[ n])
xo [n] = 0.5(r[n]p[n]
r[ n]p[ n])
The energy
"x
=
=
=
1
X
n= 1
1
X
n= 1
1
X
n= 1
(xe [n] + xo [n])2
x2e [n] + x2o [n] + 2xe [n]xo [n]
x2e [n] +
1
X
x2o [n]
n= 1
since xe [n]xo [n] is odd its sum is zero. Also from plots of xe [n] and xo [n] we have that
"x
=
4
10
10
X
X
n2
=
n2 = 385
4
n=0
n=0
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.6
(a)
9.7
i. If input is x[n] the output is y[n] = x[n]x[n 1], if input is ↵x[n], ↵ 6= 1, the output is
↵2 x[n]x[n 1] 6= ↵x[n]x[n 1] so system is non-linear.
If input is x[n] the output is y[n] = x[n]x[n 1], and if input is x[n 1] the output is
x[n 1]x[n 2] = y[n 1] so system is time-invariant.
ii. Causal, y[n] depends on present and past inputs and it is zero when the input is zero. Moreover,
when x[n] = 0 then y[n] = 0.
If x[n] is bounded for all n, then |x[n]| < M and |x[n 1]| < M and |y[n]| = |x[n]||x[n
1]| < M 2 , so bounded. Yes, BIBO stable.
Indeed, if x[n] = u[n] then
Non-linearity:
x[n]
=
x1 [n]
=
u[n] ) y[n] = u[n]u[n
2u[n] ) y1 [n] = 4u[n
1] = u[n
1]
1] 6= 2u[n
1]
Time-invariance
x[n] = u[n]
x1 [n] = u[n
(b)
1]
)
)
y[n] = u[n
y1 [n] = u[n
1]
2] = y[n
1]
i. No, it is a modulation system as such LTV.
ii. Expressing x[n] = cos(2⇡n/8) its fundamental period is N0 = 8. We have
y[n + 8] = x[n + 8] cos((n + 8)/4) = x[n] cos(n/4 + 2) 6= y[n]
since 2 cannot be expressed in terms of ⇡, so y[n] is not periodic. It will also be true for any
multiple of 8.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.8
9.7 (a) Yes, the quantizer is time-invariant. Indeed, x(nTs ) and x(nTs M Ts ) will give the same values
just shifted in time. In this case the M must be an integer as the sampled signal is discrete in time.
(b) The samples are given by x(nTs ) = nTs = 0.1n. For
= 0.25 the sample x[1] = 0.1 when
quantized gives x̂[1] = 0 since 0 < 0.1 < . If we multiply the signal by 3 so that the value 3x[1] = 0.3
would give x̂[1] = 1 since < 0.3 < 2 . Since the second output is not the first output multiplied by
3, the quantizer is not linear.
We saw before that the sampler is linear but time-varying, while the quantizer is time-invariant but nonlinear, so the A/D converter which is composed of these systems is not LTI.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.8
9.9
(a) x[n] is periodic of fundamental period N0 = 4 and f [n] is periodic of fundamental period N1 = 7,
so y[n] is periodic of fundamental period N = 28.
(b) f [n] is a window of width 2 so that y[n] = x[n]f [n] = u[n](u[n] u[n 2]) = f [n] and if we
delay the input so that x1 [n] = x[n 3], then y1 [n] = 0 6= y[n 3] so the system is time-varying.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.9
(a) If input is ↵x[n], output is
the output is
y1 [n]
Pn+4
k=n 2
↵x[k] = ↵y[n], so system is linear. If input is x1 [n] = x[n 1]
n+4
X
=
x1 [k] =
k=n 2
n+3
X
=
9.10
n+4
X
x[k
1] let m = k
k=n 2
x[m] = y[n
1]
m=n 3
so the system is time–invariant.
(b) Non–causal since output depends on future values of input:
y[n] =
n+4
X
x[k] =
k=n 2
n
X
x[k] +
k=n 2
n+4
X
x[k]
k=n+1
If |x[n]| < M , i.e., bounded, then y[n] is bounded, indeed
|y[n]| 
n+4
X
k=n 2
|x[k]| 
n+4
X
M = 7M
k=n 2
Copyright 2014, Elsevier, Inc. All rights reserved.
1
Chaparro — Signals and Systems using MATLAB
9.10
9.11
(a) Impulse response: using the difference equation
h[n] =
0.5h[n
1] + [n]
obtained when the input is [n] and the outputs is h[n] (no initial conditions) we have
h[n]
=
0.5h[n
=
0.5( 0.5h[n
=
1] + [n]
2
0.5 ( 0.5h[n
2
+0.5 [n
..
.
2] + [n
3] + [n
2])
0.5 [n
1]) + [n] = 0.52 h[n
2])
0.5 [n
2]
0.5 [n
1] + [n] =
0.53 h[n
1] + ( 0.5)n
2
1] + [n]
3]
1] + [n]
indicating that h[n] = ( 0.5)n u[n].
(b) Writing x[n] = [n] + [n
y[n]
=
=
1] + [n
h[n] + h[n
n
2] the output is
1] + h[n
( 0.5) u[n] + ( 0.5)
2]
n 1
nu[n
Recursive solution of the difference equation gives the same result.
Copyright 2014, Elsevier, Inc. All rights reserved.
u[n
2]
Chaparro — Signals and Systems using MATLAB
9.11
9.12
(a) The convolution integral gives
y(t) = r(t)
r(t
2.5)
r(t
3.5) + r(t
6)
See Fig. 9.2
y(t)
h(t
t
⌧)
2.5
1
t
x(⌧ )
1
3.5
⌧
2.5 3.5
6
t
Figure 9.2: Problem 11(a)
(b) If we discretize both x[n] and h[n] with Ts = 0.5, i.e., t = 0.5n, we get
⇢
1 0  n2  3.5 or 0  n  7
x[n] =
0 otherwise
⇢
1 0  n2  2.5 or 0  n  5
h[n] =
0 otherwise
The convolution sum gives
8
n+1
>
>
<
6
y[n] =
6 (n
>
>
:
0
7)
0n5
n = 6, 7
8  n  12
otherwise
Thus y[n]/6 approximates the continuous convolution. Notice that the length of the convolution is
length x[n]+ length of h[n] = 8 + 6 1 = 13.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.12
9.13
(a) Moving averages
y[2]
=
(0.9 + 1.2 + 1)/3 = 1.03
y[3]
=
(0.7 + 0.9 + 1.2)/3 = 0.93
y[4]
=
(1.2 + 0.7 + 0.9)/3 = 0.93
y[5]
=
(1 + 1.2 + 0.7)/3 = 0.97
(b) Impulse response of averager
h[n] = (1/3)( [n] + [n
1] + [n
2])
the convolution sum
y[n]
=
n
X
h[m]x[n
m]
h[m]x[2
m] =
1
1
1
0.9 + 1.2 + 1
3
3
3
h[m]x[3
m] =
1
1
1
0.7 + 0.9 + 1.2
3
3
3
h[m]x[4
m] =
1
1
1
1.2 + 0.7 + 0.9
3
3
3
h[m]x[5
m] =
1
1
1
1 + 1.2 + 0.7
3
3
3
m=0
y[2]
=
2
X
m=0
y[3]
=
2
X
m=0
y[4]
=
2
X
m=0
y[5]
=
2
X
m=0
The results are the same as before.
(c) Median
ym [2] = median[0.9, 1.2, 1] = 1
ym [3] = median[0.7, 0.9, 1.2] = 0.9
ym [4] = median[1.2, 0.7, 0.9] = 0.9
ym [5] = median[1, 1.2, 0.7] = 1
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.14
9.13 Discretization of differential equation:
y(nT + T ) y(nT )
x(nT + T ) x(nT )
+ y(nT ) = 2x(nT ) +
T
T
) y((n + 1)T ) = (1 T )y(nT ) + (2T 1)x(nT ) + x((n + 1)T )
and letting m = n + 1 we get
y(mT ) = (1
T )y((m
1)T ) + (2T
1)x((m
1)T ) + x(mT )
Figure 9.3 shows the block diagram when T = 1.
x[n]
D
x[n
1]
y[n]
+
Figure 9.3: Problem 13: block diagram of difference equation when T = 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.14
9.15
(a) We have
e[n] = x[n]
)
y[n
y[n] + 2y[n
1], y[n] = 2e[n
2] = 2x[n
1] = 2x[n
1]
2y[n
2]
1]
(b) The impulse response is found by letting x[n] = [n], IC zero, and y[n] = h[n]. Recursively,
h[n] =
2h[n
2] + 2 [n
1]
h[0] = 0, h[1] = 2, h[2] = 0, h[3] =
4, h[4] = 0, h[5] = 8, · · ·
or h[n] = 2( 2)(n 1)/2 , n odd, 0 otherwise, which grows as n increases, so it is not absolutely
summable, i.e., system is not BIBO stable.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.15
(a) x[n] = [n] + [n
1] + [n
2] and y[n] = [n
9.16
1] + [n
2] + [n
length (y[n]) = length (x[n]) + length (h[n])
Thus length of h[n] is 3
3], and
1.
3 + 1 = 1.
(b) Since the input is x[n] = [n] + [n 1] + [n 2] the output is y[n] = h[n] + h[n
but also y[n] = [n 1] + [n 2] + [n 3] so that
1] + h[n
2]
y[0] = 0 = h[0]
y[1] = 1 = h[1] + h[0]
y[2] = 1 = h[2] + h[1] + h[0]
y[3] = 1 = h[3] + h[2] + h[1]
solving for the impulse response values we get h[0] = 0, h[1] = 1
values are zero. Thus the length of h[n] is 1.
h[0] = 1 and the rest of the
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.16
(a) Since [n] = u[n]
(b)
1] using the LTI of the system
u[n
h[n] = s[n]
9.17
s[n
1] = (3
3(0.5)n+1 )u[n]
(3
3(0.5)n )u[n
1]
i. We have
0.5x[n]
0.5x[ n]
y[n]
=
=
=
⇢
⇢
0.5
0
n = 0, 1, 2
otherwise
0.5
0
n = 0, 1, 2
otherwise
8
< 0.5
1
:
0
n = ±1, ± 2
n=0
otherwise
No, the system is not causal; y[n] depends on future values of the x[n], e.g., y[ 1] = 0.5(x[ 1]+
x[1]).
ii. The delayed input is x1 [n] = u[n 1] u[n 4] and the corresponding output is
y1 [n]
while y[n
equal.
iii. Output is
=
0.5(u[n
=
0.5(u[n + 4]
1]
u[n
1] = 0.5 [n + 1] + 0.5 [n] + 1 [n
y[n]
=
=
4] + u[ n
1]
u[n + 1]) + 0.5(u[n
1] + 0.5 [n
u[ n
1]
4])
u[n
2] + 0.5 [n
0.5 cos(2⇡n/5)u[n] + 0.5 cos( 2⇡n/5)u[ n]
⇢
1
n=0
0.5 cos(2⇡n/5) n 6= 0
The output is not periodic, because y[0] = 1 does not repeat.
Copyright 2014, Elsevier, Inc. All rights reserved.
4])
3] which are not
Chaparro — Signals and Systems using MATLAB
(a) For N = 4 the length of the output y[n] = length of x[n]+ length h[n]
N = 4, the convolution sum gives (see Fig. 9.4):
n
y[n]
0, 7
1
1, 6
2
1=5+4
1 = 8. For
n
y[n]
2, 5
3
3, 4
4
0 otherwise.
5
4
3
y[n]
9.17
9.18
2
1
0
−1
−2
−1
0
1
2
3
n
4
5
6
7
8
Figure 9.4: Problem 17: convolution sum y[n] of x[n] and h[n]
(b) The values of the convolution sum
y[3]
=
3
X
h[k]x[3
k] = x[3] + x[2] + x[1] + x[0] = 3
h[k]x[6
k] = x[6] + x[5] + x[4] + x[3] = 0
k=0
y[6]
=
6
X
k=0
can be obtained by letting x[n] = u[n] u[n 3] so that the second summation is zero as x[n] = 0
for n 3 and h[n] = 0 for n 4, and the first summation is 3 given that x[3] = 0 and the other
terms are one.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.18
9.19
(a) Solving recursively the first difference equation y[n] = 0.5y[n
zero:
y[0]
=
y[1]
=
..
.
0.5 ⇥ 1 + 0 = 0.5
y[n]
=
0.5n
1] + x[n], with x[n] = [n], IC
[0] = 1
For the second difference equation y[n] = 0.25y[n
zero:
2] + 0.5x[n
y[0]
=
0 + 0 + [0] = 1
y[1]
=
0 + 0.5 [0] + 0 = 0.5
y[2]
=
..
.
0.25 + 0 + 0 = 0.52
y[n]
=
0.5n
1] + x[n], with x[n] = [n], IC
The second equation is obtained by replacing y[n 1] = 0.5y[n 2] + x[n
changing n by n 1 in the first difference equation) into the first equation.
1] (calculated by
(b) Replacing y[n 1] = 0.5y[n 2] + x[n 1] we get the previous second equation, then replacing
y[n 2] = 0.5y[n 3] + x[n 2] we get a new equation,
y[n] = 0.53 y[n
3] + 0.52 x[n
2] + 0.5x[n
1] + x[n]
and repeating this process we finally obtain
y[n] =
1
X
0.5k x[n
k]
k=0
which is the convolution sum of h[n] = 0.5n u[n] (impulse response) and x[n] which coincides with
the response obtained above.
(c) For x[n] = u[n]
these results)
11] the convolution sum is (do the convolution sum graphically to verify
u[n
y[n]
8
< 0P
n
0.5k
: Pk=0
n
k
k=n 10 0.5
=
For 0  n  10 we get
y[n] =
for n
11, letting m = k
1
n<0
0  n  10
n 11
0.5n+1
= 2(1
1 0.5
0.5n+1 )
n + 10
y[n] =
10
X
0.5m+n
10
= 0.5n
m=0
As n ! 1 we get y[n] ! 0.
(d) The maximum occurs at n = 10 when y[10] = 2(1
10
⇥ 2(1
0.511 )
0.511 ).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.20
9.19 The convolution sum is
y[n]
=
n
X
x[m]h[n
m]
m=0
y[0]
=
x[0]h[0] = 1
y[1]
=
x[0]h[1] + x[1]h[0] =
y[2]
=
x[0]h[2] + x[1]h[1] + x[2]h[0] = 1
y[3]
=
x[0]h[3] + x[1]h[2] + x[2]h[1] + x[3]h[0] =
y[4]
=
x[0]h[4] + x[1]h[3] + x[2]h[2] + x[3]h[1] + x[4]h[0] = 1
y[n]
=
x[0]h[n] + x[1]h[n
1+1=0
1] + x[2]h[n
1+1=1
1+1
1+0=
2] = ( 1)n + ( 1)n
1
1+1+0+0=1
1
+ ( 1)n
Copyright 2014, Elsevier, Inc. All rights reserved.
2
= ( 1)n
2
n
5
Chaparro — Signals and Systems using MATLAB
9.21
9.20 Recursively,
c[1]
=
(1
)c[0] + ↵
c[2]
=
(1
)c[1] + ↵ = (1
)2 c[0] + [(1
) + 1]↵
c[3]
=
(1
..
.
)c[2] + ↵ = (1
)3 c[0] + [(1
)2 + (1
c[n]
=
(1
)n c[0] + ↵
n
X1
(1
)m
m=0
=
(1
=
(1
↵(1 (1
)n )
)n c[0] +
1 1+
↵
n
) c[0] + (1 (1
)n )
for c[n] ! ↵/ as n ! 1 then |1
| < 1 or 0 <
< 2, independent of c[0].
Copyright 2014, Elsevier, Inc. All rights reserved.
) + 1]↵
Chaparro — Signals and Systems using MATLAB
9.21
(a) Using a change of variable m = n
9.22
k we have
y[n] =
1
X
m=0
(m + 2) x[n
| {z }
m]
h[m]
so that h[n] = (n + 2)u[n] is the impulse response.
(b) If x[n] = u[n] then
y[n]
=
=
n
X
(n
k=0
n
X
k + 2)
(m + 2)
m=0
=
=
n(n + 1)
+ 2(n + 1)
2
(n + 1)(n + 4)
2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.22
9.23
(a) The input-output equation can be written
y(nTs )
=
1
X
1
x(nTs
2N + 1
N
kTs ) +
k= N
=
X
1
x(nTs
2N + 1
kTs )
k=0
N
N
X
X
1
1
x(nTs + mTs ) +
x(nTs
2N + 1 m=1
2N + 1
kTs )
k=0
which requires future inputs, so this averager is non-causal.
(b) For N = 2 and x(nTs ) = (nTs ) then
h(nTs ) =
2
1 X
(nTs
5
kTs )
k= 2
(c) The output is the convolution sum of x(nTs ) and h(nTs ) which gives
y(nTs )
=
((n + 2)Ts ) + 2 ((n + 1)Ts ) + 3 (nTs )
+3 ((n
1)Ts ) + 3 ((n
2)Ts ) + 2 ((n
3)Ts ) + ((n
4)Ts ).
Notice that the length of y(nTs ) is the sum of the lengths of x(nTs ) and and of h(nTs ) minus 1, or
3 + 5 1 = 7.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.23
9.24
(a) If y1 [n] = (x1 ⇤ h)[n] then
y[n] = y1 [n]
y1 [n
2] + y1 [n
4]
The convolution
y1 [n]
=
=
then the output is
y[n] =
8
>
>
<
(x ⇤ h)[n]
81
>
> 1 n=0
<
2 n=1
1 n=2
>
>
:
0 otherwise
>
>
:
1
2
2
0
n = 0, 6
n = 1, 5
n=3
otherwise
(b) If x[n] = [n] then the input to the second system is w[n] = h[n] = [n] + [n
hT [n] = g[n] + g[n
For n
1] and
1]
0 the values of g[n] are obtained using the above equation
hT [0]
=
hT [1]
=
hT [2]
=
hT [3]
=
hT [4] =
..
.
g[0] + g[ 1] = g[0] ! g[0] = hT [0] = 1
g[1] + g[0] = g[1] + 1 ! g[1] = hT [1]
1=
g[3] + g[2] = g[3] + 1 ! g[3] = hT [3]
1=0
1 ! g[2] = hT [2] + 1 = 1
g[2] + g[1] = g[2]
g[4] + g[3] = g[4] ! g[4] = hT [4] = 0
..
.
or
g[n] =
8
<
:
1
1
0
n = 0, 2
n=1
otherwise
Copyright 2014, Elsevier, Inc. All rights reserved.
1
Chaparro — Signals and Systems using MATLAB
9.24
9.25
(a) According to the difference equation the output is
y[0]
=
y[ 1] + x[0] = 0 + 1 = 1
y[1]
=
y[0] + x[1] =
y[2]
=
y[1] + x[2] = 0 + 1 = 1
y[3] =
y[4] =
..
.
y[2] + x[3] =
y[3] = 1
1+1=0
1+0=
1
or
y[n]
=
0
y[0]
=
1
n<0
y[1]
=
0
y[n]
=
( 1)n
n
2
(b) By linearity and time-invariance since x1 [n] = x[n] + x[n 3] then
8
y[n] n  2
>
>
<
0
n=3
y1 [n] = y[n] + y[n 3] =
n=4
> 1
>
:
0
n 5
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.25
9.26
(a) y[n] depends on a future value of the input x[n + 1] so the system is non-causal.
(b) This can be done in two equivalent ways:
(i) If x[n] is bounded, i.e., there is a value M such that |x[n]| < M < 1, then
|y[n]| 
1
(|x[n + 1]| + |x[n]| + |x[n
3
1]|) 
3M
=M 1
3
or bounded, so that the system is BIBO stable.
(ii) System is BIBO stable if its impulse response is absolutely summable. If x[n] = [n] then
h[n] =
and
X
n
1
( [n + 1] + [n] + [n
3
1])
|h[n]| = |h[ 1]| + |h[0]| + |h[1]| = 1 < 1
so the system is BIBO stable.
(c) The discrete-time signal is
x[n] = 2 cos(10t)|t=nTsi =
⇢
2 cos(10n)
2 cos(10⇡n)
when using Ts1 = 1
when using Ts2 = ⇡
For Ts1 = 1, the frequency of x[n] is !0 = 10 which cannot be expressed as 2⇡m/N for not
canceling integers m and N , so x[n] is then not periodic.
For Ts2 = ⇡, the frequency of x[n] is
!0 = 10⇡ =
2⇡m
2⇡ ⇥ 5
=
N
1
so that x[n] in that case is periodic of period N = 1.
(d) y[n] is periodic as x[n], x[n + 1] and x[n
of y[n] is then N = 1.
1] are periodic of same period. The fundamental period
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.26
9.27
(a) The discrete frequency of x[n] is !0 = ⇡/2 which can be written as 2⇡m/N0 with m = 1, N0 = 4.
So x[n] is periodic of fundamental period N0 = 4.
(b) Since x[n kN0 ] = x[n] for any integer k and the fundamental period N0 = 4, then taking
N = kN0 we will have that
z[n] = x[n
kN0 ]w[n] = x[n]w[n] = y[n]
so that delaying the input by a multiple of N0 does not change the output. The output in this case
is just the period of x[n] between 0 and 4. However, that is not so if the delay is different from a
multiple of the fundamental period, thus the system is time-varying.
(c) The output corresponding to x1 [n] = x[n]u[n] is
y1 [n] = x1 [n]w[n] = x[n]u[n]w[n] = x[n]w[n] = y[n]
obtained before. However, the output corresponding to x1 [n
x1 [n
4]w[n] = x[n
4]u[n
4] is
4]w[n] = x[0]w[4] = 4 sin(0)w[4] = 0
which is not the previous result shifted, so that the system is time-varying.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.27
(a) If x[n] = [n] then h[n] = [n]
9.28
5]. System is causal and BIBO stable.
[n
(b) x[n] = u[n] = cos(0n)u[n] has infinite energy, and the corresponding output is y[n] = u[n]
u[n 5] having finite energy. Notice the output has a finite support, as when n > 5 then y[n] = 0.
(c) When x[n] = sin(2⇡n/5)u[n], then the output is
y[n]
=
x[n]
x[n
5] = sin(2⇡n/5)u[n]
=
sin(2⇡n/5)(u[n]
u[n
sin(2⇡(n
5)/5)u[n
5]
5])
which again has finite support and y[n] = 0 for n > 5. The energy of the output is finite, while that
of the input is not.
(d) Since x[n] = (ej!0 n e j!0 n )u[n]/2j and the system is causal, linear and time invariant, consider
the response to ej!0 n u[n]. The convolution sum, or response to x1 [n] = ej!0 n u[n]/2j
y1 [n] =
n
X
h[k]ej!0 (n
k)
/(2j)
k=0
given that h[n] = [n]
we have
y1 [n]
=
=
5], or h[0] = 1, h[5] =
[n
n
X
h[k]ej!0 (n
k=0
j!0 n
e
(1
e
k)
j5!0
1 and the other values are zero, for n
/(2j) = ej!0 n (h[0] + h[5]e
j5!0
5
)/(2j)
)/(2j)
which can be made zero by letting 1 e j5!0 = 0 or for frequencies !0 = 2⇡m/5 for m =
0, ±1, ±2, · · · . Similarly when the input is e j!0 n u[n]. Thus for those frequencies the output is
of finite support, i.e., having finite energy. For any other frequencies the output is not zero after
n 5, and it is not guaranteed the finite support or the finite energy.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.28
9.29
(a) We have
i. You can only use (A), as it is causal. Filter (B) requires future inputs (for any negative k the
required input x[n k] are in the future).
ii. You can use either, because causality is not needed, future values as well as present and past
values are available in the tape.
(b) We have
i. The impulse response of the IIR filter is found by solving the difference equation
h1 [n] = [n]
0.5h1 [n
1]
n
0
obtained by letting y1 [n] = h1 [n], x[n] = [n] and initial conditions equal to zero. Recursively
we obtain
h1 [0] = 1
h1 [1] =
0.5h1 [0] =
0.5
h1 [2] =
0.5h1 [1] = ( 0.5)2
···
which gives in general h1 [n] = ( 0.5)n u[n].
The impulse response of the FIR system is obtained by letting x[n] = [n] and y2 [n] = h2 [n]
so that
h2 [n] = [n] + 0.5 [n 1] + 3 [n 2] + [n 5]
ii. The condition for BIBO stability of a LTI system is that its impulse response be absolutely
summable. The given IIR and FIR systems are LTI. The stability condition for the IIR system
is that the following sum converges
1
X
n=0
|h1 [n]| < 1
It can be shown that this sum converges, i.e.,
1
X
n=0
|( 0.5)n | =
1
X
n=0
0.5n =
1
=2
1 0.5
therefore the IIR system is BIBO stable.
For the FIR, the stability condition is satisfied since we are adding a finite number of values.
Indeed,
1
X
|h2 [n]| = 1 + 0.5 + 3 + 1 < 1
n=0
thus the FIR is BIBO stable.
iii. Because of the finite support of the impulse response of an FIR filter it is always absolutely
summable and therefore FIR filters are always BIBO stable.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.1.1
9.30
Problems using MATLAB
9.29 The equation
x[n] = x[n
1] + x[n
3]
n
3
with initial conditions x[0] = 0, x[1] = 1 and x[2] = 2 can be solved recursively for n
n=3
x[3] = x[2] + x[0] = 2
n=4
n=5
..
.
x[4] = x[3] + x[1] = 2 + 1 = 3
x[5] = x[4] + x[2] = 3 + 2 = 5
..
.
The following script obtains the recursive solution for 0  n  49
% Pr 9_29
clear all; clf
x(1)=0; x(2)=1; x(3)=2; % initial conditions
for m=4:50,
x(m)=x(m-1)+x(m-3);
end
n=0:49;
figure(1)
stem(n,x); title(’x[n]’); xlabel(’n’)
grid
7
10
x[n]
x 10
9
8
7
6
5
4
3
2
1
0
0
5
10
15
20
25
n
30
35
40
45
50
Figure 9.5: Problem 29.
Copyright 2014, Elsevier, Inc. All rights reserved.
3 as follows
Chaparro — Signals and Systems using MATLAB
9.31
9.30 (a) The signal is computed and plotted with MATLAB using the following script:
% Pr 9_30
n=0:20;
x=[zeros(1,5) (0.5).ˆn]; N=length(x);
figure(1)
stem([-5 -4 -3 -2 -1 n],x); axis([-5 20 -0.1 1.1])
(b) To check if the signal is finite energy we need to compute the sum
1
X
n=0
|x[n]|2
=
1
X
0.25n
n=0
=
1
1
4
=
0.25
3
Thus, x[n] is a finite energy signal. To show that
1
X
↵n =
n=0
we need to consider first that if |↵|
expression is equivalent to
(1
1
1
|↵| < 1
↵
1 the sum is infinite, so the condition on ↵. Second, that the above
↵)
1
X
n=0
↵n =
1
X
n=0
↵n
1
X
↵n = 1
n=1
The third comment is that ↵ can be complex as long as its magnitude is less than 1.
(c) The following script is used to compute the energy of the signal, numerically and symbolically. These
results coincide with the analytic results obtained in (b)
% energy
% numeric computation
Ex=x(1)ˆ2;
for m=2:N-1;
Ex=Ex+x(m)ˆ2;
end
Ex
% symbolic computation
syms k
symsum(0.5ˆ(2*k),0,Inf)
Ex = 1.3333
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.32
1
0.8
x[n]
0.6
0.4
0.2
0
−5
0
5
10
15
20
n
Figure 9.6: Problem 30: signal x[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.33
9.31 (a) The discrete-time signal is
x[n] = x(nTs ) = cos(3⇡Ts n + ⇡/4) = A cos(!0 n + ⇡/4)
so that its magnitude is A = 1 and its discrete frequency !0 = 3⇡Ts (rad).
(b) Any value for which
2⇡m
3⇡Ts =
N
where m and N are non-divisible positive integers, or
Ts =
2m
3N
would make x(nTs ) periodic of period N . Suppose for instance that we let N = 2 and m = 1, then
Ts = 1/3 would satisfy the condition, giving x[n] = x(nTs ) = cos(3⇡n/3+⇡/4) = cos(2⇡n/2+⇡/4),
of fundamental period N = 2. If Ts = 1/⇡ the frequency of x[n] is
!0 = 3 6=
2⇡m
N
for integers m and N that are not multiples of each other. So x[n] is not periodic.
The following script shows the periodic and non–periodic signals when Ts = 1/3 and Ts = 1/⇡.
% Pr 9_31
clear all;clf
n=0:99;
x1=cos(pi*n+pi/4); % Ts=1/3, periodic of period N=2
x2=cos(3*n+pi/4); % Ts=1/pi, non-periodic
figure(1)
subplot(211)
stem(n,x1);ylabel(’x_1[n]’)
subplot(212)
stem(n,x2);ylabel(’x_2[n]’);xlabel(’n’)
1
x1[n]
0.5
0
−0.5
−1
0
10
20
30
40
50
60
70
80
90
100
0
10
20
30
40
50
n
60
70
80
90
100
1
x2[n]
0.5
0
−0.5
−1
Figure 9.7: Problem 31: periodic signal x1 [n] when Ts = 1/3 (top), non-periodic x2 [n] when Ts = 1/pi
(bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.34
9.32 The discrete-time signal obtained from sampling x(t) using Ts = 0.25 is
⇢
1 0.25n 0  0.25n  1 or 0  n  4
x[n] =
0
otherwise
(a) The reflected signal x[ n] = 1 + 0.25n for 4  n  0 and zero otherwise.
(b) The signal x[n] is neither even nor odd, so its even component is
xe [n] =
which can be written as
1
[x[n] + x[ n]]
2
8
< (1 0.25n)/2
1
xe [n] =
:
(1 + 0.25n)/2
The odd component of x[n] is given by
xo [n] =
which can be written as
1
[x[n]
2
8
< (1 0.25n)/2
0
xo [n] =
:
(1 + 0.25n)/2
1n4
n=0
4n 1
x[ n]]
1n4
n=0
4n 1
The following script displays the different signals given above
% Pr 9_32
n=0:4;
x=1-0.25*n;x=[zeros(1,6) x zeros(1,2)]
n1=[-6:6];
figure(1)
subplot(221)
stem(n1,x);axis([-5 5 0 1.1]); grid
n=-4:0;
x1=fliplr(x);
n1=[-6:6];
subplot(222)
stem(n1,x1);axis([-5 5 0 1.1]);grid
xe=0.5*(x+x1);
subplot(223)
stem(n1,xe);axis([-5 5 0 1.1; grid
xo=0.5*(x-x1);
subplot(224)
stem(n1,xo);axis([-5 5 -0.6 0.6]); grid
Clearly adding the even and the odd components gives x[n].
(c) The energy of the signal x[n] can be written in terms of the energy of the even and the odd components.
Since x[n] = 0 for n < 0 then
4
X
x2 [n]
=
n=0
4
X
x2 [n]
n= 4
=
4
X
[x2e [n] + x2o [n] + 2xe [n]xo [n]]
n= 4
Copyright 2014, Elsevier, Inc. All rights reserved.
9.35
1
1
0.8
0.8
0.6
0.6
x1[n]
x[n]
Chaparro — Signals and Systems using MATLAB
0.4
0.4
0.2
0.2
0
−5
0
0
−5
5
0
5
0
n
5
0.6
1
0.4
0.2
0.6
xo[n]
xe[n]
0.8
0
0.4
−0.2
0.2
−0.4
0
−5
0
n
5
−5
Figure 9.8: Problem 32: from top left clockwise: x[n], x1 [n] = x[ n], xo [n] and xe [n].
the last term is zero, given that the signal xe [n]xo [n] is odd and is being computed over
we have that
"x = "x e + "x o
Copyright 2014, Elsevier, Inc. All rights reserved.
4  n  4. So
Chaparro — Signals and Systems using MATLAB
9.36
9.33 (a) A period of a train of pulses is
x[n] = 0.5(r[n]
2r[n
8
0
>
>
<
r[n] = 0.5n
4]) =
r[n] 2r[n
>
>
:
r[n] 2r[n
2] + r[n
The following MATLAB script will generate x[n] for n
y[n].
n<0
0n2
2] = 0.5(4 n)
2<n4
2] + r[n 4] = 0 n > 4
0 (it is zero before) and the periodic signal
% Pr 9_33
x=zeros(1,5);
for m=1:3,
x(m)=m-1;
end
for m=3:5,
x(m)=4-(m-1)
end
x=x/2;
n=0:4;
figure(1)
subplot(211)
stem(n,x); axis([0 4 -0.1 1.1])
hold on; plot(n,x,’:r’); hold off; title(’x[n]’)
%x=[0 0.5 1 0.5 0] % another way to get the first period
y=[x x x x];
% four periods of y
N=length(y); n=0:N-1;
subplot(212)
stem(n,y); axis([0 N-1 -0.1 1.1])
hold on; plot(n,y,’:r’); hold off; title(’y[n]’); xlabel(’n’)
x[n]
1
0.8
0.6
0.4
0.2
0
0
0.5
1
1.5
2
2.5
3
12
14
3.5
4
y[n]
1
0.8
0.6
0.4
0.2
0
0
2
4
6
8
10
16
18
n
Figure 9.9: Problem 33: One period, 4 periods of y[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.37
9.34 (a) For x[n] = cos(2⇡n/7) the down-sampled by 2 signal is
z[n] = x[2n] = cos
✓
2⇡
2n
7
◆
both of which have the same period, N = 7, but the frequency of z[n] = x[2n], 4⇡/7, is twice that of
x[n]. Thus the signal x[2n] is x[n] compressed in time, but expanded in frequency. The following script
is used to compute and plot x[n] and z[n].
% Pr 9_34
% downsampling
n=0:49;
x=cos(2*pi*n/7);
z=cos(4*pi*n/7);
figure(1)
subplot(211)
stem(n,x);hold on
plot(n,x,’:r’);hold off;ylabel(’x[n]’)
subplot(212)
stem(n,z);hold on
plot(n,z,’:r’);hold off;ylabel(’z[n]’);xlabel(’n’)
(b) The up–sampling by 2 gives a signal y[n] = x[n/2] = cos(2⇡n/14) for n even (so that n/2 is an
integer), zero otherwise. It seems there is a frequency compression (for even n the frequency is half that
of the original) so that there should be a time expansion in y[n] when compared with x[n]. The following
script computes and plots x[n] and y[n]
% upsampling
y=zeros(1,50);
for m=0:2:49,
y(m+1)=x(m+1);
end
figure(2)
subplot(211)
stem(n,x);hold on
plot(n,x,’:r’);hold off;ylabel(’x[n]’)
subplot(212)
stem(n,y);hold on
plot(n,y,’:r’);hold off;ylabel(’y[n]’);xlabel(’n’)
(c) Sampling x(t) = cos(2⇡t) using a sampling period Ts gives x[n] = cos(2⇡Ts n) so that Ts = 1/7.
To get z[n] from x(t) we double the sampling period, i.e.,
z[n] = x(t)|t=2nTs = cos
✓
2⇡
2n
7
◆
The upsampled signal, however, cannot be obtained by decreasing the sampling period as it would give
samples where the zeros are. In this case, the resulting signal is the interpolated signal that can be shown
to result from low-pass filtering the up-sampled signal.
Copyright 2014, Elsevier, Inc. All rights reserved.
9.38
1
1
0.5
0.5
x[n]
x[n]
Chaparro — Signals and Systems using MATLAB
0
−0.5
0
5
10
15
20
25
30
35
40
45
−1
50
1
1
0.5
0.5
y[n]
z[n]
−1
0
−0.5
0
−0.5
−1
0
5
10
15
20
25
30
35
40
45
50
0
5
10
15
20
25
n
30
35
40
45
50
0
−0.5
0
5
10
15
20
25
n
30
35
40
45
50
−1
Figure 9.10: Problem 34: x[n] and z[n] (left); x[n] and y[n] (right).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.39
9.35 (a) The sampled signal is given by
x(nTs ) = x[n] = e
2n
2 n
u[n] = (e
) u[n]
which indicates that ↵ = 1/e2 < 1. The following MATLAB script is used to compute and plot x[n]
using the exponential and using ↵.
% Pr 9_35
Ts=1;t=0:Ts:9;
x=exp(-2*t); alpha=exp(-2);
n=0:length(t)-1; x1=alpha.ˆn;
figure(1)
subplot(211)
plot(t,x,’r’); hold on; stem(t,x)
hold off; ylabel(’x(nTs)’);grid
subplot(212)
plot(t,x,’r’); hold on; stem(n,x1)
hold off; ylabel(’x[n]’); xlabel(’n’); grid
(b) The sum
1
X
|↵|n =
0
1
2
3
4
0
1
2
3
4
n=0
1
|↵| < 1
|↵|
1
or e2 /(e2 1) is finite, so x[n] is absolutely summable.
(c) Given that ↵n > ↵2n , because ↵ < 1, we then have that if x[n] is absolutely summable it is finite
energy. Indeed,
1
X
1
e4
(↵2 )n =
=
<1
1 ↵2
e4 1
n=0
so the signal x[n] is finite energy.
1
x(nTs)
0.8
0.6
0.4
0.2
0
5
6
7
8
9
5
6
7
8
9
1
x[n]
0.8
0.6
0.4
0.2
0
n
Figure 9.11: Problem 35: x(nTs ) and x[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.40
9.36 (a) The condition is that
N1
K
=
N2
M
for non-divisible integers M and K, i.e., that this ratio be a rational number. Thus, M N1 = KN2 = N0
is the period of x[n] + y[n].
(b) The product z[n] = x[n]y[n] is periodic of period N0 , indeed
z[n + N0 ] = x[n + N0 ]y[n + N0 ] = x[n + M N1 ]y[n + KN2 ] = x[n]y[n].
(c) The ratio of the periods can be written in the gcd (greatest common factor) form as
N1
K gcd[N 1, N 2]
=
N2
M gcd[N 1, N 2]
where the integers K and M are not divisible by each other. In the given formula if we replace N1 =
K gcd[N 1, N 2] we obtain
K gcd[N 1, N 2]N2
= KN2
gcd[N 1, N 2]
which equals N0 , the period of the sum. Likewise if we replace N2 = M gcd[N 1, N 2] we obtain M N1
which is also N0 . The given formula gives the same period as the one obtained using the ratio of the
periods.
Indeed, if x[n] is periodic of period N1 = 3 and y[n] of period N2 = 2, the gcd[2, 3] = 1 so that
N0 = (3 ⇥ 2)/1 = 6
Likewise, N1 /N2 = 3/2 where 3 and 2 are not divisible by each other, so that N0 = 2N1 = 3N2 = 6.
When x[n] is periodic of period N1 = 4 and y[n] is periodic of period 12, the gcd[4, 12] = 4, the largest
divider of 4 and 12. The period is then
N0 =
Likewise,
4 ⇥ 12
= 12.
4
N1
4
1
K
=
= =
N2
12
3
M
so that N0 = 3 ⇥ 4 = 12 ⇥ 1 = 12.
(d) The following script generates the signals x[n] and y[n] of periods N1 = 3 and N2 = 7, and their sum
and products z[n] and v[n] which using the given formula are shown to be periodic of period N0 = 21.
% Pr 9_36
clear all; clf
n=0:49;N1=3;N2=7;
x=cos(2*pi*n/N1);y=1+sin(6*pi*n/N2);
z=x+y;
v=x.*y;
P=gcd(N1,N2);
N0=N1*N2/P
figure(1)
subplot(211)
stem(n,z); ylabel(’z[n]=x[n]+y[n]’);grid;xlabel(’n’)
subplot(212)
stem(n,v); ylabel(’v[n]=x[n]y[n]’);grid;xlabel(’n’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.41
z[n]=x[n]+y[n]
3
2
1
0
−1
0
5
10
15
20
25
n
30
35
40
45
50
0
5
10
15
20
25
n
30
35
40
45
50
2
v[n]=x[n]y[n]
1.5
1
0.5
0
−0.5
−1
Figure 9.12: Problem 36: z[n] = x[n] + y[n] and v[n] = x[n]y[n] periodic of fundamental period N0 = 21.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.42
9.37 (a) The delays are found as the times it would take the signal to travel 2Ri , i = 1, 2, where Ri are the
radii of the two circles in the theater. Thus
Ti =
2Ri
343
thus
T1 = 2 ⇥ 17.15/343 = 0.10 sec
T2 = 2 ⇥ 34.30/343 = 0.20 sec
With a sampling period Ts this translates into N1 = T1 /Ts = 0.10/Ts samples and N2 = T2 /Ts =
0.20/Ts . The sampling frequency for handel is Fs = 8, 192 samples/second, so N1 = d0.1Fs e and
N2 = d0.2Fs e samples, where d⇢e is the integer larger than ⇢ and which in MATLAB is implemented
by the function ceil.
%% Pr 9_37
clear all; clf
load handel
N=ceil(Fs*1.5)
y1=y(1:N)’;
N1=ceil(0.1*Fs)
N2=ceil(0.2*Fs)
r=y(1:N)’+[zeros(1,N1) y(1:N-N1)’]+[zeros(1,N2) y(1:N-N2)’];
n=0:N-1;
figure(1)
subplot(211)
plot(n,y1);axis([0 N-1 -2 2]);grid
subplot(212)
plot(n,r);axis([0 N-1 -2 2]);grid
y[n]
2
1
0
−1
−2
0
2000
4000
6000
8000
10000
12000
8000
10000
12000
r[n]
2
1
0
−1
−2
0
2000
4000
6000
Figure 9.13: Problem 37: Original handel signal y[n] and echoed signal r[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.43
9.38 (a) If the duration of e(t) is Te = 300Ts and for 100 cycles of the sinusoid 100T0 then T0 = Te /100 =
3Ts .
(b) If we let t = nTs , then the sampled envelope is
e(nTs )
=
=
(1/3)(r(nTs ) r((n 30)Ts )) (1/10)(r((n
8
0  nTs  30Ts
< nTs /3
10Ts
30Ts  nTs  200Ts
:
3 nTs /10 200Ts  nTs  300Ts
200)Ts
r((n
300)Ts )
The following script generates the window e[n] and the modulated signal y[n] = e[n]x[n]
% Pr 9_38
clear all;clf
Ts=0.1;
t1=0:Ts:3;
t2=20:Ts:30;
e=[t1/3 ones(1,200-30) 3-t2/10]
t=0:Ts:30+Ts;
figure(1)
plot(t,e,’r’);grid
n=0:length(e)-1;
x=cos(2*pi*n/3);
hold on
plot(t,x.*e,’b’)
hold off; axis([0 30 -1.2 1.2]);
xlabel(’nT_s’);ylabel(’x(nT_s)e(nT_s)’)
1
0.8
0.6
x(nTs)e(nTs)
0.4
0.2
0
−0.2
−0.4
−0.6
−0.8
−1
0
5
10
15
nTs
20
25
30
Figure 9.14: Problem 38: window e(nTs ) and modulated cosine y(n) = x(nTs )e(nTs ) for Ts = 0.1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.44
9.39 (a) The sampler is linear: if xi (t), i = 1, 2, are the inputs then xi (nTs ), i = 1, 2 are the outputs.
When the input is ax1 (t) + bx2 (t), a combination of the previous two inputs, then the output will be
ax1 (nTs ) + bx2 (nTs ) or the combination of the previous outputs.
(b) For Ts = 1, the sampling of x(t) = cos(0.5⇡t)u(t) gives the signal
y(nTs ) = cos(0.5⇡n)u[n]
while for Ts = 1 the sampling of x(t
0.5) = cos(0.5⇡(t
z(nTs ) = cos(0.5⇡(n
0.5) gives
0.5))u(t
0.5))u(n
0.5)
Let us compare the first five values
y(0) = 1
z(0) = 0
y(1) = 0
y(2) =
z(1) = cos(0.25⇡) = 0.707
1
z(2) = cos(0.75⇡) =
0.707
y(3) = 0
z(3) = cos(1.25⇡) =
0.707
y(4) = 1
..
.
z(4) = cos(1.75⇡) = 0.707
showing clearly that z(nTs ) is not y(nTs ) shifted. Thus the sampler is time-varying. Notice that if we
sample the analog signal shifted by exactly one or more sampling periods, the output signal is a shifted
version of the originally sampled signal. But if the shift is not a multiple of the sampling period, it is not.
To verify that the sampler is not TI we use the following script to plot y[n] and z[n] for 0  n  49. See
Fig. 9.15
% Pr 9_39
clear all;clf
n=0:49;
y=cos(0.5*pi*n);
n1=1:49;
z=[0 cos(0.5*pi*(n1-0.5))];
figure(1)
subplot(211)
stem(n,y); ylabel(’y[n]’)
subplot(212)
stem(n,z); ylabel(’z[n]’); xlabel(’n’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.45
1
y[n]
0.5
0
−0.5
−1
0
5
10
15
20
25
30
35
40
45
50
0
5
10
15
20
25
n
30
35
40
45
50
1
z[n]
0.5
0
−0.5
−1
Figure 9.15: Problem 39: z[n] (bottom) is not shifted version of y[n] (top)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.46
9.40 (a) If w[n] = u[n] u[n N ] is the rectangular window, windowing the signal x[n] gives y[n] =
x[n]w[n]. If we have the following input/output pairs
x1 [n]
x2 [n]
then
ax1 [n] + bx2 [n]
thus the windowing process is linear.
)
)
y1 [n] = w[n]x1 [n]
y2 [n] = w[n]x2 [n]
w[n][ax1 [n] + bx2 [n]] = ay1 [n] + by2 [n]
)
(b)-(c) However, windowing it is not time invariant. If we window x[n] = nu[n] using a rectangular
window w[n] = u[n] u[n 6] results in y[n] = n(u[n] u[n 6]). If we shift x[n] by 6 to get
x[n 6] = [n 6]u[n 6] (which is zero for 0  n  5) then x[n 6]w[n] is zero for all n and not
equal to y[n 6] which is what we should get if windowing was time-invariant. The following script
displays this.
% Pr 9_40
clear all; clf
w=[ones(1,6) zeros(1,20-6)];
n=0:19;
x=n;
x1=[zeros(1,6) x(1:20-6)];
figure(1)
subplot(211)
stem(n,w.*x);axis([0 19 0 5]);grid
subplot(212)
stem(w.*x1);axis([0 19 0 5]);grid
x[n]w[n]
5
4
3
2
1
0
0
2
4
6
8
10
12
14
16
18
12
14
16
18
x[n−6]w[n]
5
4
3
2
1
0
0
2
4
6
8
10
Figure 9.16: Problem 40: windowed signals x[n]w[n] and x[n
Copyright 2014, Elsevier, Inc. All rights reserved.
6]w[n].
Chaparro — Signals and Systems using MATLAB
9.47
9.41 (a) The impulse response can be found by solving the difference equation recursively, i.e., letting the
output be y[n] = h[n] and the input be x[n] = [n] and assuming zero initial conditions, i.e., h[n] = 0
for n < 0. We have then
h[n] = 0.15h[n 2] + [n]
which for n
0 gives
h[0] = 0.15h[ 2] + 1 = 1
h[1] = 0.15h[ 1] + 0 = 0
h[2] = 0.15h[0] + 0 = 0.15
h[3] = 0.15h[1] + 0 = 0
h[4] = 0.15h[2] + 0 = 0.152
h[5] = 0.15h[3] + 0 = 0
..
.
or
h[n] =
⇢
0.15n/2
0
for n 0 and even
otherwise
(b) Letting the initial conditions be zero, the input x[n] = [n] and y[n] = h[n] we have
h[n] = 0.15h[n
replacing h[n 2] = 0.15h[n
get
h[n] = 0.15(0.15h[n
and again replacing h[n
h[n]
4] + [n
2] according to the equation for the difference equation, we
4] + [n
2]) + [n] = 0.152 h[n
4] = 0.15h[n
=
=
2] + [n]
3
0.15 h[n
2] + [n]
4] we have
6] + [n
0.152 (0.15h[n
4] + 0.15 [n
6] + [n
4]) + 0.15 [n
2
4] + 0.15 [n
6] + 0.15 [n
2] + [n]
2] + [n]
Repeating this process we realize that after more iterations we get that,
h[n] = [n] + 0.15 [n
2] + 0.152 [n
4] + 0.153 [n
6] + · · ·
which is the same result as in the previous part.
(c) The following script using filter computes and plots h[n]
% Pr 9_41
clear all;clf
a=[1 0 -0.15];
b=1;
x=[1 zeros(1,29)];
h=filter(b,a,x);
n=0:29;
figure(1)
stem(n,h); axis([0 29 0 1]); grid;ylabel(’h[n]’); xlabel(’n’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.48
1
0.8
h[n]
0.6
0.4
0.2
0
0
5
10
15
20
25
n
Figure 9.17: Problem 41: impulse response h[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.49
9.42 (a) Letting x[n] = [n] the impulse response of the filter is
h[n]
=
=
0 [n] + [n
5
X
k [n
1] + 2 [n
2] + 3 [n
3] + 4 [n
4] + 5 [n
5]
k]
k=1
% Pr 9_42
% impulse response
clear all; clf
b=[0 1 2 3 4 5];
a=1;
x=[1 zeros(1,100)];
h=filter(b,a,x);
n=0:19;
figure(1)
subplot(211)
stem(n,h(1:20)); ylabel(’h[n]’)
The filter is causal since the output depends only on previous values of the input, and besides h[n] = 0
for n < 0. The system is BIBO stable since the sum of the values of |h[n]| is finite.
(b) Letting the input be x[n] = u[n] then the unit-step response is
s[n] =
5
X
ku[n
k] = u[n
1] + 2u[n
2] + 3u[n
3] + 4u[n
4] + 5u[n
5]
k=1
The values of s[n] increase from 0 to 15 (sum of the amplitudes of the delayed unit-step signals) and
remain there (steady state) as shown by the following script
% unit step response
x=ones(1,100);
s=filter(b,a,x);
n=0:19;
subplot(212)
stem(n,s(1:20));ylabel(’s[n]’); xlabel(’n’)
(c) If the input x[n] for the filter is bounded so that |x[n]| < 3, for the output
|y[n]| 
5
X
k=0
k|x[k]| < 3
5
X
k=0
k = 3 ⇥ 15 = 45
i.e., the bound M = 45.
(d) See the above scripts.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.50
5
h[n]
4
3
2
1
0
0
2
4
6
8
10
12
14
16
18
20
0
2
4
6
8
10
n
12
14
16
18
20
15
s[n]
10
5
0
Figure 9.18: Problem 42: Impulse response h[n] and unit-step response s[n] of FIR filter.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.51
9.43 (a) Using the superposition property of LTI systems and that h[n] is the response to [n] gives
y[n]
=
=
2] = ( 0.5)n u[n] + ( 0.5)n
h[n] + h[n 1] + h[n
8
1
n=0
>
>
<
0.5
n=1
0.75
n=2
>
>
:
3( 0.5)n n 3
1
u[n
1] + ( 0.5)n
2
u[n
2]
as the output for the given input x[n].
(b) The convolution sum is given by
y[n]
=
=
=
=
1
X
k= 1
1
X
k= 1
1
X
k= 1
x[k]h[n
k]
( [k] + [k
[k]h[n
h[n] + h[n
1] + [k
k] +
1
X
k= 1
1] + h[n
2]
2])h[n
[k
1]h[n
k]
k] +
1
X
[k
2]h[n
k]
k= 1
since the multiplication by the delta functions gives zero except when their arguments are zero, or k = 0,
k = 1 and k = 2. This result coincides with the one in part (a).
(c) The following script is used to compute the convolution sum of the given x[n] and h[n]:
% Pr 9_43
clear all; clf
x=[1 1 1 zeros(1,98)];
n=0:100;
h=(-0.5).ˆn;
y=conv(h,x);
n1=0:20;
figure(1)
subplot(311)
stem(n1,x(1:21)); ylabel(’x[n]’);grid
subplot(312)
stem(n1,h(1:21)); ylabel(’h[n]’);grid
subplot(313)
stem(n1,y(1:21)); ylabel(’y[n]’);grid;xlabel(’n’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.52
x[n]
1
0.5
0
0
2
4
6
8
10
12
14
16
18
20
0
2
4
6
8
10
12
14
16
18
20
0
2
4
6
8
10
n
12
14
16
18
20
h[n]
1
0.5
0
−0.5
y[n]
1
0.5
0
−0.5
Figure 9.19: Problem 43: Input x[n], impulse response h[n] and convolution sum y[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.53
9.44 (a) If the steady state exists then y[n] = y[n 1] = 2 as n ! 1, and since x[n] = 1 for n
value of a should be according to the difference equation
1, the
2 = 2a + 1 or a = 0.5
(b) Using causality, h[n] = 0 for n < 0, and that the input is x[n] = u[n], the initial condition is
zero, y[ 1] = 0 and a = 0.5, as found above, we have according to the result from linearity and
time-invariance and the difference equation:
y[0]
y[1]
y[2]
=
h[0]
=
0.5y[ 1] + 1 = 1
=
h[1] + h[0]
=
0.5y[0] + 1 = 0.5 + 1
=
h[2] + h[1] + h[0]
=
0.5y[1] + 1 = 0.5(0.5 + 1) + 1
···
solving for the impulse response values from the above equations gives:
h[0]
=
1
h[1]
=
(1 + .5)
h[2]
=
..
.
1 + 0.5 + 0.52
h[0] = 0.5
h[1]
h[0] = 0.52
indicating that the impulse response is h[n] = 0.5n u[n].
(c) The following script computes and plots the impulse response h[n] using filter
% Pr 9_44
clear all;clf
a=[1 -0.5]
b=1;
x=[1 zeros(1,100)];
h=filter(b,a,x);
n=0:100;
figure(1)
stem(n,h)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.54
1
0.9
0.8
0.7
h[n]
0.6
0.5
0.4
0.3
0.2
0.1
0
0
2
4
6
8
10
n
12
14
16
18
20
Figure 9.20: Problem 44: impulse response h[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.55
9.45 (a) For a LTI system, if s[n] is the response to u[n], then the response to [n] = u[n]
h[n] = s[n] s[n 1], i.e., the impulse response of the system. So we have that
h[n]
=
=
s[n]
⇢
0
1] = (2(0.5)n
n0
2(0.5)n n 1
s[n
2)u[n]
(2(0.5)n
1
2)u[n
u[n
1] is
1]
(b) The ramp in terms of the unit-step signal is given as
r[n] =
1
X
u[n
k]
k=0
so that the response of the system to a ramp is
⇢[n]
=
=
1
X
k=0
1
X
s[n
k]
2[( 0.5)n
k
1]u[n
k]
k=0
which tends to infinity as n ! 1. A close form of the ramp response is difficult to obtain, so we use
MATLAB to compute it at each sample and to plot it.
% Pr 9_45
% --- ramp response using filter
n=1:100;
h=[0 -2*(0.5).ˆn];
x=n;
rho=conv(h,x);
n1=0:49;
figure(1)
subplot(211)
stem(n1,rho(1:50));axis([0 49 -101 1]);grid
% --- ramp response using superposition
rho1=2*((0.5).ˆ(n-1)-1);
for k=1:49,
nk=1:100-k;
rho1=rho1+[zeros(1,k) 2*((0.5).ˆ(nk-1)-1)];
end
subplot(212)
stem(n1,rho1(1:50));axis([0 49 -101 1]);grid
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.56
0
−20
−40
−60
−80
−100
0
5
10
15
20
25
30
35
40
45
5
10
15
20
25
30
35
40
45
0
−20
−40
−60
−80
−100
0
Figure 9.21: Problem 45: ⇢[n] computed using filter (top) and using superposition (bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.57
9.46 (a) The input can be written as
x[n] =
3
X
[n
k]
h[n
k]
k=0
so the system response is
y[n] =
3
X
k=0
(b) If h[n] = 0.5n u[n] then
y[n]
3
X
=
0.5n
k
u[n
n
X
n 1
0.5 u[n] + 0.5
u[n
1] + 0.5n
n
=
0.5m u[m]
m=n 3
k=0
n
=
k] =
2
2] + 0.5n
u[n
2
3
0.5 (u[n] + 2u[n 1] + 2 u[n 2] + 2 u[n
8
1
n=0
>
>
<
0.5(1 + 2) = 3/2
n=1
0.25(1
+
2
+
4)
=
7/4
n=2
>
>
:
0.5n (1 + 2 + 4 + 8) = 15 ⇥ 0.5n n 3
=
3
(c) Consider the input to be x1 [n] = u[n], the convolution sum would be for n
y1 [n]
1
X
=
=
h[n
k= 1
n
X
n
k
k]x1 [k] = 0.5n
k=0
0.5
3]
k
u[n
0
k]u[k]
k= 1
2 = 0.5n
0.5
1
X
u[n
3])
1
2(n+1)
= 0.5n (2n+1
1 2
1)
and zero otherwise. So that
8
0
>
>
>
>
1
>
>
>
< 0.5 ⇥ 3 = 3/2
y1 [n] =
0.52 ⇥ 7 = 7/4
>
>
>
0.53 ⇥ 15 = 15/8
>
>
>
>
: ..
.
then the output due to x[n] = u[n]
y[n]
=
=
u[n
n<0
n=0
n=1
n=2
n=3
..
.
4] is by superposition
0.5n (2n+1 1)u[n] 0.5n 4 (2n+1 4 1)u[n 4]
8
< 0
0.5n (2n+1 1)
:
0.5n (2n+1 1) 0.5n 4 (2n 3 1) = 0.5n (15)
n<0
0n3
n 4
which coincides with the result obtained above. The following script computes and plots the different
signals in this problem, its result coincides with the ones above.
% Pr 9_46
clear all; clf
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.58
x=[1 1 1 1 zeros(1,96)];
n=0:99; h=(0.5).ˆn;
y=conv(x,h);
figure(1)
subplot(311)
stem(n(1:10),x(1:10)); title(’x[n]’)
subplot(312)
stem(n(1:10),h(1:10)); title(’h[n]’)
subplot(313)
stem(n(1:10),y(1:10)); title(’y[n]’); xlabel(’n’)
x[n]
1
0.5
0
0
1
2
3
4
5
6
7
8
9
5
6
7
8
9
5
6
7
8
9
h[n]
1
0.5
0
0
1
2
3
4
y[n]
2
1
0
0
1
2
3
4
n
Figure 9.22: Problem 46: input x[n], impulse response h[n] and response y[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.59
9.47 (a)–(c) The following script simulates the envelop detector:
% Pr 9_47
Ts=0.01;
t=0:0.01:100-0.01; N=length(t)
p=[ones(1,2000) zeros(1,2000) ones(1,2000) zeros(1,N-6000)];
P=1.1*abs(min(p))
x1=(p+P).*cos(20*pi*t);
figure(1)
subplot(221)
plot(t,p); ylabel(’p(nT_s)’); axis([0 max(t) -0.1 1.1]); title(’pulses’)
subplot(222)
plot(t,x1); ylabel(’x(nT_s)’); axis([0 max(t) -1.1 1.1]); title(’AM pulses’)
y=abs(x1);
subplot(223)
plot(t,y); ylabel(’y(nT_s)’); axis([0 max(t) -0.1 1.1]); title(’ absolute value’)
b=(1/(15*0.65))*ones(1,15);a=1;
z1=filter(b,a,y); z1=z1-P;
subplot(224)
plot(t,z1); ylabel(’z(nT_s)’); axis([0 max(t) -0.1 1.1]); title(’recovered signal’)
AM pulses
1
0.8
0.5
0.6
x(nTs)
p(nTs)
pulses
1
0.4
0
−0.5
0.2
0
−1
0
20
40
60
80
0
20
40
60
80
recovered signal
1
1
0.8
0.8
0.6
0.6
z(nTs)
y(nTs)
absolute value
0.4
0.2
0.4
0.2
0
0
0
20
40
60
80
0
20
40
60
80
Figure 9.23: Problem 47: envelope detection for pulses.
(d) Considering x2 (nTs ) the input of the envelop detector, the following script illustrates that the system
is non-linear. Letting z2 (nTs ) be the output corresponding to x2 (nTs ), the output z3 (nTs ) corresponding
to 2x2 (nTs ) is shown to be different from 2z2 (nTs ), thus the system is nonlinear.
Ts=0.01;
t=0:0.01:100-0.01; N=length(t)
p=2*cos(0.2*pi*t);
P=1.1*abs(min(p))
x2=(p+P).*cos(20*pi*t);
figure(2)
subplot(221)
plot(t,p); ylabel(’p(nT_s)’); title(’sinusoidal input’)
subplot(222)
plot(t,x2); ylabel(’x_2(nT_s)’); title(’AM signal’)
y=abs(x2);
subplot(223)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
9.60
plot(t,y); ylabel(’y_2(nT_s)’); title(’absolute value’)
z2=filter(b,a,y);z2=z2-P;
subplot(224)
plot(t,z2); ylabel(’z_2(nT_s)’); title(’recovered signal’)
% double the input
x3=2*x2;
figure(3)
subplot(221)
plot(t,x3); ylabel(’x_3(nT_s)’); title(’ AM signal’)
y=abs(x3);
subplot(222)
plot(t,y); ylabel(’y_3(nT_s)’); title(’absolute value’)
z3=filter(b,a,y);z3=z3-P;
subplot(223)
plot(t,z3); ylabel(’z_3(nT_s)’) ; title( ’output for 2x_2’)
subplot(224)
plot(t,2*z2); ylabel(’2z_2(nT_s)’); title(’ 2 times output of x2’)
sinusoidal input
2
AM signal
5
0
−1
20
40
60
80
−5
100
absolute value
0
20
40
60
80
100
−10
4
2
3
0
4
z3(nTs)
6
−1
−2
0
20
40
60
80
100
−3
40
60
80
20
40
60
80
100
20
40
60
80
100
2 times output of x2
2
2
−2
0
4
0
0
0
100
output for 2x2
8
1
1
20
recovered signal
4
2
2
0
2z2(nTs)
0
z2(nTs)
y2(nTs)
6
−5
5
0
8
y3(nTs)
x3(nTs)
x2(nTs)
p(nTs)
0
absolute value
10
5
0
−2
AM signal
10
1
0
−2
−4
0
20
40
60
80
100
−6
0
20
40
Figure 9.24: Problem 47: Example verifying non–linearity of system.
Copyright 2014, Elsevier, Inc. All rights reserved.
60
80
100
Chapter 10
The Z–transform
10.1
Basic Problems
10.1 (a) For Ts = 1 the transformation from the s-plane to the Z–plane z = es is such that for s =
+ j⌦
z = e ej⌦
For s =
given by
1 ± j1, the poles of the analog system, the corresponding singularities in the Z–plane are
z12 = e
which are inside the unit disk as e
1
1 ±j 1
e
< 1 with a radian frequency of ±1.
The pole s = 0 is mapped into z = e0 = 1, and the poles s = ±j1 are mapped into z = 1e±j1 with
unit magnitude and radian frequencies ±1.
(b) By expressing z = rej! = e ej⌦ for Ts = 1, the radius is given by r = e so that if
singularities are inside the unit circle, if
= 0 they are on the unit circle, and if
the unit circle.
1
< 0 the
> 0 they are outside
Chaparro — Signals and Systems using MATLAB
10.2 (a) We have s[n] = u[n]
10.2
u[ n], the Z-transform of s1 [n] = u[n] is
S1 (z) =
1
X
z
n
=
n=0
provided that |z
s2 [n] =
1
1
1 z
1
| < 1, thus |z| > 1 is the region of convergence for S1 (z). The Z-transform of
u[ n] is given by
S2 (z) =
0
X
z
n
n= 1
=
1
X
zm =
m=0
1
1
z
where the last sum converges for |z| < 1.
(b) The condition for
S(z) = S1 (z) + S2 (z) =
1
1 z
1
1
1
z
=
1+z
1 z
1
1
to converge is that |z| > 1 and that |z| < 1 simultaneously, which is not possible. Since there is no
region of convergence for S(z), the Z-transform of s[n] does not exist.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.3
10.3 (a) The signal x[n] can be written as
x[n]
=
[n]
=
[n]
↵ 1 [n + 1] ↵ 2 [n + 2] · · ·
1
1
[n + 1]
[n + 2] · · ·
↵
↵2
So that its Z-transform is given by
X(z)
=
=
z
z2
···
↵ ↵2
1 ⇣ ⌘n
X
z
1
↵z 1
=
=
↵
1 z/↵
1 ↵z
n=0
1
|z| < |↵|
1
If ↵ = 0.5, the ROC is the interior of a circle of radius 0.5, which does not include the unit circle. The
ROC in this case indicates that the signal is non-causal. If ↵ = 2, the ROC is the interior of a circle
of radius 2, including the unit circle, and indicating the signal is non-causal. In this case X(ej! ) is
defined, but it is not when ↵ = 0.5.
(b) Computing the derivative of X(z) with respect to z gives
d X(z)
dz
=
=
1
↵
2z
↵2
1
X
3z 2
··· =
↵3
m↵m z
1
X
zn 1
n n
↵
n=1
(m+1)
m= 1
by letting m =
n in the last sum. Letting now k = m + 1 in the final sum we have
0
X
d X(z)
=
(k
dz
1)↵(k
1)
z
k
k= 1
We thus have the pair
d X(z)
, (n 1)↵(n 1) u[ n].
dz
Writing X(z) in positive powers of z, i.e., X(z) = ↵/(z ↵) its derivative with respect to z is
d X(z)
=
dz
(z
so that we have
(z
↵
↵z
=
2
↵)
(1 ↵z
↵
↵)2
2
1 )2
,
(n
1)↵(n
1)
u[ n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.4
10.4 (a) If Ts = 0.1 the discrete-time signal is
x(0.1n) = [u(t)
u(t
1)] |t=0.1n =
(
1
0
0  0.1n  1 or 0  n  10
otherwise
(b) Expressing x[n] as indicated, then N = 11.
The Laplace transform of the sampled signal is
Xs (s) =
10
X
n=0
L[ (t
nTs ) =
10
X
e
0.1ns
=
n=0
1
1
e
e
1.1s
0.1s
(c) The z-transform of the discrete-time signal is
X(z) =
10
X
n=0
z
n
=
1
1
z
z
11
1
To transform Xs (s) into X(z) we let z = e0.1s .
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.5
10.5 (a)(b) The given signal can also be written
x[n] =
(
1
0 and even
n
otherwise
0
Using the above expression for x[n], we have
X(z) =
1
X
n=0,
even
1z
n
1
X
=
2m
1z
=
m=0
1
1
z
2
|z| > 1
where we let n = 2m to find the final expression.
The z-transform of x[n] is also obtained by using its linearity
X(z)
=
=
=
=
0.5Z[u[n]] + 0.5Z[( 1)n u[n]]
1
X
1
+
0.5
( z 1 )n
2(1 z 1 )
n=0
1
2(1
z
1
1 z
1)
2
+
1
2(1 + z
|z
1
1)
| < 1 or |z| > 1
(c) To find the poles and zeros expressing X(z) in positive powers:
X(z) =
z2
z2
1
the poles are z = ±1, and the zeros z = 0, double.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.6
10.6 (a) The Z-transform of the difference equation
y[n] = x[n]
0.5y[n
Y (z) = X(z)
0.5(z
1]
n
0
with initial condition y[ 1] is
so that
Y (z) =
X(z)
1 + 0.5z
1
Y (z) + y[ 1])
0.5y[ 1]
1 + 0.5z 1
1
(b) From the expression for Y (z), if X(z) = 1, y[ 1] = 2 then Y (z) = 0 and therefore y[n] = 0 for
n
0 but y[ 1] = 2.
If X(z) = 1 or x[n] = [n] and y[ 1] = 2 the difference equation is
y[n] = [n]
0.5y[n
1]
n
0
and can be solved recursively
y[0]
=
1
0.5 ⇥ 2 = 0
y[1]
=
0
0.5 ⇥ 0 = 0
y[2]
..
.
=
0
0.5 ⇥ 0 = 0
(c) If y[ 1] = 0 and x[n] = [n] then we can compute y[n] = h[n], i.e., the impulse response. The
corresponding transfer function is then from the equation for Y (z):
H(z) = Z[h[n]] =
If we want y[n] = [n] + 0.5 [n
X(z) =
which gives x[n] = [n] + [n
Y (z)
1
=
X(z)
1 + 0.5z
1] or Y (z) = 1 + 0.5z
Y (z)
= (1 + 0.5z
H(z)
1] + 0.25 (n
1 2
1
1
then
) =1+z
1
+ 0.25z
2).
Copyright 2014, Elsevier, Inc. All rights reserved.
2
Chaparro — Signals and Systems using MATLAB
10.7
10.7 (a) Writing X(z) as
X(z) =
1
1 z
z
1
1
10
z
1
since the inverse Z-transform of the first term is u[n], then the inverse of the second is
that z
10
u[n
10] given
indicates a delay of 10 samples. Thus,
x[n] = u[n]
u[n
10] =
(
1
0
0n9
otherwise
(b) Although X(z) has been shown as a ratio of two polynomials, using the above representation of
x[n] its Z-transform is
X(z) = 1 + z
i.e., a 9th –order polynomial in z
1
1
+ ··· + z
9
.
(c) We can rewrite X(z) as
z 10
X(z) = 9
z (z
(z
1
=
1)
1)
Q9
k=1 (z
z 9 (z 1)
ej⇡k/5 )
=
Q9
ej⇡k/5 )
k=1 (z
z9
which is obtained by finding that the zeros of X(z) are values zk10 = 1 or zk = ej2⇡k/10 for k =
0, · · · , 9. For k = 0 the zero is z0 = 1, which cancels the pole at 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.8
10.8 (a) If we let the input be zero, the z-transfom of y[n] is
Y (z) = 0.25z
2
1
Y (z) + 0.25y[ 1]z
+ 0.25y[ 2]
where y[ 1] and y[ 2] are the initial conditions we are determining. If we want y[n] = 0.5n u[n] then
from the above equation
Y (z) =
1
0.5z
1
=
1
0.25(y[ 1]z 1 + y[ 2])
(1 0.25z 2 )
Comparing the last two terms, we have that
1
+ y[ 2] =
1 + 0.5z
0.25
H(z) =
Y (z)
=
X(z)
1
1
0.25z
y[ 1]z
1
so that y[ 2] = 4 and y[ 1] = 2.
(b) The poles of the transfer function
2
are z = ±0.5 . The transient thus will disappear as n ! 1, and so in the steady state the output will
be a constant, i.e.,
lim y[n] = lim y[n
n!1
2] = Y
n!1
and
lim x[n] = 1
n!1
which gives according to the difference equation
)
Y = 0.25Y + 1
Y =
4
3
as the steady–state response.
This can also be seen by means of the partial expansion (after replacing X(z) above) of Y (z) or
Y (z) =
1
A
z
1
+
1
B
0.5z
1
+
C
1 + 0.5z
1
The inverse Z-transform of the second and third terms will go to zero as n ! 1 since the radii of the
corresponding poles are less than unity. The other term does not go to zero in the steady state. The
A = Y (z)(1
z
1
)|z
1 =1
= 4/3 and so limn!1 y[n] = 4/3.
(c) For zero initial conditions we want
Y (z) =
X(z)
1 0.25z
2
=
1
1
0.5z
1
which gives that
X(z) = 1 + 0.5z
1
) x[n] = [n] + 0.5 [n
Copyright 2014, Elsevier, Inc. All rights reserved.
1]
Chaparro — Signals and Systems using MATLAB
(d) For x[n] = [n] + 0.5 [n
10.9
1] we get Y (z) = H(z)(1 + 0.5z
is equal to
Y (z) =
1 + 0.5z
1 0.25z
1
) which from the difference equation
1
2
so that when comparing them we find that
H(z) =
1 + 0.5z 1
(1 + 0.5z 1 )(1 0.25z
with poles at ±0.5 so that
H(z) =
2)
=
1
0.25z
1
A
1 + 0.5z
1
+
1
2
=
1
(1
B
0.5z
0.5z
1 )(1
+ 0.5z
1
where
A
=
B
=
1
0.5z
1
1 + 0.5z
1
|
1 z
1=
2
|
1 z
1 =2
= 0.5
= 0.5
so that
h[n] = 0.5( 0.5)n u[n] + 0.5n+1 u[n] = 0.5n+1 [1 + ( 1)n ]u[n]
Copyright 2014, Elsevier, Inc. All rights reserved.
1)
Chaparro — Signals and Systems using MATLAB
10.9
(a)
10.10
i. Yes. Cross-multiplying
H(z)(1
1
↵z
ii. H(z) = 1 + ↵z
1
)
=
(1 + ↵z
=
1 + ↵z
=
1
+ ↵2 z
2
1
1
↵M z
+ · · · + ↵M
1
+ · · · + ↵M
1
z
(M
(M
z
1)
)(1
1)
↵z
↵z
1
1
···
M
and (1
↵z
H(z) =
1 ↵3 z
1 ↵z
1
↵3 z
)H(z) = 1
3
↵M z
M
. Thus
z 3 ↵3
z 2 (z ↵)
=
1
3
)
so the zeros of H(z) are zk = ↵ej2⇡k/3 for k = 0, 1, 2, and the poles z = 0 of order 2,
and z = ↵. The pole z = ↵ is cancelled by the zero at k = 0 so ROC is the whole Z–plane,
except z = 0.
(b)
i. If we let
h1 [n]
=
then h[n] = h1 [n] + h1 [ n]
8
>
< 0.5
0.5n
>
:
0
n=0
1nN
1
otherwise
ii. For N = 4, Z-transform of h1 [n] is
H1 (z) =
3
X
0.5n z
n=0
n
0.5 =
1 0.54 z
1 0.5z
4
0.5 =
1
0.5 + 0.25z 1 0.54 z
1 0.5z 1
noticing that the initial expression for H1 (z) is a polynomial in z
The final expression being rational indicates that if z
1
1
4
then the ROC is |z| > 0.
= 2 or z = 1/2 is a zero and a pole
and they cancel so that only poles at the origin remain. The Z-transform
Z[h1 [ n]] = H1 (1/z) =
3
X
0.5n z n
0.5 =
n=0
0.5 + 0.25z 0.54 z 4
1 0.5z
with ROC the whole Z–plane as it is a polynomial in z. Verify that the pole at z = 2 of the
final expression for Z[h1 [ n]] is cancelled by a zero at the same place. Thus
H(z) =
0.5 + 0.25z 1 0.54 z
1 0.5z 1
4
+
0.5 + 0.25z 0.54 z 4
1 0.5z
with ROC: |z| > 0.
iii. If N ! 1, we have
H(z)
=
=
1
1
0.25
+
1=
1
1 0.5z
1 0.5z
(1 0.5z 1 )(1
0.5z
ROC 0.5  |z|  2
(1 2z)(1 0.5z)
Copyright 2014, Elsevier, Inc. All rights reserved.
0.5z)
Chaparro — Signals and Systems using MATLAB
(c)
i. H(z) = 1 + 0.5z
1
, |z| > 0, H(z
1
10.11
) is Z-transform of h[ n] so
He (z)
=
0.5[H(z) + H(z
1
)] = 0.5[2 + 0.5(z
Ho (z)
=
0.5[H(z)
1
)] = 0.5[0.5(z
H(z
1
z + 0.25z 2 + 0.25
|z| > 0
z
2
0.25 0.25z
z))] =
|z| > 0
z
1
+ z)] =
The ROC of H(z) = He (z) + Ho (z) is the intersection of the ROCs of He (z) Ho (z) or
|z| > 0.
ii. The inverse Z-transforms give
he [n] = 0.25 [n + 1] + [n] + 0.25 [n
ho [n] =
0.25 [n + 1] + 0.25 [n
1]
Copyright 2014, Elsevier, Inc. All rights reserved.
1]
Chaparro — Signals and Systems using MATLAB
10.10
(a) Pole is z = 0.5 and zero z =
10.12
1. ROC is (iii), |z| > 0.5 because of causality.
(b) From H(z) = Y (z)/X(z) we have Y (z)
0.5Y (z)z
1
= X(z) + X(z)z
1
the difference
equation is
y[n]
0.5y[n
1] = x[n] + x[n
(c) We can write
H(z) =
1
0.5z
1
1
+
1
z 1
0.5z
1]
1
so that
h[n]
=
=
0.5n u[n] + 0.5n
1
1] = [n] + (0.5n + 0.5n
u[n
[n] + 3 ⇥ 0.5n u[n
1
)u[n
1]
1]
(d) The system is a low-pass filter. Drawing vectors from the pole and the zero to a point in the unit
circle gives
H(ej!0 ) =
~ j!0 )
Z(e
P~ (ej!0 )
which gives H(ej0 ) = 2/0.5 = 4, H(ej⇡ ) = 0 and decreases as ! increases form 0 to ⇡.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.11
10.13
(a) Replacing w[n] in the smoother equation:
y[n] =
2
y[n
3
1
1] + (x[n]
3
x[n
1])
(b) If x[n] = u[n], then w[n] = [n] and so the output of the smoother is its impulse response,
calculated using hs [n] = (2/3)hs [n
Hs (z) =
1
1] + (1/3) [n] or
1/3
(2/3)z
1
1
) y[n] = hs [n] =
3
✓ ◆n
2
u[n]
3
(c) Transfer function of overall system
H(z) =
Y (z)
1 z
=
X(z)
3(1 2z
1
1 /3)
Input x[n] = cos(0n)u[n] + sin(⇡n/2)u[n] the steady-state response is
y[n] = |H(ej0 )| cos(0) + |H(ej⇡/2 )| sin(⇡n/2 + \H(ej⇡/2 ) where
H(ej0 ) = 0
( j)
1+j
=
3(1 ( j)2/3)
3(1 + 2j/3)
p
2
|H(ej⇡/2 )| = p
, \H(ej⇡/2 ) = ⇡/4
3 1 + 4/9
H(ej⇡/2 ) =
1
tan
) y[n] = |H(ej⇡/2 )| sin(⇡n/2 + \H(ej⇡/2 ))
Copyright 2014, Elsevier, Inc. All rights reserved.
1
(2/3)
Chaparro — Signals and Systems using MATLAB
10.14
10.12 We have
Y (z)
2(1 z 1 )
=
X(z)
1 + 0.5z 1
Y (z) = H(z)(Z[u[n]] + Z[0.5n cos(⇡n)u[n]])
H(z) =
only the first of the above terms would give steady state due to its pole at z = 1, so
H(z)
1
1 z
1
=
(1
2(1 z 1 )
z 1 )(1 + 0.5z
1)
=
2
1 + 0.5z
1
which gives a transient, so yss [n] = 0. Since system is stable, changing the initial condition will not
change the steady state–response.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.15
10.13 For a = b = 2 the denominator of the transfer function is
D(z) = z 2 + 2z + 2 = (z + 1)2 + 1
so the poles are p1,2 =
is unstable.
1 ± j1 which have |p1,2 | =
p
2 > 1, outside the unit circle and as such system
For a = 1 and b = 1/2 the denominator is
D(z) = z 2 + z + 0.5 = (z + 0.5)2 + 0.25
so the poles are p1,2 =
system is stable.
0.5 ± j0.5 which have |p1,2 | =
p
2/2 < 1, inside the unit circle and as such
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.16
10.14 Impulse response
y[n]
=
H(z)
=
h[n]
=
e[n 1] = x[n
Y (z)
z 1
=
X(z)
1+z
( 1)
n 1
u[n
1]
y[n
1]
1
1]
System is unstable, h[n] is not absolutely summable:
1
X
n=1
|h[n]| ! 1
| {z }
1
Moreover, the pole z = 1 is on the unit disc and as such the system is not BIBO stable.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.15
10.17
(a) We have
1
Y (z)
=
1 + 2z
+ 2z
X(z)
=
H(z)
=
1+z 1
Y (z)
=1+z
X(z)
2
+z
3
1
+z
2
after division.
(b)
i. Yes, because of the ROC.
ii. There is a pole-zero cancellation
H(z) =
1 0.5z 1
0.5z 1 )(1 + 0.5z
(1
1)
so that h[n] = ( 0.5)n u[n].
(c) By long division in negative powers of z
H(z) = z
1
+ 2z
2
+ 2z
3
+ · · · + 2z
10000
so that h[0] = 0, h[1] = 1 and h[10000] = 2.
Another way is
H(z) =
so that h[n] = u[n
1] + u[n
z
1
1
z
1
+
z
1
2
z
1
2] giving the same values as above.
Copyright 2014, Elsevier, Inc. All rights reserved.
+ ···
Chaparro — Signals and Systems using MATLAB
10.16
10.18
(a) The output can be written
y[n] = [n] + 2 [n
2] + 3( 1)n u[n
1] + 3 [n
where the last term can be expressed as 3( 1)n u[n
3] =
3( 1)n
3]
3
u[n
3] so that we can
find its Z-transform by using the shift property, thus:
X(z)
=
1
1+z
Y (z)
=
1 + 2z
H(z)
=
Y (z)
= (1 + 2z
X(z)
1
1
+ 3z
2
3
1
z 3
1+z
+ 3z
2
1
1
)(1 + z
)
3z
3
= 1 + 3z
1
+ 5z
2
so h[0] = 1, h[1] = 3, h[2] = 5 and the others are zero.
(b)
i. The transfer function is
(z + 1)2
z
where at dc H(ej0 ) = H(1) = 4K = 2, so K = 2/4 = 0.5. As an FIR its ROC is the whole
H(z) = K
Z–plane except for z = 0.
ii. x[n] = [cos(0n) + cos(⇡n/2) + cos(⇡n)]u[n] the steady state response is
yss [n]
=
H(ej0 ) + |H(ej⇡/2 )| cos(⇡n/2 + \H(ej⇡/2 )) + |H(ej⇡ )| cos(⇡n + \H(ej⇡ ))
where
H(ej0 ) = 2,
H(ej⇡/2 ) = 0.5
(j + 1)2
= 1ej0 ,
j
H(ej⇡ ) = 0
and the steady–state is then
yss [n] = 2 + cos(⇡n/2).
(c)
i. The zero is z = 0 and the poles are z = 0.5 and z =
2, if h[n] is non-causal then the region
of convergence is ROC:1/2 < |z| < 2.
ii. If h[n] is causal, then the ROC is |z| > 2 and
H(z)
=
z
(1
0.5z
1
1 )(1
+ 2z
1)
=
1
A
0.5z
1
where
A
=
B
=
z 1
2
| 1 =
1 + 2z 1 z =2
5
1
z
2
| 1
=
1 0.5z 1 z = 1/2
5
Copyright 2014, Elsevier, Inc. All rights reserved.
+
B
1 + 2z
1
Chaparro — Signals and Systems using MATLAB
10.19
so the impulse response is
h[n] = (2/5)(0.5n
( 2)n )u[n]
iii. The ROC of convergence of the non-causal transfer function includes the unit circle, making
the system BIBO stable, that is not the case for the causal transfer function and as it can be
seen it is not BIBO stable.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.17 If input is [n] = u[n]
u[n
10.20
1] the output is h[n] = s[n]
s[n
1] where
0.5n+1 )u[n]
s[n] = 3(1
is the inverse Z-transform of S(z). Thus
h[n]
=
3(1
0.5n+1 )u[n]
=
3(1
0.5) [n] + [3(1
=
3(1
n
1.5 [n] + 1.5 ⇥ 0.5 u[n
0.5n )u[n
0.5n+1 )
3(1
1]
0.5n )]u[n
1]
Copyright 2014, Elsevier, Inc. All rights reserved.
1]
Chaparro — Signals and Systems using MATLAB
10.18
10.21
(a) The output is
y[0] = 0
y[1] = 1
y[2] = 3
y[3] = 4
y[4] = 4
y[n] = 3 n
5
(b) x[n] can be written as
x[n]
=
X(z)
=
H(z)
=
n(u[n]
u[n
3]) + u[n
z 3
z 1 + 2z 2 +
1 z 1
1
2
1+z +z
3]) = [n
1] + 2 [n
2] + u[n
thus
Y (z) = X(z)H(z) = X(z) + z
1
X(z) + z
2
X(z)
so that
y[n]
=
=
x[n] + x[n
[n
1] + x[n
1] + 3 [n
2]
2] + 4 [n
3] + 4 [n
4] + 3u[n
Copyright 2014, Elsevier, Inc. All rights reserved.
5]
3]
Chaparro — Signals and Systems using MATLAB
10.19
10.22
(a) y[n] will have length equal to length of h[n] + length of x[n]
(b) H(z) = 1 + z
1
+ 0.25z
2
y[0] = 1
y[1] = 2
y[2] = 2.25
y[3] = 1.25
y[4] = 0.25
y[5] = 0
1 = 3+3
1 = 5. The output is
= (z 2 + z + 0.25)/z 2 , so system is BIBO stable.
(c) Ĥ(z) = 1/H(z) = z 2 /(z 2 + z + 0.25) with double pole z =
1/2, so stable. Yes, x[n] can be
recovered. The poles of Ĥ(z) are 0.5 double, so Ĥ(z) is stable and H(z)Ĥ(z) is also stable.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.20
10.23
(a) Voltage division gives the transfer function
H(s) =
Y (s)
2s
= 2
X(s)
s + 2s + 1
thus the differential equation relating x(t) and y(t) is
d2 y(t)
dy(t)
dx(t)
+2
+ y(t) = 2
dt2
dt
dt
With T = 1,
⇡ ⌘[n]
d⌘(t)/dt
2
d ⌘(t)/dt
2
⌘[n
1]
= d(d⌘(t)/dt)/dt ⇡ (⌘[n]
⌘[n
= ⌘[n]
2]
2⌘[n
1] + ⌘[n
1])
(⌘[n
1]
⌘[n
2])
so that the differential equation is approximated by
(y[n]
y[n]
2y[n
y[n
1] + y[n
2]) + 2(y[n]
1] + 0.25y[n
(b) If x[n] = u[n], then x[n]
y[n
2] = 0.5(x[n]
x[n
1] = [n] and
y[n]
y[n
1] + 0.25y[n
1]) + y[n] = 2(x[n]
x[n
1])
2] = 0.5 [n]
Using Z-transform
Y (z)[1
Y (z) =
z
(1
1
+ 0.25z 2 ] = 0.5
0.5
) y[n] = (n + 1)0.5n+1 u[n]
0.5z 1 )2
Copyright 2014, Elsevier, Inc. All rights reserved.
x[n
1])
Chaparro — Signals and Systems using MATLAB
10.21
(a) Since fs
10.24
40 kHz (Nyquist) we select either fs = 40 kHz or fs = 50 kHz.
(b) Since system B is the only stable low-pass filter we select B
(c) The transfer function of filter B is
HB (z)
=
=
1
z(z + 1)
p
4 (z
2/2 ej⇡/4 ) (z
1 z(z + 1)
4 z 2 z + 0.5
p
1
2/2 e
(d) The magnitude response of filter B is that of a low-pass filter having
|H(ej0 )| = 1
|H(ej⇡ )| = 0
Copyright 2014, Elsevier, Inc. All rights reserved.
j⇡/4 )
Chaparro — Signals and Systems using MATLAB
10.22
10.25
(a) Poles of H(z)
z1,2
=
=
(↵ + ) ± (↵
2
(
↵
)
Impulse response
H(z)
=
h[n]
=
A
B
+
1 z 1↵ 1 z 1
A↵n + B n = Ar1n ejn✓1 + Br2n ejn✓2
for h[n] ! 0 as n ! 1 we need 0  ri < 1 for i = 1, 2.
(b) If we let ↵ = j and
=
j, we would have zeros at ±1 giving the zero magnitude responses at
! = 0, ⇡. The poles will be at 1e±j⇡/2 which will give the infinite magnitude response at ±⇡/2.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.26
10.23 Let Hs (z) and H(z) be the transfer functions of the smoother and of the overall system.
(a) If x[n] = u[n] then w[n] = [n] and y[n] = hs [n]. Thus, from
Hs (z)
=
Y (z)
1/3
=
) y[n] = hs [n] = (1/3)n+1 u[n]
W (z)
1 z 1 /3
(b) For the overall system
Y (z)
Y (z) W (z)
(1/3)(1
=
=
X(z)
W (z) X(z)
1 z
n
x[n] = ( 1) = cos(⇡n)
H(z) =
yss [n] = |H(ej⇡ )| cos(⇡n + \H(ej⇡ ))
|H(ej⇡ )| = 1/2, \H(ej⇡ ) = 0
yss [n] = 0.5( 1)n
Copyright 2014, Elsevier, Inc. All rights reserved.
z
1 /3
1
)
Chaparro — Signals and Systems using MATLAB
10.24
10.27
(a) From the block diagram
1
Y (z) = X(z) + 0.5z
so that
H(z) =
Y (z) + 0.25z
Y (z)
=
X(z)
1
2
Y (z)
1
0.5z
1
0.25z
2
(b) For w[n] = x[n] then R(z)H(z) = 1 so that
R(z) = 1
(c) Y (z) = 1 + z
1
0.5z
1
0.25z
2
, and
X(z)
=
Y (z)R(z)
=
1 + 0.5z
1
0.75z
2
0.25z
3
so that
x[n]
=
[n] + 0.5 [n
1]
0.75 [n
2]
0.25 [n
Copyright 2014, Elsevier, Inc. All rights reserved.
3]
Chaparro — Signals and Systems using MATLAB
10.28
10.25 (a) The equation H(z)A(z) = B(z) using convolution and that a0 = 1
h[m] +
N
X1
ak h[m
k] = bm
k=1
where h[m] = 0 for m < 0 and bm = 0 for m < 0 and m > M 1 or
(
N
X1
bm m = 0, 1, · · · , M 1
h[m] +
ak h[m k] =
0
m = M, · · · , M + N
k=1
2
Solving first for the denominator coefficients (the bottom equations above), we get a matrix equation
2
6
6
6
6
4
h[M ]
h[M
h[M + 1]
..
.
h[M ]
..
.
h[M + N
2]
1]
h[M + N
3]
···
h[M
···
..
.
h[M
..
.
···
h[M
N + 1]
3 2
7
N + 2] 7
7
7
5
1]
6
6
6
6
4
3
1
a1
..
.
aN
1
2
7 6
7 6
7=6
7 6
5 4
0
0
..
.
0
3
7
7
7
7
5
To solve these equations we move the first column of the matrix on the left to replace the zero vector on
the right, using the fact that a0 = 1 is known.
Once the denominator coefficients are found, the following set of equations are solved for the numerator
coefficients:
2
6
6
6
6
4
h[0]
h[1]
..
.
h[M
0
h[0]
..
.
1]
h[M
2]
···
···
..
.
0
0
..
.
···
h[M
3 2
N]
7
7
7
7
5
6
6
6
6
4
3
1
a1
..
.
aN
1
(b) We let a0 = 1 and then the equation for a1 is (M = 1, N = 2)
h[0]a1 =
so that a1 =
h[1]/h[0] =
0.5/1 =
2
7 6
7 6
7=6
7 6
5 4
3
b0
b1
..
.
bM
1
7
7
7
7
5
h[1]
0.5. Then the b0 is obtained h[0] = b0 , so b0 = 1. The so
called “Pade approximant” is then
Ĥ(z) =
b0
1 + a1 z
1
=
1
1
0.5z
1
with impulse response ĥ[n] = 0.5n u[n] which approximates very well the given impulse response.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.29
10.26 Pre–multiplying by matrix T it is equivalent to exchanging the rows of the premultiplied matrix. Also
this matrix is such that T
1
= T, and when post–multiplying by T the columns are exchanged. Thus
the new matrices for the new state
w1 [n] = v2 [n]
w2 [n] = v1 [n]
and output equations are
à = TAT
b̃ = Tb =
c̃T = cT T
1
"
1
=
"
1/3
1
1/3
1
#
0
0
h
= 1
1/3
#
i
and d remains the same. The block diagram is exactly the same as the one in example 23, it is the
definition of the state variables that is different.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.27
10.30
(a) The z-transform of the state variables (zero initial conditions) and output equations are
"
z + a1
#"
a2
1
z
V1 (z)
V2 (z)
#
=
"
1
0
#
X(z)
Y (z) = b2 V2 (z)
Using Cramer’s rule
Y (z) = b2
X(z)
z 2 + a1 z + a2
so
H(z) =
b2
b2 z 2
=
z 2 + a1 z + a2
1 + a1 z 1 + a2 z
2
(b) We obtain a minimal realization if we let
W (z) =
and Y (z) = b2 z
2
X(z)
1 + a1 z 1 + a2 z
2
W (z) which can be written
x[n] = w[n] + a1 w[n
1] + a2 w[n
2]
2] with state variables
y[n] = b2 w[n
v1 [n] = w[n
1], v2 [n] = w[n
2]
we get the following state and output equations
v1 [n + 1] =
a1 v1 [n]
a2 v2 [n] + x[n]
v2 [n + 1] = v1 [n]
y[n] = b2 v2 [n]
The block diagram is shown in Fig. 10.2. The equations for the state and the output coincide with
the given ones.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
x[n]
+
w[n]
z
1
10.31
v1 [n]
z
1
v2 [n]
y[n]
b2
a1
a2
Figure 10.1: Problem 27: Block diagram.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.32
10.28 Considering vi [n], i = 1, 2, the state variables in the controller form for zero initial conditions the
z-transform of the state variable equations and the output are
"
#"
# "
#
z + a1 a2
V1 (z)
1
=
Xc (z)
1
z
V2 (z)
0
Yc (z) = b1 V1 (z) + b2 V2 (z)
Using Cramer’s rule to solve for Vi (z) we have
Yc (z) = b1
after replacing
zXc (z)
Xc (z)
b1 z + b2
+ b2
= 2
Xc (z
(z)
(z)
z + a1 z + a2
(z) = z 2 + a1 z + a2 .
For the second form, letting wi [n] be the state variables the z-transform for the state (zero initial conditions) and the output are
"
z + a1
a2
1
z
#"
W1 (z)
W2 (z)
#
=
"
b1
b2
#
Xo (z)
Yo (z) = W1 (z)
We find using Cramer’s:
Y0 (z) = W1 (z) =
b1 z + b2
Xo (z)
z 2 + a1 z + a2
So that both forms have the same transfer function.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.29 We have
"
#
b1
b2
| {z }
=
10.33
"
t1
t2
t3
t4
#"
h
so that t2 = b2 . Finally,
"
|
|
a1
1
1
{z
0
cT
o
#"
a2 0
{z
}
i
}
"
b1
b2
b2
t4
bc
b1
t2
b2
t4
#
=
"
#
=
h
|
b1
b1
b2
b2
t4
T=
{z
b2
cT
c
#"
Ao
which after multiplying gives that t4 =
#
0
| {z }
bo
so that t1 = b1 and t3 = b2 . Then
1
a2 b1 + a1 b2 . Thus
"
b 1 b2
b2
a 2 b1 + a 1 b2
det(T) =
a2 b21 + a1 b1 b2
|
i
}
a1
1
a2
{z
Ac
#
b22 6= 0
Copyright 2014, Elsevier, Inc. All rights reserved.
0
#
}
Chaparro — Signals and Systems using MATLAB
10.34
10.30 Using an additional variable w[n] we have
Y (z) = (0.8
X(z) = (1
0.2z
z
1
1
)W (z)
+ 0.5z
2
)W (z)
and defining state variables v1 [n] = w[n 1] and v2 [n] = w[n 2] we obtain the following matrices
"
#
"
#
h
i
1
0.5
1
A=
, b=
, cT = 0.6
0.4 , d = 0.8
1
0
0
Figure 10.2: Problem 30: Block diagram.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.2
10.35
Problems using MATLAB
10.31 (a) Using the difference equation and the given initial conditions we get the values of the Fibonacci
series:
f [0] = f [ 1] + f [ 2] = 0,
f [1] = f [0] + f [ 1] = 1,
f [2] = f [1] + f [0] = 1
..
.
or the sequence {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, · · · } for n
F (z)
=
f [0] + f [1]z
=
0 + 1z
1
1
+ 1z
0. The Z-transform of f [n] is then
+ f [2]z
2
+ 2z
2
+ f [3]z
3
+ ···
3
+ ···
which is not in a closed-form. To get that, we use the Z-transform shift property in the given difference
equation:
F (z)
=
(z
1
F (z) + f [ 1]) + (z
=
[z
1
+z
2
2
F (z) + f [ 1]z
1
+ f [ 2])
1
]F (z) + z
after replacing the initial conditions. We then have that
1
z
F (z) =
1 z 1 z 2
We have obtained the Z-transform of the Fibonacci sequence even though we know that the sequence
blows up, and that the region of convergence for this sequence is not obvious from the development.
The zero of F (z) is at zero, and the poles are
1,2
1±
1+4
2
1.6183, 0.6183
=
=
The value
1
p
= 1.6183 is the golden ratio which in ancient Greece was considered the most pleasing
ratio for many designs. The letter
has been used in honor of the Greek sculptor Phidias who is said to
have used it in his work.
(b) Notice that
1
+
2
= 1. The partial fraction expansion is
F (z) =
A
1
1z
1
+
B
1
2z
1
The coefficients are found
A
B
=
=
F (z)(1
F (z)(1
1z
1
2z
1
)|z
1 =1/
1
=
)|z
1 =1/
2
=
1
1
2
1
2
1
1
=p
5
1
= p
5
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
so for ROC: |z| >
1
10.36
= 1.6183, the inverse is
1
f [n] = p (
5
n
1
n
2 )u[n]
This formula was first presented by Leonhard Euler in 1765 as a formula to obtain the Fibonacci
numbes. Let us verify that this equation gives the Fibonacci numbers, f [0] = 0, f [1] =
1, and so on. For the region of convergence |z| >
1
p1 ( 1
5
2)
=
= 1.6183, the system represented by the Fibonacci
difference equation is not BIBO stable as one of its poles is outside the unit circle.
Using the poles i we compute the Fibonacci sequence. The obtained values do not coincide exactly
with the sequence, only if we find integers that smaller using floor we obtain it.
% Pr 10_31
clear all; clf
phi1=1.6183; phi2=-0.6183;
n=0:100;
f=(phi1.ˆn-phi2.ˆn)/sqrt(5);
figure(1)
stem(n(1:10),f(1:10));grid;title(’Fibonacci sequence’);xlabel(’n’)
floor(f(1:10))
0
1
1
2
3
5
8
13
21
34
Fibonacci sequence
35
30
25
20
15
10
5
0
0
1
2
3
4
5
6
7
8
9
n
Figure 10.3: Problem 31: Approximate computation of Fibonacci sequence .
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.32 (a) The signal x[n] = [n] + [n
10.37
2] has a Z-transform
1] + [n
X(z) = 1 + z
1
2
+z
(b) Then
Y (z) = X 2 (z) = (1 + z
1
+z
2 2
) = 1 + 2z
1
+ 3z
2
+ 2z
3
+z
4
The convolution of the coefficients of X(z), or x[n], with themselves gives the sequence
y[n] = [n] + 2 [n
1] + 3 [n
2] + 2 [n
The length of y[n] is twice that of x[n] minus one, or 2 ⇥ 3
polynomial. The above result is verified using MATLAB
3] + [n
1 = 5 so that Y (z) is a fourth -degree
%% Pr 10_32
x=[1 1 1];
y=conv(x,x); N=length(y);
x1=[x zeros(1,N-3)]
n=0:N-1;
figure(1)
subplot(211)
stem(n,x1),ylabel(’x[n]’);grid
subplot(212)
stem(n,y);ylabel(’y[n]’); grid
1
x[n]
0.8
0.6
0.4
0.2
0
0
0.5
1
1.5
2
2.5
3
3.5
4
0
0.5
1
1.5
2
2.5
3
3.5
4
3
2.5
y[n]
2
1.5
1
0.5
0
4]
Figure 10.4: Problem 32: Convolution sum result.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.38
10.33 Writing X(z) using terms found in tables, its partial fraction expansion is
X(z)
2 z 1
2(1 + 0.25z 1 )(1 + 0.5z
A
B
+
1 + 0.25z 1
1 + 0.5z
=
=
corresponding to the poles at
0.25 and
A
=
B
=
1)
1
0.5. The coefficients of the expansion are
2 z 1
| 1
= 3
2(1 + 0.5z 1 ) z = 4
2 z 1
| 1
=4
2(1 + 0.25z 1 ) z = 2
so that
X(z) =
3
1 + 0.25z
1
+
4
1 + 0.5z
1
and the inverse is
x[n] = [ 3( 0.25)n + 4( 0.5)n ]u[n]
and in the steady–state it is zero.
% Pr 10_33
syms n z
x=iztrans(2*(z-0.5)*z/(2*(z+0.25)*(z+0.5)))
x =4*((-1/2))ˆn - 3*((-1/4))ˆn
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.39
10.34 (a) The transfer function is
H(z) =
Y (z)
=
X(z)
1
1
2r cos(!0 )z
1
+ r2 z
2
(b) The transfer function can be written
H(z) =
(z
z2
rej!0 )(z
re
j!0 )
so that the poles of the system are at re±j!0 . For the system to be stable the poles should be inside the
unit circle, thus r < 1 and 0  !0  2⇡. If r = 0.5 and !0 = ⇡/2 the following script plots the poles
and zeros of H(z):
%% Pr 10_34
clear all; clf
r=0.5;w0=pi/2;
a=[1 -2*r*cos(w0) rˆ2]
b=1;
zplane(b,a)
1
0.8
0.6
Imaginary Part
0.4
0.2
2
0
−0.2
−0.4
−0.6
−0.8
−1
−1
−0.5
0
Real Part
0.5
1
Figure 10.5: Problem 34: Poles/zeros of H(s) when r = 0.5 and !0 = ⇡/2.
(c) If !0 = ⇡/2, then cos(⇡/2) = 0 and the transfer function becomes
H(z) =
1
1 + r2 z
2
and then
h[n] = rn cos(⇡n/2)u[n]
If !0 = 3⇡/2 we will get the same transfer function and impulse response as cos(3⇡/2) = 0.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.40
10.35 (a) Thinking of the given Z-transform as a transfer function with x[n] as the input and y[n] as the output
we have that
AX(z)(1
1
cos(!0 )z
) = Y (z)(1
2 cos(!0 )z
1
+z
2
)
which gives the following difference equation
y[n]
2 cos(!0 )y[n
1] + y[n
2] = Ax[n]
A cos(!0 )x[n
1]
n
with zero initial conditions and input x[n] = [n] that will generate the cosine function.
(b) We have that !0 = ⇡/2 so that cos(!0 ) = 0 giving the difference equation
y[n] + y[n
2] = 2 [n]
n
0
with zero initial conditions. Recursively this equation gives
y[0] = 2
y[1] = 0
y[2] =
2
y[3] = 0
..
.
or y[n] = 2 cos(⇡n/2)u[n].
(c) The signal to be generated y1 [n] = 2 sin(⇡n/2) gives for n
0
y1 [0] = 0
y1 [1] = 2
y1 [2] = 0
y1 [3] =
..
.
i.e., y1 [n] = y[n
2
1], so that the above difference equation shifted by 1 gives
y[n
1] + y[n
3] = 2 [n
y1 [m] + y1 [m
1]
2] = 2 [m]
n
1
0
m
0
which gives
y1 [0] =
y[ 2] + 2 = 0
y1 [1] =
y[ 1] + 0 = 2
y1 [2] = y1 [0] = 0
y1 [3] =
..
.
y[1] = 2
Copyright 2014, Elsevier, Inc. All rights reserved.
0
Chaparro — Signals and Systems using MATLAB
10.41
so that the initial conditions are y[ 2] = 2 and y[ 1] =
2.
Another way to obtain the initial conditions to generate 2 sin(⇡n/2) with the same difference equation
as before is in the z-domain
Y (z) =
2X(z)
y[ 1]z 1
1+z 2
y[ 2]
If we let X(z) = 1 (i.e. x[n] = [n]) and initial conditions y[ 2] = 2 and y[ 1] =
Y (z) =
2 we get
2z 1
1+z 2
which is the Z-transform of the desired signal.
The following script computes and plots the two sinusoids. To generate the sine, we compute the first
two values using the initial conditions and the input, and then use the difference equation to obtain the
rest using a for loop.
%% Pr 10_35
clear all; clf
% generation of 2cos(pi n/2)
b=2;
a=[1 0 1];
x=[1 zeros(1,100)];
y=filter(b,a,x);
n=0:length(y)-1;
figure(1)
subplot(211)
stem(n,y); axis([0 100 -2.2 2.2]); grid; ylabel(’y[n]’)
hold on; plot(n,y,’:r’); hold off
% generation of 2sin(pi n/2)
y1(1)=0;y1(2)=2;
for m=3:101,
y1(m)=-y1(m-2);
end
subplot(212)
stem(n,y1); axis([0 100 -2.2 2.2]);grid; ylabel(’y_1[n]’);xlabel(’n’)
hold on; plot(n,y1,’:r’); hold off
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.42
2
y[n]
1
0
−1
−2
0
10
20
30
40
50
60
70
80
90
100
0
10
20
30
40
50
n
60
70
80
90
100
2
y1[n]
1
0
−1
−2
Figure 10.6: Problem 35: Generation of 2 cos(⇡n/2) (top) and 2 sin(⇡n/2) (bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.43
10.36 (a) To find the unit–step response, the input is x[n] = u[n] and the initial conditions are zero. We then
have
Y (z)[1
Y (z) =
z
1
(1
+ 0.5z
z
1 )(1
2
] = (1 + z
1+z
0.5(1 + j)z
1
)
1
1
z
1
1
1 )(1
0.5(1
j)z
1)
(b) The partial fraction expansion is
Y (z) =
A
1 z
1
+
1
1
A = Y (z)(1
z
B = Y (z)(1
0.5(1 + j)z
(c) The inverse Z-transform is then
"
y[n]
=
=
=
=
)|z
B
0.5(1 + j)z
1 =1
1
+
1
B⇤
0.5(1 j)z
1
=4
1
)|z
1 =0.5(1+j)
= 1.58e
j161.5o
!n
!n #
p
2 j⇡/4
2 j⇡/4
⇤
A+B
e
+B
e
u[n]
2
2
p !n
2
[A + |B|
[ej(⇡n/4+\B) + e j(⇡n/4 \B) ]]u[n]
2
p !n
2
[A + 2|B|
cos(⇡n/4 + \B)]u[n]
2
p
[4 + 3.16(0.707)n cos(⇡n/4
161.5o )]u[n]
The following script is used to verify the above result using MATLAB
%% Pr 10_36
clear all; clf
N=[1 1 0 0];
D=conv([1 -1],[1 -1 0.5])
[r,p,k]=residuez(N,D)
abs(r(2))
angle(r(2))*180/pi
n=0:49;
y=r(1)*(p(1).ˆn)+r(2)*(p(2).ˆn)+r(3)*(p(3).ˆn);
figure(1)
subplot(311)
zplane(N,D)
subplot(312)
stem(n,y); ylabel(’y[n]’)
% verification
y1=4+3.16*(0.707).ˆn.*cos(pi.*n/4-161.5*pi/180);
subplot(313)
stem(n,y1); ylabel(’y_1[n]’); xlabel(’n’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Imaginary Part
Chaparro — Signals and Systems using MATLAB
10.44
1
2
0
−1
−5
−4
−3
−2
−1
0
1
Real Part
2
3
4
5
y[n]
6
4
2
0
0
5
10
15
20
25
30
35
40
45
50
0
5
10
15
20
25
n
30
35
40
45
50
y1[n]
6
4
2
0
Figure 10.7: Problem 36: Verification of unit-step response using residues and analytic solution. Poles and
zeros of Y (z); unit–step response found using the partial fraction expansion with MATLAB (middle) and
analytically (bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.45
10.37 (a) The following script obtains the Prony rational approximation of the first 100 value of h[n] =
0.9n u[n].
% Pr. 10_37
clear all; clf
n=[0:100];
h=0.9.ˆn;
[b,a]=prony(h,1,1);
% rational approximation of order (1,1) of h
delta=[1 zeros(1,100)];
hd=filter(b,a,delta);
% approximate sequence
figure(1)
subplot(211)
plot(n,h,’o’,n,hd,’+’)
xlabel(’n’)
ylabel(’h[n],hd[n]’)
grid
p=roots(a)
% poles
z=roots(b)
% zeros
subplot(223)
stem(n,hd-h); ylabel(’error’)
subplot(224)
zplane(b,a)
1
h[n],hd[n]
0.8
0.6
0.4
0.2
0
0
10
20
30
40
50
n
60
70
80
90
100
−15
2.5
x 10
1
Imaginary Part
error
2
1.5
1
0.5
0
0.5
0
−0.5
−1
0
20
40
60
80
100
−1
−0.5
0
0.5
Real Part
1
Figure 10.8: Problem 37: Prony approximation, of order (1, 1), of finite segment of h[n] = 0.9n u[n] .
The poles and zeros corresponding to the actual and the approximate are very close.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.46
(b) The convolution of h1 [n] = 0.9n u[n] and h2 [n] = 0.8n u[n] is done using the MATLAB function conv. The Prony approximation of h1 [n] ⇤ h2 [n] gives an approximation to H1 (z)H2 (z) for the
correct orders. Using prony of order (2, 2) (in general this has to be guessed, but here we have the
advantage of knowing the sequences, a big advantage!).
clear all; clf
n=[0:99];
h1=(0.9).ˆn;
h2=(0.8).ˆn;
h=conv(h1,h2);
[b,a]=prony(h,2,2)
% rational approximation of order (2,2) of h
delta=[1 zeros(1,100)];
hd=filter(b,a,delta);
% approximate sequence
subplot(211)
plot(n,h(1:100),’o’,n,hd(1:100),’+’)
xlabel(’n’)
ylabel(’h(n),hd[n-’)
grid
p=roots(a)
% poles
z=roots(b)
% zeros
subplot(212)
zplane(b,a)
The following are the results obtained. Notice that the poles/zeros are those of H1 (z) and H2 (z) or the
product H(z) = H1 (z)H2 (z).
b = 1.0000
-0.0000
-0.0000
a = 1.0000
-1.7000
0.7200
p =0.9000
0.8000
z =1.0e-004 *
0.2674
-0.2674
(c) When the chosen order is higher than the actual one, it is possible to have a pole-zero cancelations.
For the h[n] = [h1 ⇤ h2 ][n] when using prony instead of a second-order approximation we choose a
third-order, the results has a pole/zero cancellation.
[b1,a1]=prony(h,3,3)
p=roots(a1)
z=roots(b1)
subplot(211)
zplane(z,p)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.47
3
h[n],hd[n]
2.5
2
1.5
1
0.5
0
0
10
20
30
40
50
n
60
70
80
90
100
Imaginary Part
1
0.5
0
−0.5
−1
−3
−2
−1
0
Real Part
1
2
3
Figure 10.9: Problem 37: Prony approximation of convolution h1 [n] and h2 [n].
delta=[1 zeros(1,120)];
hd=filter(b1,a1,delta);
M=length(h);
n=[0:ceil(M/2)-1];
subplot(212)
plot(n,h(1:ceil(M/2)),’o’,n,hd(1:ceil(M/2)),’+’)
The results in this case are
b1 =
1.0000
0.0000
-0.0000
-0.0000
-1.7000
0.7200
0.0000
a1 =
1.0000
p =
0.9000
0.8000
-0.0000
z =
1.0e-03 *
0.9266
-0.4633 + 0.8017i
-0.4633 - 0.8017i
showing the same poles as before, which means a third one has been cancelled.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.38
10.48
(a) In the case of MATLAB, the expansion is given by
X(z) =
A
1 z
X(z) =
D
1 z
1
+
1
+
(B + C) 2Bz
(1 2z 1 )2
1
E
1
and in our case, we get
(2E F )z
(1 2z 1 )2
so that the numerator corresponding to the double pole is a first degree polynomial in z
1
. This
is also encouraging as the term for the second order pole is proper for MATLAB and for our
expansion.
For MATLAB’s expansion, the coefficients are found to be:
A = X(z)(1
C = X(z)(1
To find B we choose z
1
1
z
2z
)|z
1 =1
1 2
) |z
=2
1 =1/2
=2
= 0 to get
0=A+B+C
so that B =
A
C=
4.
For our expansion, the coefficients are
D = X(z)(1 z 1 )|z 1 =1 = 2
X(z)(1 2z 1 )2
F =
|z 1 =1/2 = 4
z 1
To find E we choose again z
1
= 0 to get
0=D+E
so that E =
D=
2. Thus we have
MATLAB X(z) =
Ours X(z) =
1
2 + 8z 1
1
(1 2z 1 )2
2 + 8z 1
+
(1 2z 1 )2
2
1 z
2
z
1
+
(b) Consider the following pair
g[n] = n↵n u[n]
,
G(z) =
↵z 1
(1 ↵z 1 )2
which we will use to find the inverse of the last term in our expansion. The signal corresponding
to G(z)z = 1/(1
↵z
) would be g[n + 1] = (n + 1)↵n+1 u[n + 1], or g[n] = n↵n u[n]
1 2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.49
advanced by one sample. The signal g[n + 1] is zero for n < 0 (g[ 1] = 0), thus causal, so we
can write it
g[n + 1] = (n + 1)↵n+1 u[n].
So the inverse of the last term in MATLAB’s expansion is 0.5C [n + 1] 2[n+1] u[n].
The inverse of the MATLAB expression
X(z) =
2
1 z
1
1
4
2z
1
+
(1
2
2z
1 )2
is given by
x[n]
4 (2n ) + (n + 1)2n+1 ]u[n] = [2
=
[2
=
2 [1
4 (2n ) + 2n2n + 2 2n ]u[n]
2n + n 2n ]u[n]
while the inverse of our expansion
X(z)
=
2
1 z
1
1
2
2z
1
+
4z 1
(1 2z 1 )2
is
x[n] = 2[1
2n + 2n n]u[n]
showing the two solutions are equal, as expected.
% Pr 10_38
% inverse
syms n z
x=iztrans(2*zˆ2/(2*(z+0.25)*(z+0.5)))
% x = 2*2ˆn*(n - 1) +2
% residues
a1=[1 -1]; a2=[1 -2]; a=conv(conv(a2,a2),a1)
b=[0 2]
[r,p,k]=residuez(b,a)
% r = -4.0000
%
2.0000
%
2.0000
% p = 2.0000
%
%
2.0000
1.0000
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
10.50
10.39 (a) The transfer function of the overall system is
H(z) = H1 (z) + H2 (z) =
1
1 )(1
(1 + 0.5z
z
1
+ 0.5z
2)
=
1
1
0.5z
1
0.25z
3
The denominator coefficients can be obtained using conv function to multiply the two terms in the denominator.
(b) (c) The following script is used to find the state variable representations for Hi (z), i = 1, 2 and then for H(z).
The representations are not equal.
% Pr 10_39
% H(z) state variable model
d1=[1 0.5]; d2=[1 -1 0.5];
den=conv(d1,d2)
num=[1 0 0 0]
[A,B,C,D]=tf2ss(num,den)
[num1,den1]=ss2tf(A,B,C,D,1)
% H1(z) state variable model
num1=[1 0]; den1=[1 0.5];
[A1,B1,C1,D1]=tf2ss(num1,den1)
% H2(z) state variable model
num2=[0.8 -0.2 0]; den2=[1 -1 0.5];
[A2,B2,C2,D2]=tf2ss(num2,den2)
% verification
[nu,de]=ss2tf(A1,B1,C1,D1,1)
[nu1,de1]=ss2tf(A2,B2,C2,D2,1)
den = 1.0000
-0.5000
num = 1
0
0
A = 0.5000
0
1.0000
0
-0.2500
0
0
0.2500
0
0
1.0000
0
B =1
0
0
C = 0.5000
0
-0.2500
D = 1
A1 = -0.5000
B1 = 1
C1 = -0.5000
D1 = 1
A2 = 1.0000
-0.5000
1.0000
0
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
B2 =1
0
C2 =0.6000
-0.4000
D2 = 0.8000
Copyright 2014, Elsevier, Inc. All rights reserved.
10.51
Chaparro — Signals and Systems using MATLAB
Copyright 2014, Elsevier, Inc. All rights reserved.
10.52
Chapter 11
Fourier Analysis of Discrete–time
Signals and Systems
11.1
Basic Problems
11.1 The DTFT of x[n] = 0.5|n| is
X(ej! ) =
(a) If we let ! = 0 then
X(1) =
(b) The inverse DTFT is
X
3/4
=3=
x[n]
5/4 1
n
1
x[n] =
2⇡
if we let n = 0 we get that
1
2⇡
Z
3/4
5/4 cos(!)
Z
⇡
X(ej! )ej!n d!
⇡
⇡
X(ej! )d! = x[0]
⇡
and so the given integral is 2⇡x[0] = 2⇡.
(c) From the DTFT, X(ej! ) is real and since the denominator, i.e., 5/4
the phase \X(ej! ) = 0.
(d) If we let ! = ⇡ in the DTFT we obtain
X
x[n]( 1)n = X(ej⇡n ) =
n
1
3/4
1
=
9/4
3
cos(!), is positive for [ ⇡, ⇡)
Chaparro — Signals and Systems using MATLAB
11.2
11.2
(a) We have
i. DTFT
X(ej! ) =
2
X
j!n
e
= 1 + 2 cos(!) + 2 cos(2!)
n= 2
ii. Z-transform
X(z) = z 2 + z + 1 + z
1
2
+z
j!
ROC |z| > 0
ROC includes UC
X(e ) = X(z)|z=ej!
which coincides with the previous result.
P2
iii. X(ej0 ) = n= 2 1 = 5
(b) Problem 2(b)
We have
X(z) =
0
X
↵n z
n
=
n= 1
1
X
↵
m m
z
=
m=0
1
, ROC: |z| < ↵
z/↵
1
so ROC must include the unit circle (UC) and as such ↵ > 1.
(c) Problem 2(c)
i. Z-transforms
X1 (z)
=
1 ✓ ◆n
X
1
n=0
X2 (z)
=
2
z
n
=
1 ✓ ◆n
X
1
z
2
n= 1
1
0.5z
1
n
=
1
1
X
m=0
=
z
z
|z| > 0.5
0.5
2m z m + 1 =
z
z
0.5
ii. Since the ROC X1 (z) includes the UC then X1 (ej! ) = X1 (z)|z=ej! .
Copyright 2014, Elsevier, Inc. All rights reserved.
|z| < 0.5
Chaparro — Signals and Systems using MATLAB
11.3
11.3 Writing
t[n] =
2
X
k= 2
(3
|k|) [n
k] = 3 [n] +
2
X
(3
k)( [n + k] + [n
k=1
Ak = 3 |k|, for 2  k  2, 0 otherwise.
The Z-transform of t[n] is
T (z) = 3 +
2
X
(3
k)(z k + z
k
)
k=1
so that the DTFT is
j!
T (e )
=
3+
2
X
(3
k)[ej!k + e
j!k
]
k=1
=
3 +
|{z}
B0
for k > 2, Bk = 0.
2
X
k=1
2(3 k) cos(k!)
| {z }
Bk
Copyright 2014, Elsevier, Inc. All rights reserved.
k])
Chaparro — Signals and Systems using MATLAB
11.4
11.4
(a) Impulse response
1
h[n] =
2⇡
Z
⇡/2
e
j!n
d! =
⇡/2
⇢
0.5
sin(⇡n/2)/(⇡n)
n=0
n 6= 0
h[n] is non-causal as h[n] 6= 0 for n < 0.
(b) Y (ej! ) = X(ej! )H(ej! ) = H(ej! ) so y[n] = h[n]
(c) Yes, H(ej! ) = H(ej! )H(ej! ) so h[n] = (h ⇤ h)[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.5
(a) The DTFT of x[n] = ej✓ [n + ⌧ ] + e
j✓
11.5
[n
X(ej! ) = ej✓ ej!⌧ + e
⌧ ] is
j✓
e
j!⌧
= 2 cos(!⌧ + ✓)
by duality (! ! n, ⌧ ! !0 )
⇥
cos(n!0 + ✓) $ ⇡ ej✓ (! + !0 ) + e
For ✓ = 0
cos(n!0 ) $ ⇡ [ (! + !0 ) + (!
j✓
(!
!0 )
⇤
!0 )]
For ✓ = ⇡/2
cos(n!0 + ⇡/2) = sin(n!0 ) $ ⇡ [j (! + !0 )
j (!
!0 )]
(b) Replacing DTFT of cosine terms
j!
X1 (e )
=
2⇡ (!) +
5
X
Ak ⇡[ej✓k (! + k!0 ) + e
k=1
Copyright 2014, Elsevier, Inc. All rights reserved.
j✓k
(!
k!0 )]
Chaparro — Signals and Systems using MATLAB
11.6
11.6
(a) We have
h1 [n]
=
h[n](1 + ej⇡n ) = h[n] + h[n]ej⇡n =
so
⇢
2h[n]
0
n even
otherwise
H1 (ej! ) = H(ej! ) + H(ej(!+⇡) )
thus since H(ej! ) corresponds to a LPF then H1 (ej! ) is a band-eliminating filter. Sketch its
frequency response to verify it.
(b)
i. Using DTFT
H(ej0 ) =
1
X
h[n] =
n= 1
0.75
=3
1.25 1
ii. Using IDTFT
h[ n]
=
=
Z
1
2⇡
Z
1
2⇡
⇡
H(ej! )e
⇡
⇡
0
j!n
d! =
1
2⇡
Z
⇡
H(e
j!
)e
j!n
d!
⇡
0
H(ej! )ej! n d! 0 = h[n]
⇡
where ! 0 = !.
iii. The denominator 1.25 cos(!) of H(ej! ) is positive for ( ⇡, ⇡], so H(ej! ) is real and
positive, with zero phase.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.7
(a) (a) (b) DTFT
X(ej! ) = 1
11.7
e
j2!
= 2je
j!
sin(!)
Yes, X(ej! ) is periodic of period 2⇡ since ! + 2k⇡ = !. |X(ej! )| = 2| sin(!)| is periodic of
|X(ej! )|
⇡
!
⇡
\X(ej! )
⇡
!
⇡
Figure 11.1: Problem 7: Magnitude and phase of X(ej! )
period ⇡, but also periodic of period 2⇡.
(b) Phase
\X(ej! ) =
⇢
! + ⇡/2
! + 3⇡/2 =
!
⇡/2
if sin(!) > 0
if sin(!)  0
and because of the odd symmetry of the phase it is zero at ! = 0. See Fig. 11.1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.8
11.8
(a) DTFT
X(ej! )
=
X(z)|z=ej! = (z 2 + z + 1 + z
=
1 + 2 cos(!) + 2 cos(2!)
1
+z
2
)|z=ej!
Magnitude values
!
0
±⇡/2
±⇡
|X(ej! )|
5
1
1
(b) Down-sampled signal
x1 [n] = x[2n] =
⇢
1
0
1n1
otherwise
X1 (ej! ) = 1 + 2 cos(!)
Magnitude values
|X1 (ej! )|
3
1
1
!
0
±⇡/2
±⇡
Aliasing occurs since
0.5X(ej!/2 ) = 0.5[1 + 2 cos(!/2) + 2 cos(!)] 6= 1 + 2 cos(!) = X1 (ej! )
Passing x[n] through an ideal LPF of bandwidth ⇡/2 we can decimate it without aliasing, although
losing the higher frequency components.
(c) Up-sampled signal
x2 [n]
X2 (ej! )
=
⇢
x[n/2]
0
n even
otherwise
=
X2 (z)|z=ej! = z 4 + z 2 + 1 + z
=
1 + 2 cos(2!) + 2 cos(4!)
2
+z
here X2 (ej! ) = X(ej2! ).
Copyright 2014, Elsevier, Inc. All rights reserved.
4
|z=ej!
Chaparro — Signals and Systems using MATLAB
11.9
(a) If Ĥ(ej! ) = A[u(! + !0 )
response
!0 )] with zero phase. To determine A and !0 find the impulse
u(!
ĥ[n] =
11.9
A
2⇡
Z
!0
ej!n d! =
!0
so !0 = ⇡/3 and A = 1 and since h[n] = ĥ[n
H(ej! ) = e
j10!
Ĥ(ej! ) = e
so the magnitude and phase responses are
⇢
1
j!
|H(e )| =
0
\H(ej! ) =
(b) X(ej! ) = e
j!
Y (ej! )
10!
+ ⇡ (! + ⇡/5) + ⇡ (!
A
sin(!o n)
⇡n
10] we have
j10!
[u(! + ⇡/3)
u(!
⇡/3)]
⇡/3  !  ⇡/3
otherwise in
⇡<!⇡
⇡<!⇡
⇡/5) then
=
X(ej! )H(ej! )
=
H(ej! )e
j!
+ ⇡H(e
=
H(ej! )e
j!
+ ⇡ej10⇡/5 (! + ⇡/5) + ⇡e
=
H(ej! )e
j!
+ ⇡ (! + ⇡/5) + ⇡ (!
j⇡/5
) (! + ⇡/5) + ⇡H(ej⇡/5 ) (!
j10⇡/5
(!
⇡/5)
and
y[n]
=
h[n
1] + cos(⇡n/5)
1<n<1
Copyright 2014, Elsevier, Inc. All rights reserved.
⇡/5)
⇡/5)
Chaparro — Signals and Systems using MATLAB
11.10
11.10
(a) The Z-transform
1
X(z) =
1
1
z
|z| > | |
So when
1 the region of convergence does not include the unit circle so the DTFT X(ej! )
cannot be found. If < 1, the ROC includes the UC and
X(ej! ) = X(z)|z=ej!
(b) We have
i. The inverse is
Z
1
x[n] =
2⇡
ii. The inverse is
x1 [n] =
1
2⇡
Z
⇡
(!)ej!n d! =
⇡
⇡
(!
⇡)ej!n d! =
⇡
1
2⇡
( 1)n
2⇡
iii. (!) = ( !) so x2 [n] = 2x[n] = 1/⇡.
(c) Yes, cross-multiplying
(1 + e
j!
+ ··· + e
when N = 1 we get an identity, 1 = (1
j!(N
e
1)
j!
)(1
)/(1
e
e
j!
)=1
j!
e
).
Copyright 2014, Elsevier, Inc. All rights reserved.
j!N
Chaparro — Signals and Systems using MATLAB
11.11
11.11
(a) Frequency response
H(ej! ) =
e
j!
(1 + 2 cos(!))
3
1 + 2 cos(!)
|H(ej! )| =
3
⇢
!
1 + 2 cos(!) 0
\H(ej! ) =
! + ⇡ 1 + 2 cos(!) < 0
(b) Poles and zeros
z2 + z + 1
(z + 0.5)2 + 3/4
=
3z 2
3z 2
p
Poles: z = 0 double, zeros: z1,2 = 0.5 ± j 3/2
H(z) =
the poles are at the origin and the zeros on the unit circle (|z1,2 | = 1. The ROC is the whole
Z–plane except for z = 0.
(c) If 1 + 2 cos(!0 ) = 0, then the magnitude is zero and this happens at !0 = cos
1
( 0.5)
(d) Because the zeros are on the unit circle the difference between discontinuities in the wrapped
phase is not 2⇡, so unwrapping would not change the phase.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.12
11.12
(a) Frequency response
H(ej! ) = e
\H(e ) =
j!
j2!
(1.2 + cos(!))
2! linear, as 1.2 + cos(!) > 0 ! 2 ( ⇡, ⇡]
(b) Impulse response
H(z) = |{z}
0.5 z
h[1]
1
+ |{z}
1.2 z
h[2]
2
+ |{z}
0.5 z
3
h[3]
h[n] is symmetric with respect to n = 2, so the phase is linear.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.13
11.13
(a) Summation:
X1 [k] =
1
1 X
e
5 n= 1
j2⇡nk/5
=
1
(1 + 2 cos(2⇡k/5))
5
Z–transform:
X1 [k] =
1
[z + 1 + z
5
1
]z=ej2⇡k/5 =
1
(1 + 2 cos(2⇡k/5))
5
0k4
The {X1 [k]} are real since the signal is even.
(b) Z-transform
X2 [k] =
1
[2z + 1 + 0.5z
5
1
]z=ej2⇡k/5 =
1 j2⇡k/5
[2e
+ 1 + 0.5e
5
j2⇡k/5
]
0k4
]
0k4
Since the signal is neither even nor odd, the coefficients are complex.
(c) Z-transform
X3 [k] =
1
[0.5z + 1 + 2z
5
2
]z=ej2⇡k/5 =
1
[0.5ej2⇡k/5 + 1 + 2e
5
j2⇡k/5
Since the signal is neither even nor odd, the coefficients are complex.
(d) Z-transform
X4 [k]
=
=
1
1
[ z + z 2 ]z=ej2⇡k/5 = [ ej2⇡k/5 + e
5
5
2j
sin(2⇡k/5), 0  k  4
5
j2⇡k/5
]
The signal is odd so the coefficients are imaginary.
(e) If the period is considered from n = 0 to 4
8
< 1 n = 0, 1
0 n = 2, 3
x1 [n] =
:
1 n=4
1
1
X1 [k] =
[1 + z 1 + z 4 ]z=ej2⇡k/5 = [1 + e
5
5
where in the last term we used e
j8⇡k/5
=e
j10⇡k/5 j2⇡k/5
e
j2⇡k/5
+ e| j8⇡k/5
{z }]
ej2⇡k/5
= 1 ⇥ ej2⇡k/5 . Same as before.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.14
11.14
(a) Each of these signals are periodic and represented by their trigonometric Fourier series, we need
to convert them into their complex exponential form. Only the non-zero coefficients are shown.
x1 [n] = |{z}
1 + ( 0.5) ej2⇡n/3 + ( 0.5) e
| {z }
| {z }
X1 [0]
X1 [ 1]
j2⇡n/3
, !0 = 2⇡/3
X1 [1]
x2 [n] = 2 + cos(2⇡n(3 + 1)/3) = 2 + cos(2⇡n/3)
= |{z}
2 + |{z}
0.5 ej2⇡n/3 + |{z}
0.5 e
X2 [0]
X2 [ 1]
j2⇡n/3
, !0 = 2⇡/3
X2 [1]
x3 [n] = x1 [n] + x2 [n], X3 [0] = 3, X3 [1] = X3 [ 1] = 0, !0 = 2⇡/3
x4 [n] = x2 [n] + 1
x1 [n], X4 [0] = X2 [0] + 1
X1 [0] = 2,
X4 [1] = X4 [ 1] = 1, !0 = 2⇡/3
x5 [n] = cos(2⇡n/6) + cos((2⇡/6)3n),
N0 = 6, !0 = ⇡/3
x5 [n] = |{z}
0.5 ej2⇡n/6 + |{z}
0.5 e
X5 [1]
(b)
Y [k]
=
V [k]
=
=
W [k]
=
=
1
[1 + 0.5z
3
j2⇡n/6
X5 [ 1]
1
+ 0.25z
2
+ |{z}
0.5 ej(2⇡/6)3n + |{z}
0.5 e
X5 [3]
]z=ej2⇡k/3 =
1
[2 + 1.5z
4
1
[2 + 1.5e
4
1
+ 1.25z
j⇡k/2
2
+ 1.125z
+ 1.25e
j⇡k
3
X5 [ 3]
1
[1 + 0.5e
3
1
[0.25z 2 + 0.5z + 1 + 0.5z 1 + 0.25z
5
1
[1 + cos(2⇡k/5) + 0.5 cos(4⇡k/5)]
5
2
j2⇡k/3
]z=ej2⇡k/5
]z=ej2⇡k/4
+ 1.125e
j(2⇡/6)3n
j3⇡k/2
]
Copyright 2014, Elsevier, Inc. All rights reserved.
+ 0.25e
j4⇡k/3
]
Chaparro — Signals and Systems using MATLAB
11.15
11.15
(a) The period of x(t) is T0 = 2 (⌦0 = ⇡). The Fourier series coefficients of x(t) are
Xk
=
1
2
Z
1
e
j⇡kt
dt =
e
j⇡k/2
sin(⇡k/2), k 6= 0
⇡k
0
and X0 = 1/2. x(t) is not band-limited as Xk does not go to zero for finite frequencies.
(b) Assuming ⌦max = 5⇡ corresponding to |X5 | = | sin(5⇡/2)|/(5⇡) ⇡ 1/16 with a power contribution of 1/(16)2 which is much smaller than the dc contribution of 0.25, so it is a good value.
Then ⌦s 10⇡ so that Ts  2⇡/(10⇡) = 0.2.
(c) Let Ts = 0.1, the discretized x(0.1n) has a fundamental period N0 = 21. The discrete Fourier
series coefficients are
X[k]
=
=
X[0]
=
X[1]
=
10
1 X
e
21 n=0
j2⇡nk/21
=
1 1
21 1
e
e
j⇡22k/21
j2⇡k/21
e j⇡11k/22 sin(⇡11k/21)
21e j⇡k/21 sin(⇡k/21)
11
⇡ X0 = 0.5
21
e j11⇡/22 sin((11/21)⇡)
e
⇡
j⇡/21
sin(⇡/21)
21e
21e
j⇡/2
j⇡/21
sin(⇡/2)
= X1
⇡/21
where we let 11/21 ⇡ 1/2 and sin(⇡/21) ⇡ ⇡/21.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.16
11.16
(a) If x[n] is periodic of fundamental period N0 its DTFT is
X(ej! ) =
NX
0 1
2⇡X[k] (!
k!0 ), !0 = 2⇡/N0
k=0
then the DTFT of the output would be
Y (ej! ) =
NX
0 1
k=0
2⇡ X[k]H(ejk!0 ) (!
|
{z
}
k!0 )
Y [k]
From the given y[n] the frequency is !0 = 0.2⇡ = 2⇡/N0 so N0 = 10.
(b) We have
y[n]
=
4
X
X[k]H(ejk!0 )ej2⇡kn/10
k= 5
=
X[0]H(ej0 ) +
4
X
X[k]H(ejk!0 )ej2⇡kn/10 +
k=1
1
X
X[k]H(ejk!0 )ej2⇡kn/10
k= 5
which compared with the given
y[n] = 1+2 cos(2⇡n/N0 )+1 cos(4⇡n/N0 ) = 1+ej2⇡n/N0 +e
j2⇡n/N0
+0.5ej4⇡n/N0 +0.5e
j4⇡n/N0
gives that
k=0
k = ±1
k = ±2
X[0]H(ej0 ) = 1
X[1]H(ej!0 ) = X[ 1]H(e j!0 ) = 1
X[2]H(ej2!0 ) = X[ 2]H(e j2!0 ) = 1/2
and others are zero. There are many possible answers, one is when we let the filter have H(ej0 ) =
H(ej!0 ) = H(e j!0 ) = 1 and H(ej2!0 ) = H(e j2!0 ) = 1/2 then X[0] = X[1] = X ⇤ [ 1] =
X[2] = X ⇤ [ 2] = 1 and the rest are zero. This gives a signal
x[n] = 1 + 2 cos(2⇡n/10) + 2 cos(4⇡n/10)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.17
11.17
(a) The impulse response is h[n] = (1/3)[ [n] + [n
x[n 1] + x[n 2]) for n 0, so
1] + [n
2] so that y[n] = (1/3)(x[n] +
y[0] = (1/3)(x[0] + x[ 1] + x[ 2]) = 0
y[1] = (1/3)(x[1] + x[0] + x[ 1]) = 0
y[2] = (1/3)(x[2] + x[1] + x[0]) = 0
(b) Convolution sum:
Impulse response h[n] = (1/3)( [n] + [n
y[n]
=
n
X
x[k]h[n
k] =
k= 1
=
1] + [n
2])
n
1 X
x[k]( [n
3
k] + [n
k
1] + [n
k
2]
k= 1
1
(x[n] + x[n
3
1] + x[n
2])
which is the average of three consecutive values of x[n] or 0. The steady state is y[n] = 0 which
is attained at n = 0.
(c) The Fourier series coefficients of x[n] are
X[k]
=
=
1
(1 2z 1 + z 2 )|z=ej2⇡k/3
3
e j2⇡k/3 j2⇡k/3
(e
2 + e j2⇡k/3 ) =
3
giving X[0] = 0 and X[1] = X ⇤ [ 1] =
!0 = 2⇡/3. So that
X(ej! )
=
=
F[
1
X
k= 1
1
X
j2⇡k/3
[1
3
j2⇡/3
(2/3)e
X[k]ejk!0 n ] =
2e
(1
cos(2⇡k/3)]
cos(2⇡/3)) = e
2⇡X[k] (!
k!0 )
k= 1
2⇡X[ 1] (! + !0 ) + 2⇡X[1] (!
!0 )
The filter frequency response is
H(ej! ) =
e
j!
3
(ej! + 1 + e
j!
)=
e
j!
3
(1 + 2 cos(!))
giving H(ej0 ) = 1, H(ej2⇡/3 ) = 0. Thus the output is
Y (ej! ) = X(ej! )H(ej! ) = 2⇡X[ 1]H(ej2⇡/3 ) + 2⇡X[1]H(e
Copyright 2014, Elsevier, Inc. All rights reserved.
j2⇡/3
)=0
j2⇡/3
, and
Chaparro — Signals and Systems using MATLAB
11.18
11.18 See Fig. 11.2. Going in the clockwise direction for each shifted signal starting at the east location, at
n = 0, gives the values of the signal.
x[n]
x[n
3
2
2]
1
0
0
2
1
x[n + 2]
3
0
1
x[ n]
1
2
2
0
3
3
x[ n + 1] 2
3
1
0
Figure 11.2: Problem 18: Circular representation of periodic signals.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.19
11.19
(a) x[n]y[n] = 1 + ej!0 n + ej2!0 n + ej3!0 n for !0 = 2⇡/N .
(b) The periodic convolution of length N = 3, Z[k] = Xk ~N Yk , gives Z[0] = 2, Z[1] = 1, Z[2] = 1
(See Fig. 11.3) so that
z[n] = 2 + ej!0 n + ej2!0 n
0, 1, 1
N =3
0
1
1, 0, 1
1
1, 1, 0
Figure 11.3: Problem 19 — inside circle: X[k] clockwise; outside circle: Y [ k] anti–clockwise. Outside
circle shifts clockwise giving Z[0] = 2, Z[1] = 1, Z[2] = 1.
If N = 3, !0 = 2⇡/3 and
x[n]y[n] = 1 + ej2⇡n/3 + ej4⇡n/3 + e|j6⇡n/3
{z } = z[n]
1
With N = 3 it is possible to make x[n] and y[n] of the same length.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.20
11.20 See Fig. 11.4.
(a) N0 = 4, v[n] = (x ⇤ x)[n] gives v[0] = 1, v[1] = 2, v[2] = 1, v[3] = 0
(b) N0 = 4, z[n] = x[n] ⇤ x[ n] gives z[0] = 2, z[1] = 1, z[2] = 0, z[3] = 1
1001
N =4
0
0011
0
1
1100
v[n]
1
0110
1001
1
0011
1
0
0
z[n]
1100
0110
Figure 11.4: Problem 20— Top: periodic convolution of x[n] with itself (x[n] in inside circle and x[ n]
in outside circle); bottom: periodic convolution of x[n] wiht x[ n](x[ n] in inside circle, x[ n] in outside
circle). Values of v[n] and z[n] obtained shifting outside circle clockwise and multiplying corresponding
spokes and adding them.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.21
11.21 (i) DFT of length L = 4 of x[n]
X[k]
=
L
X1
x[n]e
j2⇡nk/L
n=0
=
2
X
e
j2⇡nk/4
=
n=0
=
j2⇡3k/4
x[n]e
j2⇡nk/4
n=0
⇢
3
(1
(ii) DFT of length L = 4 of x1 [n] = x[n
Method 1– using the shift property
X1 [k]
3
X
j2⇡3k/4
e
)/(1
e
j2⇡k/4
k=0
k = 1, 2, 3
)
3] can be done in two different ways
=
X[k]e
= (1 + e
=
e
j(2⇡/4)3k
=
e
j2⇡3k/4
=
1 + 2 cos(⇡k/2)
+e
j(2⇡/4)k
+e
j(2⇡/4)2k
j(2⇡/4)4k
+e
j(2⇡/4)(4+1)k
j2⇡k/4
=e
j(8 2)⇡k/4
+1+e
j(2⇡/4)3k
)e
+1+e
j2⇡k/4
Method 2 – using circular shift: a period of the periodic extension of period L = 4 is
x̃1 [n] = [n] + [n
which gives
X1 [k] = 1 + e
1] + [n + 1]
j2⇡k/4
+ ej2⇡k/4
(iii) Using the circular shift
x̃2 [n] = [n] + [n
so
X2 [k] = 1 + e
j4⇡k/4
+e
2] + [n
j(8 2)⇡k/4
3]
=1+e
j⇡k
+ ej⇡k/2
Another way is using the property that the DFT of x[ n] is X[ k] if X[k] is DFT of x[n]
X2 [k] = X[ k] = 1 + ej2⇡k/4 + ej4⇡k/4 = 1 + ej⇡k/2 + ej⇡k
(iv) Using circular shift x̃3 [n] = [n
X3 [k] = e
j2⇡k/4
+e
1] + [n
j2⇡2k/4
2] + [n + 1] so
+ ej2⇡k/4 = e
j2⇡k/4
+e
j⇡k
Copyright 2014, Elsevier, Inc. All rights reserved.
+ ej2⇡k/4
Chaparro — Signals and Systems using MATLAB
11.22
(a) N = 3, z[n] = (x ⇤ y)[n] (See top of Fig.
2
3 2
z[0]
1 4
4 z[1] 5 = 4 2 1
z[2]
4 2
11.22
11.5)
32
3 2
3
2
1
3.5
4 5 4 0.5 5 = 4 3.5 5
1
0.25
5.25
(b) N = 4, w[n] = (x ⇤ y)[n] (See bottom of Fig. 11.5)
2
3 2
32
3 2
w[0]
1 0 4 2
1
2
6 w[1] 7 6 2 1 0 4 7 6 0.5 7 6 2.5
6
7 6
76
7 6
4 w[2] 5 = 4 4 2 1 0 5 4 0.25 5 = 4 5.25
w[3]
0 4 2 1
0
2.5
3
7
7
5
241
N =3
0.25
1
124
0.5
412
2401
N =4
0
4012
1
0.25
0.5
1240
0124
Figure 11.5: Problem 22: y[n] in the inside circle and x[ n] in outside circle shifting clockwise.
(c) N = 5, v[n] = (x ~ y)[n]
2
3 2
v[0]
6 v[1] 7 6
6
7 6
6 v[2] 7 = 6
6
7 6
4 v[3] 5 4
v[4]
1
2
4
0
0
0
1
2
4
0
0
0
1
2
4
4
0
0
1
2
2
4
0
0
1
32
76
76
76
76
54
1
0.5
0.25
0
0
3
2
7 6
7 6
7=6
7 6
5 4
1
2.5
5.25
2.5
1
3
7
7
7
7
5
(d) The linear convolution would be of length 3 + 3 1 = 5 which is the length of the third circular convolution so the results of that convolution will coincide with the results of the linear
convolution.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.23
11.23
(a) M = N = 1, then x[n] = [n], so X(ej! ) = 1 and the DFT
X[k] = X(ej! )|!=2⇡k/1 = 1, k = 0
Plotting X(ej! ) we get a constant 1 for ⇡  ! < ⇡ and repeats periodically with period 2⇡.
X[k] will only appear at 0 and multiples of 2⇡.
(b) If M = 1 but now N = 10 we have
X[k] = X(ej! )|!=2⇡k/10 = 1, 0  k  9
which appears more dense than before, as 10 values of 1 appear between 0 and 2⇡. The frequency
resolution has been increased.
If M = 1 and N = 1024, we now have a closer approximation to X(ej! ) as 1024 values appear
between 0 and 2⇡.
X[k] = X(ej! )|!=2⇡k/1024 = 1, 0  k  1023
(c) For M = 10, x[n] = u[n]
X(ej! ) =
9
X
e
j!n
n=0
u[n
=
10] has a larger time support than before. We have
1 e j10!
=e
1 e j!
j4.5!
sin(5!)
, ! 6= 0, X(ej0 ) = 10
sin(!/2)
the N-DFT is
X[k] =
⇢
10, k = 0
e j9⇡k/N sin(10⇡k/N )/ sin(⇡k/N ), k = 1, ..., N
1
For N = 10, we get
X[k] =
⇢
10
k=0
j9⇡k/10
e
sin(⇡k)/ sin(⇡k/10) = 0 k = 1, · · · , 9
corresponding to the minimum length L = N , and displaying a DFT as if it were a constant,
i.e., it is a discrete delta function, close to time aliasing. If N >> 10 the sinc function will start
appearing. If N < 10 there is time aliasing.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.24
11.24
(a) Matrix equation

X[0]
X[1]
=

1
1
1
1

1
1
which gives X[0] = 2 and X[1] = 0. Since det(F) = 2 6= 0 the matrix is invertible with inverse
0.5FT = 0.5F and


X[0]
x[0]
1
F
=
X[1]
x[1]
(b) We have
FT
F=I
|det(F)|
| {z }
F
so ↵ = 2.
1
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.25
(a) The convolution sum
y[n] =
11.25
n
X
h[n
k]x[k]
k=0
can be written
2
6
6
6
6
4
y[0]
y[1]
y[2]
y[3]
y[4]
3
2
7 6
7 6
7=6
7 6
5 4
h[0]
h[1]
h[2]
0
0
0
h[0]
h[1]
h[2]
0
0
0
h[0]
h[1]
h[2]
0
0
0
h[0]
h[1]
0
0
0
0
h[0]
or defining the appropriate vectors and matrix as
32
76
76
76
76
54
x[0]
x[1]
0
0
0
3
7
7
7
7
5
y = Hx
When replacing the values of the impulse response and the input gives the output.
2
3
2
32
3
2/3
1 0 0 0 0
2
6
6
76
7
1 7
6
7 1 6 1 1 0 0 0 76 1 7
6
7 = 6 1 1 1 0 0 76 0 7
1
6
7
6
76
7
4 1/3 5 3 4 0 1 1 1 0 5 4 0 5
0
0 0 1 1 1
0
(b) In matrix equations
Y
=
Fy
=
FHx
1
FH(F⇤ )T X
det F
=
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.26
11.26
(a) Letting M = 3 be the minimum length of x[n] and L = 3 the length of h[n], then the output
y[n] = (x ⇤ h)[n] would be of length M + L 1 = 5.
(b) Convolution sum
y[0] = 1/3
y[1] = 1/3 + 1/6 = 1/2
y[2] = 1/3 + 1/6 + 1/12 = 7/12
y[3] = 1/6 + 1/12 = 1/4
y[4] = 1/12
y[n] = 0 n
5
(c) Z-transform
Y (z)
=
X(z)H(z) = (1/3) + (1/2)z
+(1/4)z
where y[n] is the multiplier of z
(d) DTFT: Let z = e
j!
n
3
+ (1/12)z
1
+ (7/12)z
2
4
, for 0  n  4.
in equation (11.1).
(e) DFT of length M + L
1 = 5: Let z = ej2⇡k/5 in equation equation (11.1).
Copyright 2014, Elsevier, Inc. All rights reserved.
(11.1)
Chaparro — Signals and Systems using MATLAB
11.27
11.27
(a) The DFTs of length 7 are
H[k]
=
2
X
e
j2⇡nk/7
e
j2⇡nk/7
n=0
X[k]
=
Y [k]
=
3
X
n=0
X[k]H[k] = 1 + 2e
+3e
j6⇡k/7
+ 2e
j2⇡k/7
j8⇡k/7
+ 3e
+e
j4⇡k/7
j10⇡k/7
(b) Yes, the circular convolution coincides with the linear convolution if the DFTs are of length 7,
which is larger than the length of the linear convolution (4 + 3 1 = 6). If N < 6 the two
convolutions will not coincide.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.2
11.28
Problems using MATLAB
11.28 We have
If H(ej! )
h[n]
=
↵2 [n + 2] + ↵ [n + 1] + 1 + ↵ [n
H(ej! )
=
↵2 [ej2! + e
=
1 + 2↵2 cos(2!) + 2↵ cos(!)
j2!
] + ↵[ej! + e
j!
1] + ↵2 [n
2]
]+1
0 for all values of !, its phase is zero. To find ↵ consider the following
H(ej! )
To get that H(ej! )
=
1 + 2↵2 (2 cos2 (!)
2
2
=
1 + 4↵ cos (!)
=
1
=
(3/4)
1) + 2↵ cos(!)
2↵2 + 2↵ cos(!)
2↵2 + [4↵2 cos2 (!) + 2↵ cos(!) + 1/4
2↵2 + (2↵ cos(!) + (1/2))2
0 we then need that
(3/4)
2↵2
0 or that ↵  0.612
The range is then 0  ↵  0.612.
% Pr 11_28
clear all; clf
w=-pi:2*pi/1000:pi; w0=w/pi;
for i=1:800,
alpha=0.001*i
H=1+2*alpha*cos(w)+2*(alpha)ˆ2*cos(2*w);
if min(H)<0.000001,
alpha_min=alpha
break
else
plot(w0,H); axis([min(w0) max(w0) -0.1 4]);grid
hold on
end
end
Copyright 2014, Elsevier, Inc. All rights reserved.
1/4]
Chaparro — Signals and Systems using MATLAB
11.29
4
3.5
3
|H(ejω)|
2.5
2
1.5
1
0.5
0
−1
−0.8
−0.6
−0.4
−0.2
0
ω/π
0.2
0.4
0.6
0.8
1
Figure 11.6: Problem 28
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.30
11.29 (a) According to the eigenfunction property of LTI systems when x[n] = ej!n , y[n] = H(ej! )ej!n so
replacing these in the difference equation
H(ej! )ej!n [1
0.5e
j!
] = ej!n [1
2e
j!
]
canceling ej!n we get
H(ej! ) =
1 2e j!
1 0.5e j!
(b) At ! = 0 we have that
|H(ej0 )| =
1 2
=2
1 0.5
|H(ej⇡ )| =
1+2
=2
1 + 0.5
at ! = ⇡
Finally at ! = ⇡/2 we have
|H(ej⇡/2 )| =
In general,
|H(ej! )|2 =
p
1 + 2j
5
=p
=2
1 + 0.5j
5/4
1 2e j!
1 2ej!
1 2e j! 2ej! (0.5e
=
1 0.5e j! 1 0.5ej!
1 0.5e j! 0.5ej! (2e
j!
j!
1)
=4
1)
so that |H(ej! )| = 2.
(c) The following script computes and plots the magnitude and phase responses
%%% Pr 11_29
clear all; clf
b=[1 -2];
a=[1 -0.5];
[H,w]=freqz(b,a);
figure(1)
subplot(211)
plot(w/pi,abs(H));ylabel(’|H|’)
subplot(212)
plot(w/pi, unwrap(phase(H))); ylabel(’<H’); xlabel(’\omega/\pi’)
(d) H(z) = (1
2z
1
)/(1
0.5z
1
) = (z
2)/(z
0.5), pole z = 0.5 and zero z = 2 which are the
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.31
2
|H|
1.5
1
0.5
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
ω/π
0.6
0.7
0.8
0.9
1
4
<H
3
2
1
0
Figure 11.7: Problem 29: Magnitude and phase of all-pass filter H(ej! ).
inverse of each other.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.32
11.30 (a) Using the eigenfunction property when x[n] = ej!0 n the output is ej!0 n H(ej!0 ) so that for the two
filter we get
1 + e j!0
1 0.5e j!0
1 e j!0
H2 (ej!0 ) =
1 + 0.5e j!0
H1 (ej!0 ) =
When !0 = 0 then
1+1
=4
1 0.5
1 1
H2 (ej0 ) =
=0
1 + 0.5
H1 (ej0 ) =
and when !0 = ⇡/2 then
1 + e j⇡/2
1 j
=
= 0.4 j1.2 = 1.26e j1.25
j⇡/2
1 + 0.5j
1 0.5e
1 e j⇡/2
1+j
H2 (ej⇡/2 ) =
=
= 0.4 + j1.2 = 1.26ej1.25
j⇡/2
1 0.5j
1 + 0.5e
H1 (ej⇡/2 ) =
and finally for !0 = ⇡
1 + e j⇡
1 1
=
=0
1 0.5e j⇡
1 + 0.5
1 e j⇡
1+1
H2 (ej!0 ) =
=
=4
j⇡
1 + 0.5e
1 0.5
H1 (ej⇡ ) =
For frequencies between 0 and ⇡ the magnitude of these filters is computed and plotted by the following
script showing H1 (z) is a low-pass and H2 (z) a high–pass.
%%% Pr 11_30
clear all; clf
b1=[1 1];
a1=[1 -0.5];
[H1,w]=freqz(b1,a1); % low-pass
b2=[1 -1];
a2=[1 0.5];
[H2,w]=freqz(b2,a2); % high-pass
figure(1)
subplot(211)
plot(w/pi,abs(H1));ylabel(’|H_1|’)
subplot(212)
plot(w/pi,abs(H2));ylabel(’|H_2|’);xlabel(’\omega/\pi’)
(b) Letting z = ej!
H2 (z) =
If we write
H2 (z) =
X
n
h2 [n]z
n
1 z 1
= H1 ( z).
1 + 0.5z 1
= H1 ( z) =
X
n
h1 [n]( z)
n
=
X
n
Copyright 2014, Elsevier, Inc. All rights reserved.
h1 [n]( 1)n z
n
Chaparro — Signals and Systems using MATLAB
11.33
then h2 [n] = ( 1)n h1 [n].
(c) For H1 (z) = (1 + z 1 )/(1 0.5z 1 ) the zero is at 1 and the pole at 0.5, while for H2 (z) =
H1 ( z) the zero is at 1 and the pole at z = 0.5. The transformation is changing z by z or ej! to
ej! = ej(! ⇡) .
figure(2)
subplot(211)
zplane(b1,a1)
subplot(212)
zplane(b2,a2)
The transformation shifts poles and zeros to their opposite side of the Z–plane.
4
1
Imaginary Part
|H1|
3
2
1
0
0
−0.5
−1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
4
−3
−2
−1
0
Real Part
1
2
3
−3
−2
−1
0
Real Part
1
2
3
Imaginary Part
1
3
|H2|
0.5
2
0.5
0
−0.5
1
−1
0
0
0.1
0.2
0.3
0.4
0.5
ω/π
0.6
0.7
0.8
0.9
1
Figure 11.8: Problem 30: Magnitude responses of H1 (z) (top) and H2 (z) (left) and corresponding poles and
zeros.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.31 (a) The Z-transform of h[n] is
H(z) =
11.34
1
(1 + z
3
1
2
+z
)
with ROC the whole Z–plane, except the origin, so we can let z = ej! to get
H(ej! ) =
1
e
3
j!
(ej! + 1 + e
j!
)=
1
e
3
j!
(1 + 2 cos(!))
(b)
H1 (ej! )
=
X
h[n]e
j(! ⇡)n
= H(ej(!
⇡)
)=
n
=
1
e
3
j!
(2 cos(!)
1
e
3
j(! ⇡)
(1 + 2 cos(!
⇡))
1)
(c) The frequency response of the two filters is computed and plotted using the following script
1
2
0.8
1
0.6
<H1
|H1|
%% Pr 11_31
clear all;clf
b1=(1/3)*[1 1 1];
b2=(1/3)*[1 -1 1];
[H1,w]=freqz(b1,1);
[H2,w]=freqz(b2,1);
figure(1)
subplot(221)
plot(w/pi,abs(H1));ylabel(’|H_1|’)
subplot(222)
plot(w/pi,angle(H1));ylabel(’<H_1’)
subplot(223)
plot(w/pi,abs(H2));ylabel(’|H_2|’);xlabel(’\omega/\pi’)
subplot(224)
plot(w/pi,angle(H2));ylabel(’<H_2’);xlabel(’\omega/\pi’)
0.4
0.2
−2
0
0.2
0.4
0.6
0.8
−3
1
1
3
0.8
2
0.6
1
<H2
|H2|
0
0
−1
0.4
0.2
0
0
0.2
0.4
0
0.2
0.4
0.6
0.8
1
0.6
0.8
1
0
−1
0
0.2
0.4
0.6
ω/π
0.8
1
−2
ω/π
Figure 11.9: Problem 31: Magnitude and phase of low–pass H1 (z) (top) and high–pass H2 (z) filters
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.35
11.32 The instantaneous frequency is
IF (n) = 2✓n = ⇡n/L
which is a line of slope ⇡/L. Thus it starts at frequency of zero and when n = L the frequency is ⇡.
This is called a linear chirp since its IF is a line.
The script is
%% Pr 11_32
clear all; clf
L=256; n=0:L-1;
theta=pi/(2*L);
x=cos(theta.*n.ˆ2);
X=fftshift(fft(x));
w=[0:L-1]*2*pi/L;w=w-pi;
figure(1)
subplot(211)
stem(n,x);axis([0 L-1 -1.2 1.2]);ylabel(’x[n]’);xlabel(’n’)
subplot(212)
plot(w,abs(X));axis([min(w) max(w) 0 16])
ylabel(’X(eˆ{j\omega})’);xlabel(’\omega’)
The chirp will jam all possible frequencies.
1
x[n]
0.5
0
−0.5
−1
0
50
100
150
200
250
n
X(ejω)
15
10
5
0
−3
−2
−1
0
ω
1
2
3
Figure 11.10: Problem 32: Linear chirp (top) and its magnitude spectrum.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.36
11.33 (a) The desired impulse response is
1
h[n] =
2⇡
Z
⇡/2
1e
j!N j!n
e
d! =
⇡/2
1
⇡(n
N)
sin(⇡(n
N )/2)
for n 6= N , when n = N we get that
h[N ] =
1
2⇡
Z
⇡/2
d! =
⇡/2
⇡
= 0.5
2⇡
So h[n] is symmetric with respect to n = N .
(b) The following script computes and plots the impulse response and computes its DTFT which displays the linear phase.
%% Pr 11_33
N=50;
for n=0:99,
if n==N
h(51)=0.5;
else
h(n+1)=sin(pi*(n-N)/2)/(pi*(n-N));
end
end
M=524;
H=fft(h,M);
n1=0:99;
w=[0:M-1]*2*pi/M;w=(w-pi)/pi;
figure(1)
subplot(211)
stem(n1,h);ylabel(’h[n]’);xlabel(’n’)
subplot(223)
plot(w,fftshift(abs(H)));ylabel(’|H|’);xlabel(’\omega/pi’)
subplot(224)
plot(w,fftshift(unwrap(angle(H))));grid;ylabel(’<H’);xlabel(’\omega/pi’)
(c) Using the modulation theorem hbp [n] = 2h[n] cos(⇡n/2) which gives Hbp (ej! ) = H(ej(!
H(ej(!+⇡/2) ), i.e., the low-pass filter shifted to the center frequencies ±⇡/2.
Copyright 2014, Elsevier, Inc. All rights reserved.
⇡/2)
)+
Chaparro — Signals and Systems using MATLAB
11.37
0.6
h[n]
0.4
0.2
0
−0.2
0
10
20
30
40
50
n
1.5
60
70
80
90
100
0
−50
<H
|H|
1
−100
0.5
−150
0
−1
−0.5
0
ω/π
0.5
1
−200
−1
−0.5
0
ω/π
0.5
1
Figure 11.11: Problem 33: Impulse response (top) and frequency response.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.38
11.34 (a) x[n] = x2 [n] = x1 [2n], so x[n] is x1 [n] down-sampled with a rate of M = 2.
(b) The DTFTs of x[n] and x1 [n] are
1 e j10!
1 e j!
1 e j20!
X1 (ej! ) =
1 e j!
X(ej! ) =
The spectrum when we downsample x1 [n] by M = 2 is
1
1 e
X1 (ej!/2 ) =
2
2(1 e
j10!
j!/2 )
6= X(ej! )
so frequency aliasing occurs in the decimation. The reason is that the spectrum of x1 [n] is not bandlimited to ⇡/2. The following script computes and plots the spectra
%% Pr 11_34
clear all; clf
M=256;n=0:M-1;
x1=[ones(1,20) zeros(1, M-20)];
x2=[ones(1,10) zeros(1,M-10)];
x=x2;
figure(1)
subplot(311)
stem(n(1:25),x1(1:25));title(’x_1[n]’);grid
subplot(312)
stem(n(1:25),x2(1:25));title(’x_2[n]’);grid
subplot(313)
stem(n(1:25),x(1:25));title(’x[n]’); xlabel(’n’);grid
X=fft(x,M);
w=[0:M-1]*2*pi/M;w=(w-pi)/pi;
X1d=0.5*(1-exp(-j*10.*w))./(1-exp(-j.*w/2));
figure(2)
plot(w,fftshift(abs(X)))
hold on
plot(w,abs(X1d),’o’);grid;legend(’|X|’,’|X_{1d}|’)
hold off; xlabel(’\omega/\pi’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.39
10
x1[n]
1
|X|
|X1d|
9
0.5
8
0
0
5
10
15
20
x2[n]
7
6
1
5
0.5
0
0
5
10
15
20
4
3
x[n]
1
2
0.5
1
0
0
5
10
15
n
20
0
−1
−0.8
−0.6
−0.4
−0.2
0
ω/π
0.2
0.4
0.6
0.8
1
Figure 11.12: Problem 34: x1 [n], x2 [n] and x[n] (left) and magnitude spectra of x[n] and its decimated by 2
signal.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.40
11.35 (a) Cascading an interpolator (up–sampler and low–pass filter) and a decimator (low–pass filter and
down–sampler) (see top figure in Fig. 11.13) with the same rate M , the low-pass filters have the same
bandwidth, but the amplitude of the first is M and the second 1. These cascaded filters can be substituted
by the first one of them giving an equivalent system shown at the bottom of Fig. 11.13. (b) If the
x[n]
M Hlp (ej⌅ )
M
Interpolator
x[n]
M
Decimator
MHlp (ej⌅ )
M
y[n]
Hlp (ej⌅ )
M
y[n]
Figure 11.13: Problem 35: Equivalent cascading of interpolator and decimator with same rate M
interpolator and decimator have different rates, an equivalent low-pass filter has the smaller bandwidth
of the filters associated with the interpolator and the decimator. When L = 3 for the interpolator the
bandwidth of the low–pass filter is ⇡/3, while the one for the decimator with M = 2 is ⇡/2, so the
low-pass filter has a bandwidth of ⇡/3. The amplitude is the product of the amplitude of the filter in the
interpolator (L) and the amplitude of the filter in the decimator (1) or L = 3,
x[n]
3
Hlp (ej⌅ )
2
y[n]
Figure 11.14: Problem 35: Equivalent cascading of interpolator and decimator with rates L = 3 and M = 2,
the low–pass filter has a gain of L = 3 and bandwidth of ⇡/3.
(c) Interpolating with L = 3 the input signal with a 100 samples the output is a signal of length 300
samples. Decimating the output of the interpolator with a rate M = 2 the output signal is a signal with
150 samples.
%% Pr 11_35
clear all; clf
load handel
x=y(1:100)’;n=0:99;
figure(1)
subplot(211)
stem(n,x);ylabel(’x[n]’)
y=interp(x,3);
x1=decimate(y,2);N=length(x1);n1=0:N-1;
subplot(212)
stem(n1,x1);ylabel(’x1[n]’);xlabel(’n’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.41
0.2
x[n]
0.1
0
−0.1
−0.2
0
10
20
30
40
50
60
70
80
90
100
0.2
x1[n]
0.1
0
−0.1
−0.2
0
50
100
150
n
Figure 11.15: Problem 35: Interpolation (L = 3) and decimation (M = 2) of top signal x[n]. Notice the
length of the signals, i.e., equivalent to interpolation with L/M = 1.5 factor.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.42
11.36 (a) For the given DTFT we have
\X(ej! ) =
4! for
|X(ej! )| = 2
⇡!⇡
The phase is a line through the origin of the complex plane, with a slope of 4.
(b) The wrapped phase, computed using the range [ ⇡, ⇡) does not appear linear, it shows discontinuities of 2⇡. The unwrapped phase appears linear given that the discontinuities of the wrapped phase are
patched. The following script computes and plots the wrapped and the unwrapped phases:
%% Pr 11_36
clear all; clf
% linear phase
b=[0 0 0 0 1];
[X,w]=freqz(b,1);
figure(1)
subplot(211)
plot(w/pi,angle(X)/pi);ylabel(’ wrapped <X in multiples of \pi’)
subplot(212)
plot(w/pi,unwrap(angle(X))/pi); ylabel(’unwrapped <X in multiples of \pi’)
xlabel(’\omega/\pi’)
wrapped <X in multiples of π
The wrapped and the unwrapped phase are shown in Fig. 11.16.
1
0.5
0
−0.5
unwrapped <X in multiples of π
−1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
ω/π
0.6
0.7
0.8
0.9
1
0
−1
−2
−3
−4
Figure 11.16: Problem 36: Wrapped (top) and unwrapped phases.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.43
11.37 (a) Using
X(ej! ) =
1
X
x[n]e
jn!
n= 1
we have
X(ej0 ) =
1
X
x[n] = 1 + 2 + 3 + 2 + 1 = 9
n= 1
X(ej⇡ ) =
1
X
( 1)n x[n] = 1
2+3
2+1=1
n= 1
(b) By Parseval’s result
1
2⇡
we get that
Z
Z
⇡
⇡
|X(ej! )|2 d! =
X
n
|x[n]|2
⇡
⇡
|X(ej! )|2 d! = 2⇡(1 + 4 + 9 + 4 + 1) = 38⇡
(c) The Z–transform of x[n] is
X(z) = 1 + 2z
1
+ 3z
2
+ 2z
and the DTFT is
X(ej! ) = e
so that the phase is
j2!
3
+z
4
=z
2
[z 2 + 2z 1 + 3 + 2z
2
1
+z
3
6
7
43 + 2 cos(!) + 4 cos(2!)5
|
{z
}
real-valued
2! when above term is positive and
2! ± ⇡ when negative.
Some of the above results are verified using the following script.
%% Pr 11_37
clear all;clf
x=[1 2 3 2 1];
N=256; X=fft(x,N);
w=[0:N-1]*2*pi/N;
figure(1)
subplot(211)
plot(w,abs(X));axis([min(w) max(w) -0.1 10]);grid
ylabel(’|X|’)
subplot(212)
plot(w,unwrap(angle(X)));axis([min(w) max(w) -15 1]);grid
ylabel(’<X’);xlabel(’\omega’)
Copyright 2014, Elsevier, Inc. All rights reserved.
2
]
Chaparro — Signals and Systems using MATLAB
11.44
10
8
|X|
6
4
2
0
0
1
2
3
0
1
2
3
4
5
6
4
5
6
0
<X
−5
−10
−15
ω
Figure 11.17: Problem 37: Magnitude and phase responses for x[n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.38 (a) The DTFT of x[n] = sin(0.1⇡n) = (ej0.1⇡n
X(ej! ) =
1
[ (!
2j
11.45
e
j0.1⇡n
0.1⇡)
)/2j is
(! + 0.1⇡)]
The period of x[n] is 20 since the frequency is 2⇡/20. The signal y[n] can be written
y[n] = sin(0.1⇡n) (u[n]
|
u[n
{z
w[n]
so that by the frequency shifting property
Y (ej! ) =
20]) = w[n] sin(0.1⇡n) = w[n]
}
1 ⇣
W(ej(!
4j
0.1⇡)
)
W(ej(!+0.1⇡) )
ej0.1⇡n
e
2j
j0.1⇡n
⌘
i.e., the spectrum of the rectangular pulse shifted to ±0.1⇡. If instead of 20 we use a very large value,
Y (ej! ) would look similar to the DFT of x[n].
The following script computes and plots the DTFTs of y[n]. If you increase the value of q in N = 20⇥q
to a large value, e.g., 2000, the Y (ej! ) looks like X(ej! ) as many more values are used, i.e., the
frequency resolution is larger.
%% Pr 11_38
q=1;
N=20*q; w=ones(1,N);
n=0:N-1;x=sin(0.1*pi*n);
y=w.*x;
M=524;
Y=fft(y,M);
omega=[0:M-1]*2*pi/M-pi;
figure(1)
subplot(211)
plot(omega,fftshift(abs(Y)));axis([min(omega) max(omega) 0 15])
ylabel(’|Y|’)
subplot(212)
plot(omega,fftshift(unwrap(angle(Y))));axis([min(omega) max(omega) -30 20])
ylabel(’<Y’);xlabel(’\omega’)
(b) The following script is used to compute and plot the window and the spectrum of the windowed
signal. The results are shown in Fig. 11.18.
clear all
N=11;n=-5:5;
w1=1+cos(2*pi*n/N);
x=sin(0.1*pi*n);
z=w1.*x;
M=524;
Z=fft(z,M);
omega=[0:M-1]*2*pi/M-pi;
figure(2)
subplot(311)
stem(n,w1); axis([-5 5 0 1.1*max(w1)]);ylabel(’w_1[n]’);xlabel(’n’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.46
subplot(312)
plot(omega,fftshift(abs(Z)));axis([min(omega) max(omega) 0 5])
ylabel(’|Z|’)
subplot(313)
plot(omega,fftshift(unwrap(angle(Z))));axis([min(omega) max(omega) -30 10])
ylabel(’<Z’);xlabel(’\omega’)
15
w1[n]
2
|Y|
10
0
−5
5
−2
−1
0
1
2
−2
−1
0
n
1
2
3
4
5
2
0
10
−3
−2
−1
0
1
2
3
−3
−2
−1
0
ω
1
2
3
10
0
0
−10
<Z
<Y
−3
3
20
−20
−30
−4
4
−3
|Z|
0
1
−10
−20
−30
−3
−2
−1
0
ω
1
2
3
Figure 11.18: Problem 38: Magnitude and phase spectra of y[n] using a rectangular window (left). Raised
cosine window and magnitude and phase spectra of y1 [n].
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.47
11.39 (a) The FS coefficients of x[n] are computed as
Xk =
N 1
1 X
x[n]e
N n=0
j2⇡nk/N
which can be written in terms of the Z–transform of a period as
Xk =
1
Z(x1 [n]) |z=ej2⇡k/N
N
The Z-transform
X1 (z) =
9
X
0.5n z
n=0
n
=
1
0.510 z
1 0.5z
10
1
so that for N = 10 we have z = ej0.2⇡k and
Xk =
1 0.510 e
10(1 0.5e
j2⇡k
j0.2⇡k )
==
0.1(1
0.510 )(1 0.5ej0.2⇡k )
1.25 cos(.2⇡k)
0k9
%% Pr 11_39
% --- FFT results
N=10;n=0:N-1;x1=0.5.ˆn;
Xk=fft(x1);
k=n;wk=2*pi*k/N-pi;
figure(1)
subplot(311)
stem([x1 x1 x1]);ylabel(’x[n]’);xlabel(’n’)
subplot(312)
stem(wk,abs(Xk))
% --- analytic results
A=0.1*(1-0.5ˆ(10));
Xk1=A*(1-0.5*exp(j*0.2*pi*k))./(1.25-cos(0.2*pi*k))*N;
hold on
stem(wk,abs(Xk1),’r’);axis([-pi pi 0 2.1]); grid
ylabel(’X_k’);xlabel(’w_k’)
hold off
subplot(313)
stem(wk,angle(Xk))
hold on
stem(wk,angle(Xk1),’r’);axis([-pi pi -1 1]); grid
ylabel(’<X_k’);xlabel(’w_k’)
hold off
The results using the FFT and the analytic results coincide. See Fig. 11.19.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.48
x[n]
1
0.5
0
0
5
10
15
n
20
25
30
−3
−2
−1
0
wk
1
2
3
−3
−2
−1
0
wk
1
2
3
Xk
2
1
0
<Xk
1
0
−1
Figure 11.19: Problem 39: Periodic signal and its magnitude and phase line spectra.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.49
11.40 (a) Equation (ii) can be written in matrix form as
X = Sx
where X = [X0 X1 · · · XN 1 ]T is an N vector containing the FS coefficients, x = [x[0]/N x[1]/N · · · x[N
1]/N ]T are the signal values divided by N , and the N ⇥ N matrix S contains the complex exponentials.
Then
x = S 1X
Calling Ŝ = S
1
we would then have
x = ŜX
and then
X = Ŝ
1
x
where ŜS = I, where I is the N ⇥ N unit matrix, i.e., Ŝ and S are orthonormal matrices.
(b) The following script computes the Fourier series coefficients from the first period of the periodic
signal, and computes the first period using the Fourier series. Notice the way the matrix S is generated.
%% Pr 11_40
clear all; clf
x1=[0 1 2 0];
N=4;n=0:N-1;k=n;
S=exp(-j*2*pi.*(n’*k)/N)
Xk=(1/N)*S*x1’
x=inv(S)*N*Xk
S =1.0000
1.0000
1.0000
0.0000 - 1.0000i
1.0000
-1.0000 - 0.0000i
1.0000
-0.0000 + 1.0000i
Xk =
0.7500
-0.5000 - 0.2500i
0.2500 + 0.0000i
-0.5000 + 0.2500i
x =
-0.0000 + 0.0000i
1.0000 + 0.0000i
2.0000 - 0.0000i
-0.0000
1.0000
-1.0000 - 0.0000i
1.0000 + 0.0000i
-1.0000 - 0.0000i
1.0000
-0.0000 + 1.0000i
-1.0000 - 0.0000i
0.0000 - 1.0000i
(c) For N = 4 we can write the Fourier series coefficients multiplied by 4 as
4Xk
=
=
x[0] + x[1]e j2⇡k/4 + x[2]e
n
o
x[0] + x[2]e j2⇡k/2 + e
j2⇡2k/4
j2⇡k/4
n
+ x[3]e
j2⇡3k/4
x[1] + x[3]e
where we have simplified some of the exponentials. Using that e
( j)k we finally obtain
j2⇡k/2
Xk = 0.25 x[0] + x[2]( 1)k + ( j)k x[1] + x[3]( 1)k
j2⇡k/2
o
= ( 1)k and e
0k3
We thus have using the above results
X=
1 ⇥
S x[0]
4
x[1]
x[2]
x[3]
⇤T
=
⇥
1
SP x[0]
4
x[2]
x[1]
Copyright 2014, Elsevier, Inc. All rights reserved.
x[3]
⇤T
j2⇡k/4
=
Chaparro — Signals and Systems using MATLAB
11.50
where 14 SP = S1 and P is a permutation matrix
2
3
2
1 0 0 0
1
7 16 1
1 6
0
0
1
0
7= 6
S1 = S 6
4 4 0 1 0 0 5 44 1
0 0 0 1
1
|
{z
}
P
1
1
1
1
1
j
1
j
3
1
j 7
7
1 5
j
so that
2
3
2
X0
6 X1 7
6
6
7
6
4 X2 5 = S 1 4
X3
3
x[0]
x[2] 7
7
x[1] 5
x[3]
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.51
11.41 (a) For any value of N0 ,
x1 [n] = x[n
N0 ] =
N
X1
Xk ej2⇡(n
N0 )k/N
=
k=0
N
X1
[Xk e
j2⇡N0 k/N 0 j2⇡nk/N
]e
k=0
is periodic of period N and FS coefficients Xk e j2⇡N0 k/N .
(b) Both x[n] and x[n 1] are periodic of the same period N , and
x2 [n] = x[n]
x[n
1] =
N
X1
[Xk (1
e
j2⇡k/N
)]ej2⇡nk/N
k=0
so x2 [n] is also periodic of period N and with FS coefficients Xk (1 e j2⇡k/N )
(c) x3 [n + N ] = x[n + N ]( 1)n+N = x[n]( 1)n ( 1)N , so for it to be periodic of period N , the value
of N should be even so that ( 1)N = 1. Thus, if x[n] is periodic of period an even integer N , then
x3 [n]
=
x[n]( 1)n =
N
X1
Xk ej2⇡n(k
N/2)/N
k=0
N/2 1
=
X
Xm+N/2 ej2⇡nm/N
m= N/2
where we obtained the last equation by letting m = k
(d)(e) The signal x[n] is
x[n] = sgn[cos(0.5⇡n)] =
Its Fourier series coefficients are given by
Xk
=
=
=
=
N/2 which are integers because N is even.
8
>
>
<
>
>
:
1
1
1
1
n=0
n=1
n=2
n=3
1
(1 + z 1 z 2 z 3 )|z=ej⇡k/2
4
1
1
[(1 + ( j)k ( j)2k ( j)3k ] = [(1 + ( j)k
4
4
1
(1
( 1)k )
[(1 ( 1)k ) (1 ( 1)k )j k ] =
(1
4
4
⇢
0
k even
0.5(1 j k ) k odd
giving X0 = X2 = 0 and X1 = 0.5(1
j), X3 = 0.5(1 + j).
%% Pr 11_41
clear all; clf
N=4;n=0:N-1;k=n;
x=sign(cos(2*pi.*n/N));
N0=3; x1=[x(2) x(3) x(4) x(1)];
x2=x-[x(4) x(1) x(2) x(3)]
x3=x.*(-1).ˆn;
Copyright 2014, Elsevier, Inc. All rights reserved.
( 1)k
jk)
(j)k ]
Chaparro — Signals and Systems using MATLAB
11.52
0.8
0.8
0.6
0.6
0
0.4
−0.5
−0.5
0.2
−1
−1
0
0
5
10
15
2
10
15
−1
5
10
n
15
2
0
3
0
1
0
1
2
3
2
3
0.8
0.6
0.6
0
−0.5
0
1
1
|X2|
0
0
0.8
0.5
x3[n]
x2[n]
5
1
1
−2
0
0.4
0.2
−1
|X3|
0
|X1|
1
0.5
|X|
1
0.5
x1[n]
x[n]
n1=0:4*N-1;
figure(1)
subplot(221)
stem(n1,[x x x x]);ylabel(’x[n]’)
subplot(222)
stem(n1,[x1 x1 x1 x1]);ylabel(’x_1[n]’)
subplot(223)
stem(n1,[x2 x2 x2 x2]);ylabel(’x_2[n]’);xlabel(’n’)
subplot(224)
stem(n1,[x3 x3 x3 x3]);ylabel(’x_3[n]’);xlabel(’n’)
subplot(223)
figure(2)
subplot(221)
stem(k,abs(fft(x)/N));ylabel(’|X|’)
subplot(222)
stem(k,abs(fft(x1)/N));ylabel(’|X_1|’)
subplot(223)
stem(k,abs(fft(x2)/N));ylabel(’|X_2|’);xlabel(’k’)
subplot(224)
stem(k,abs(fft(x3)/N));ylabel(’|X_3|’);xlabel(’k’)
0.4
0.2
0.2
0
5
10
n
15
0
0.4
0
1
2
3
k
0
k
Figure 11.20: Problem 41: Periodic signals and their magnitude line spectra.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.53
11.42 (a) The Fourier series coefficients are given as
Xk
N 1
1 X
x[n]ej2⇡nk/N
N n=0
=
N 1
N 1
1 X
j X
x[n] cos(2⇡nk/N ) +
x[n] sin(2⇡nk/N )
N n=0
N n=0
=
If x[n] is even of period an even integer N , then
N
X1
x[n] sin(2⇡nk/N )
=
n=0
=
x[0] ⇥ (0) +
N
X1
x[n] sin(2⇡nk/N )
n=1
(x[1] sin(2⇡k/N ) + x[N
1] sin(2⇡k(N
+(x[2] sin(2⇡2k/N ) + x[N
1)/N ))
2] sin(2⇡k(N
2)/N ))
+ · · · + x[N/2] sin(2⇡(N/2)k/N )
For 1  n  N
1 we have that
sin(2⇡k(N
n)/N ) = sin(2⇡k
2⇡kn/N ) = sin( 2⇡kn/N ) =
sin(2⇡kn/N )
and by periodicity
x[n] = x[ n] = x[ n + N ]
i.e., x[1] = x[N
N
X1
1], x[2] = x[N
x[n] sin(2⇡nk/N )
=
2], and so on. Thus
x[1](sin(2⇡k/N )
sin(2⇡2k)/N )) + · · ·
sin(2⇡k/N )) + x[2](sin(2⇡2k/N )
n=0
+x[N/2] sin(⇡k) = 0
so that when x[n] is even, Xk is real. When the period N is odd, instead of the term x[N/2] we have
xbN/2c and xdN/2e, where bN/2c is the integer smaller than N/2 and dN/2e is the integer larger than
N/2, which are equal by the evenness of x[n]. This term is multiplied by the difference of sine terms
which are equal to zero.
When x[n] is odd, we have that
N
X1
x[n] cos(2⇡nk/N )
=
x[0] + (x[1] + x[N
1]) cos(2⇡k/N ) + (x[2] + x[N
2]) cos(4⇡k/N )
n=0
+ · · · + (xbN/2c + xdN/2e) cos(2⇡bN/2ck/N )
where we used
cos(2⇡k(N
n)/N ) = cos(2⇡kn/N )
1nN
and by the oddness and periodicity of x[n] we have that x[0] = 0, and x[n] =
so each of the terms of the above summation is zero, and
Xk =
N 1
j X
x[n] sin(2⇡nk/N )
N n=0
Copyright 2014, Elsevier, Inc. All rights reserved.
1
x[ n] =
x[ n + N ],
Chaparro — Signals and Systems using MATLAB
11.54
i.e., is imaginary.
(b) Independent of the period
x1 [n] = cos(2⇡n/N ) = |{z}
0.5 ej2⇡n/N + |{z}
0.5 e
X1
x2 [n] = sin(2⇡n/N ) =
0.5j e
| {z }
X1
X
j2⇡n/N
1
+ 0.5j e
|{z}
X
j2⇡n/N
j2⇡n/N
1
where the Fourier coefficients are real for even x1 [n] and imaginary for odd x2 [n].
(c) The following script computes and plots the signals and the real and imaginary parts of their Fourier
coefficients for N = 3 (similarly for N = 4).
%% Pr 11_42
clear all; clf
N=3;M=10*N;n=0:M-1;k=n;
x1=cos(2*pi.*n/N);X1k=fft(x1,M)/M;
x2=sin(2*pi.*n/N);X2k=fft(x2,M)/M;
X1kr=real(X1k);X1ki=imag(X1k);
X2kr=real(X2k);X2ki=imag(X2k);
figure(1)
subplot(211)
stem(n,x1)
subplot(223)
stem(k,X1kr);axis([0 M-1 1.1*min(X1kr)
ylabel(’Re[X_{1k}]’);xlabel(’k’)
subplot(224)
stem(k,X1ki);axis([0 M-1 1.1*min(X1ki)
ylabel(’Im[X_{1k}]’);xlabel(’k’)
figure(2)
subplot(211)
stem(n,x2)
subplot(223)
stem(k,X2kr);axis([0 M-1 1.1*min(X2kr)
ylabel(’Re[X_{2k}]’);xlabel(’k’)
subplot(224)
stem(k,X2ki);axis([0 M-1 1.1*min(X2ki)
ylabel(’Im[X_{2k}]’);xlabel(’k’)
1.1*max(X1kr)])
1.1*max(X1ki)])
1.1*max(X2kr)])
1.1*max(X2ki)])
Copyright 2014, Elsevier, Inc. All rights reserved.
11.55
1
1
0.5
0.5
x2[n]
0
−0.5
−1
0
−0.5
0
5
10
15
n
20
25
−1
30
−16
15
n
20
25
30
0.5
2
0.3
0.2
0
2
Re[X2k]
Im[X1k]
Re[X1k]
10
4
0.4
0
−2
5
10
15
k
20
25
0
−6
−6
0
−2
−4
−4
0.1
0
5
x 10
6
0.5
0
−16
x 10
Im[X2k]
x1[n]
Chaparro — Signals and Systems using MATLAB
−0.5
0
5
10
15
k
20
25
0
5
10
15
k
20
25
0
5
10
15
k
20
25
Figure 11.21: Problem 42: Even and odd signals (top) and their corresponding real and imaginary parts of
their line spectra. Notice the imaginary component for even x1 [n] is practically zero. Likewise for the real
part of x2 [n], which is odd.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.56
11.43 (a)–(c) To recover x[n] we need to demodulate y[n] by multiplying it by( 1)n , which gives a low-pass
signal which is then obtained using a low-pass filter. The bandwidth of the low-pass filter is chosen
wide to recover the original signal. It can be reduced when the noise is present.
%% Pr 11_43
clear all; clf
N=100;
% n=0:N-1; x=sign(cos(2*pi.*n/20)); % part
load handel; x=y(1:100)’; x=[x x ]; N=2*N;
n=0:N-1;
A=0.01;
y=(-1).ˆn.*x+A*rand(1,N); n=0:N-1;
figure(1)
subplot(221)
plot(n,x);title(’ Desired signal’); axis([
subplot(222)
plot(n,y); title(’Noisy signal’); axis([ 0
X=fft(x);Y=fft(y);
w=2*pi*[0:N-1]/N-pi;
subplot(223)
plot(w,fftshift(abs(X))); title (’Spectrum
subplot(224)
plot(w,fftshift(abs(Y))); title (’Spectrum
% low-pass filtering
b=fir1(40,0.95);
y1=y.*(-1).ˆn;
z=filter(b,1,y1);
(a)(b)
% part (c)
0 N-1 -0.2 0.2])
N-1 -0.2 0.2])
|X|’); axis([-pi pi 0 7])
|Y|’); axis([-pi pi 0 7])
figure(2)
subplot(211)
plot(n,z); title(’Denoised signal’); axis([ 0 N-1 -0.2 0.2])
subplot(212)
plot(n,z-[zeros(1,40/2) x(1:N-40/2)]); title(’error’); axis([ 0 N-1 -0.2 0.2])
Desired signal
0.2
Noisy signal
0.2
0.1
0.1
0
0
0
−0.1
−0.1
−0.1
−0.2
0
50
100
150
Spectrum |X|
7
−0.2
6
5
5
4
4
3
3
2
2
1
0
0.1
0
50
100
150
Spectrum |Y|
7
6
Denoised signal
0.2
−0.2
0
20
40
60
80
100
120
140
160
180
120
140
160
180
error
0.2
0.1
0
−0.1
1
−2
0
2
0
−2
0
2
−0.2
0
20
40
60
80
100
Figure 11.22: Problem 43 Desired, noisy and denoised signals (top); magnitude spectra |X(ej! )| and
|Y (ej! )|
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.57
11.44 (a) The length of x[n] is 40, so that if 2
40 then
log2 (40) = 5.32 and so we choose =
d5.32e = 6. The following script shows how to do the computations and the plotting when N = 26 and
N = 210 . The results are shown in Fig. 11.25. For the larger N the frequency responses are denser but
of equal shape.
%% Pr 11_44
clear all; clf
n=0:39;x=0.5*n.*(0.8).ˆn;
gamma=6; N=2ˆ(gamma);
X=fft(x,N);w=[0:N-1]*2*pi/N;w=w/pi;
figure(1)
subplot(211)
stem(n,x);axis([0 34 -0.1 1.1]);title(’x[n]’)
subplot(223)
stem(w,abs(X));axis([min(w) max(w) 0 10])
title(’|X|, N=2ˆ6’);xlabel(’\omega/\pi’)
subplot(224)
stem(w,unwrap(angle(X)));axis([min(w) max(w) -6 0.1])
title(’\angle{X}, N=2ˆ{6}’); xlabel(’\omega/\pi’)
%
gamma=10; N=2ˆ(gamma);
X1=fft(x,N);w=[0:N-1]*2*pi/N;
figure(2)
subplot(211)
stem(w,abs(X1));axis([min(w) max(w) 0 10])
title(’|X|, N=2ˆ{10}’);xlabel(’\omega/\pi’)
subplot(212)
stem(w,unwrap(angle(X1)));axis([min(w) max(w) -6 0.1])
title(’\angle{X}, N=2ˆ{10}’); xlabel(’\omega/\pi’)
x[n]
|X|, N=210
10
1
8
0.8
0.6
6
0.4
4
0.2
2
0
0
5
10
15
20
25
6
6
4
2
0.5
1
ω/π
1
2
1.5
0
0
−1
−1
−2
−2
−3
−3
−4
−4
−6
3
ω/π
4
5
6
4
5
6
∠X, N=210
−5
0
0
∠X, N=2
8
0
0
6
|X|, N=2
10
30
−5
0
0.5
1
ω/π
1.5
−6
0
1
2
3
ω/π
Figure 11.23: Problem 44: aperiodic signal x[n] and its magnitude and phase computed with FFT of length
26 (left) and 21 0 (right).
(b) Creating a periodic signal with period x[n] and fundamental period 40 we can compute its DFT
using several periods and dividing the result by the number of periods. The following script show the
case of using 2 and 4 periods. The results are shown in Fig. 11.24
N=40;x2=[x x]; % 2 periods
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.58
M=length(x2);
X2=fft(x2,M)/(M/N);
n1=0:M-1;
w=[0:M-1]*2*pi/M;
figure(3)
subplot(211)
stem(n1,x2);;axis([0 M-1 -0.1 1.1]);title(’x periodic’);xlabel(’n’)
subplot(223)
stem(w,abs(X2));axis([min(w) max(w) 0 10])
title(’|X|, M=2N’);xlabel(’\omega/\pi’)
subplot(224)
stem(w,unwrap(angle(X2)));axis([min(w) max(w) -6 6])
title(’\angle{X},M=2N’); xlabel(’\omega/\pi’)
x3=[x x x x]; % 4 periods
M=length(x3);
X3=fft(x3,M)/(M/N);
n1=0:M-1;
w=[0:M-1]*2*pi/M;
figure(4)
subplot(211)
stem(n1,x3);;axis([0 M-1 -0.1 1.1]);title(’x, 4 periods’);xlabel(’n’)
subplot(223)
stem(w,abs(X3));axis([min(w) max(w) 0 10])
title(’|X|, M=4N’);xlabel(’\omega/\pi’)
subplot(224)
stem(w,unwrap(angle(X3)));axis([min(w) max(w) -6 6])
title(’\angle{X}, M=4N’); xlabel(’\omega/\pi’)
No padding with zeros the periodic signal as it would change the periodicity.
x periodic
x, 4 periods
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0
0
10
20
30
40
n
|X|, M=2N
10
50
60
70
0
6
4
2
6
0
4
0
0
4
−2
2
2
4
ω/π
6
−6
−2
2
−4
0
150
∠X, M=4N
6
8
2
6
100
|X|, M=4N
10
4
8
50
n
∠X,M=2N
0
2
4
ω/π
6
0
−4
0
2
4
6
−6
0
ω/π
2
4
6
ω/π
Figure 11.24: Problem 44: periodic signal with period x[n] and its magnitude and phase calculated considering 2 periods (left) and 4 periods (right).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.59
11.45 (a) When the signal is aperiodic, padding it with zeros increases the number of frequencies, i.e., increases the frequency resolution while the original amplitude values remain the same.
%% Pr 11_45
clear all; clf
x=ones(1,10);
x1=[x zeros(1,10)]; M1=length(x1); X1=fft(x1);
x2=[x zeros(1,100)]; M2=length(x2);X2=fft(x2,M2);
w1=[0:M1-1]*2*pi/M1;n1=0:length(x1)-1;
w2=[0:M2-1]*2*pi/M2;n2=0:length(x2)-1;
figure(1)
subplot(221)
stem(n1,x1); axis([0 max(n1) 0 1.1]);ylabel(’x_1[n]’)
subplot(222)
stem(n2,x2); axis([0 max(n1) 0 1.1]);ylabel(’x_2[n]’)
subplot(223)
stem(w1,abs(X1));axis([0 2*pi 0 12]);ylabel(’|X_1|’)
subplot(224)
stem(w2,abs(X2)); axis([0 2*pi 0 12])
(b) When the signal is periodic, the fundamental frequencies do not change by considering several
periods, zeros appear in between them. The amplitudes at the fundamental frequencies increases as the
number of periods being considered increases. When padding zeros to a period, the signal is corrupted
and its spectrum changes. See plots on the right of Fig. 11.25. Notice that x3 [n] which is a period of
x1 [n] padded with 10 zeros does not satisfy the above properties of periodic signals.
% part (b)
clear all
N=5; M=N; n=0:M-1;
x1=cos(pi*n/5);
X1=fft(x1); w1=[0:M-1]*2*pi/M;
x2=[x1 x1 x1 x1 x1 x1 x1 x1 x1 x1];
M=10*N;w2=[0:M-1]*2*pi/M;
X2=fft(x2)
x3=[x1 zeros(1,10)];
X3=fft(x3);
M=length(x3);w3=[0:M-1]*2*pi/M;
figure(2)
subplot(311)
stem(w1,abs(X1));axis([0 2*pi 0 3.2]);ylabel(’|X_1|’)
subplot(312)
stem(w2,abs(X2));;axis([0 2*pi 0 32]);ylabel(’|X_2|’)
subplot(313)
stem(w3,abs(X3));axis([0 2*pi 0 3.2]);ylabel(’|X_3|’)
xlabel(’\omega (rad)’)
Copyright 2014, Elsevier, Inc. All rights reserved.
11.60
3
1
0.8
0.6
0.6
1
0.4
0.4
0
0.2
0.2
|X1|
1
0.8
x2[n]
x1[n]
Chaparro — Signals and Systems using MATLAB
2
0
1
2
3
4
5
6
0
1
2
3
4
5
6
0
1
2
4
5
6
30
0
5
10
0
15
0
5
10
15
12
12
10
10
8
8
6
4
2
2
0
0
2
4
6
10
0
3
6
4
0
20
|X3|
|X2|
|X1|
|X2|
0
2
1
0
2
4
6
0
3
ω (rad)
Figure 11.25: Problem 45: Improving the frequency resolution of an aperiodic signal (left) and of a periodic
signal.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.61
11.46 (a) The impulse response of the IIR filter appears to taper down around n = 30 so the approximation of
the impulse response seems good.
%% Pr 11_46
clear all;clf
x=ones(1,50);
b=[1 0.5 0]; a=[1 -1.755 0.81];
delta=[1 zeros(1,30)];
h=filter(b,a,delta);
N=128;
X=fft(x,N);H=fft(h,N);
Y=X.*H; y=real(ifft(Y));
figure(1)
subplot(311)
stem([x zeros(1,10)])
subplot(312)
stem([h zeros(1,10)])
subplot(313)
stem(y)
(b)(c) In this case we do not truncate the impulse response, and the results y1 [n] are better than before
y[n], (the control is the solution obtained using filter, yc [n]). See right figure in Fig. 11.26. The error
is clearly seen when compared to the first result, but there is no visible error when compared to the
second.
% part 2
X=fft(x,N);A=fft(a,N);B=fft(b,N);
Y1=X.*B./A;
y1=ifft(Y1);
yc=filter(b,a,x);
figure(2)
subplot(211)
plot(y)
hold on
plot(yc,’r’);grid
hold off
subplot(212)
plot(y1)
hold on
plot(yc, ’r’); grid
hold off
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.62
1
40
0
y1[n], yc[n]
x[n]
30
0.5
0
10
20
30
40
50
20
10
60
0
h[n]
4
3
−10
0
20
40
60
0
20
40
60
80
100
120
140
80
100
120
140
40
5
10
15
20
25
30
35
40
30
y1[n],yc[n]
0
30
y[n]
0
2
1
20
10
20
10
0
0
0
20
40
60
80
100
120
−10
n
n
Figure 11.26: Problem 46: Input x[n], impulse response ĥ[n] and output y[n] (left); right: exact response
compared to solution when h[n] is truncated (top) and when it is not (bottom)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
11.63
11.47 (a)(b) Plotting x[m] and y[n m] (y[m] reversed and shifted to the right n samples), multiplying them
and adding the overlapping values gives z[n] = (x ⇤ y)[n], the linear convolution. See results of the
script below. The values are also obtained by multiplying the Z-transforms X(z) and Y (z) giving
Z(z) = X(z)Y (z) = z
1
+ 3z
2
+ 6z
3
+ 5z
4
+ 3z
5
which is the DTFT of z[n] when z = ej! (the coefficients of Z(z) coincide with the values from the
linear convolution.
(c) For N = 4 the circular convolution is graphically done as follows. The inner circle corresponds to
x[m] and the outer circle to y[n m] (reversed and shifted clockwise), and at each shift the corresponding values are multiplied and added. The results are z[0] = 5, z[1] = 4, z[2] = 3, and z[3] = 6, which
N =4
1, 1, 0, 1
z[0] = 5
3
1, 0, 1, 1
z[1] = 4
1, 1, 1, 0
2
0
z[2] = 3
1
z[3] = 6
0, 1, 1, 1
Figure 11.27: Problem 47: Circular convolution for N = 4.
do not coincide with the values from the linear convolution, this is because N = 4 < length[x[n]] +
length[y[n]] 1 = 6.
For the other values of N , bigger than 6, a similar graphical procedure is used, but in these cases the
results of the circular and the linear convolutions coincide.
(d) If we let z = ej2⇡k/N we obtain from the result in (a) that
X(k)Y (k) = e
j1(2⇡k/N )
+ 3e
j2(2⇡k/N )
+ 6e
j3(2⇡k/N )
+ 5e
j4(2⇡k/N )
+ 3e
j5(2⇡k/N )
Now if N = 4, e j4(2⇡k/4) = e j0(2⇡k/4) and e j5(2⇡k/4) = e j1(2⇡k/4) so that the above can be
written as
X(k)Y (k) = 5 + (1 + 3)e j1(2⇡k/N ) + 3e j2(2⇡k/N ) + 6e j3(2⇡k/N )
The coefficients of the DFT correspond to the values given by the circular convolution of length N = 4.
If N = 7 > 6 we have
X(k)Y (k) = e
j1(2⇡k/7)
+ 3e
j2(2⇡k/7)
+ 6e
j3(2⇡k/7)
+ 5e
j4(2⇡k/7)
+ 3e
j5(2⇡k/7)
and its coefficients correspond to the circular convolution results with N = 7 and also coincide with
the ones from the linear convolution. Likewise, for N = 10 > 6 we get
X(k)Y (k) = e
j1(2⇡k/10)
+ 3e
j2(2⇡k/10)
+ 6e
j3(2⇡k/10)
+ 5e
j4(2⇡k/10)
+ 3e
j5(2⇡k/10)
In the cases when N > 6 there is no simplification of the exponentials, as in the case for N < 6, and
as such the circular and the linear convolutions coincide. The implementation using the fft function is
shown below.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
%% Pr 11_47
clear all; clf
x=[0 1 2 3 ];
y=[1 1 1 ];
z=conv(x,y); % linear convolution
n=0:9;
figure(1)
subplot(311)
stem(n,[x zeros(1,6)]);title(’x[n]’);grid
subplot(312)
stem(n,[y zeros(1,7)]);title(’y[n]’);grid
subplot(313)
stem(n,[z zeros(1,4)]);title(’z[n]=(x*y)[n]’);grid
% circular convolutions
figure(2)
for i=1:3,
if i==1,
N=4;subplot(311)
elseif i==2,
N=7;subplot(312)
else
N=10;subplot(313)
end
X=fft(x,N);
Y=fft(y,N);
Z=X.*Y;
z=ifft(Z);M=length(z);
stem(n,[z zeros(1,10-M)])
if i==1,
title(’circular conv N=4’);grid
elseif i==2,
title(’circular conv N=7’);grid
else
title(’circular conv N=10 ’);grid
end
end
Copyright 2014, Elsevier, Inc. All rights reserved.
11.64
Chaparro — Signals and Systems using MATLAB
x[n]
3
11.65
2
4
1
2
0
0
1
2
3
4
5
6
7
8
9
y[n]
1
circular conv N=4
6
0
0
1
2
3
4
5
6
7
8
9
6
7
8
9
6
7
8
9
circular conv N=7
6
4
0.5
2
0
0
1
2
3
4
5
6
7
8
9
z[n]=(x*y)[n]
6
0
4
2
2
0
1
2
3
4
5
1
2
3
6
7
8
9
0
4
5
circular conv N=10
6
4
0
0
0
1
2
3
4
5
Figure 11.28: Problem 47: Linear convolution z[n] of x[n] and y[n] (left). Results of circular convolutions
of x[n] and y[n] for lengths N = 4 (right top), N = 7 and N = 10 (right bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
Copyright 2014, Elsevier, Inc. All rights reserved.
11.66
Chapter 12
Introduction to the Design of Discrete
Filters
12.1
12.1
Basic Problems
(a) The steady-state output is
y1 [n] = |H(ej0 )| + |H(ej0.3⇡ )| cos(0.3⇡n + \H(ej0.3⇡ )) + 23|H(ej0.7⇡ )| sin(0.7⇡n + \H(ej0.3⇡ ))
|H(ej0 )| = 1
|H(ej0.3⇡ )| = 1, \H(ej0.3⇡ ) =
3⇡ =
⇡
|H(ej0.7⇡ )| = 0
so that
y1 [n] = 1 + cos(0.3⇡n
(b) If input is x2 [n] = [n] + 2 [n
⇡) = 1
cos(0.3⇡n)
4] the output is
y2 [n] = h[n] + 2h[n
4]
where the impulse response h[n] corresponding to H(ej! ) is
⇢
Z ⇡/2
1
1/2
h[n] =
e j10! ej!n d! =
sin(⇡(n 10)/2)/(⇡(n
2⇡
⇡/2
10))
(c) The DTFT of the input is
X3 (ej! ) = H(ej!/2 ) = 1 e
so that
j!
j!
j!
Y3 (e ) = X3 (e )H(e ) =
⇢
1
1e
0
j5!
j15!
⇡!⇡
⇡
2
 !  ⇡2
else in
⇡!⇡
n = 10
otherwise.
Chaparro — Signals and Systems using MATLAB
12.2
and y3 [n]
1
y3 [n] =
2⇡
Z
⇡/2
e
⇡/2
j15! j!n
e
d! =
⇢
1/2
sin(⇡(n
15)/2)/(⇡(n
Copyright 2014, Elsevier, Inc. All rights reserved.
15))
n = 15
otherwise
Chaparro — Signals and Systems using MATLAB
12.2
12.3
(a) Yes, H(ej! ) > 0 and real with zero phase.
(b) Impulse response
H(ej! ) = |{z}
1.5 + |{z}
0.5 ej2! + |{z}
0.5 e
h[0]
h[ 2]
j2!
h[2]
It can also be found using the IDTFT
Z ⇡
1
h[n] =
(1.5 + cos(2!))ej!n d!
2⇡
⇡
Z ⇡
Z ⇡
1
1
=
1.5ej!n d! +
cos(2!)ej!n d!
2⇡
2⇡
⇡
⇡
which is different from zero for n = 0 and n = ±2, and h[0] = 1.5 and h[ 2] = h[2] = 0.5.
Indeed, then
H(z) = 0.5z 2 + 1.5 + 0.5z
2
H(ej! ) = 1.5 + cos(2!)
The filter is a non-causal FIR.
(c) Since H(ej! ) has zero phase, then H1 (ej! ) = e
and h1 [n] = h[n N ].
jN !
H(ej! ) has linear phase for any N
Copyright 2014, Elsevier, Inc. All rights reserved.
1,
Chaparro — Signals and Systems using MATLAB
12.3
(a) H(z) = h[0](1 + z
3
H(ej! )
1
) + h[1](z
+z
=
h[0](1 + e
=
e
j1.5!
e
j1.5!
=
2
j3!
12.4
) and the frequency response is
j!
) + h[1](e
h[0](e
j1.5!
j1.5!
+e
j2!
+e
)
) + h[1](ej0.5! + e
j0.5!
)
(2h[0] cos(1.5!) + 2h[1] cos(0.5!))
(b) We have
1
H(z) = 1 + z
2
+z
3
+z
3
= (1 + z
1
)+z
1
(1 + z
)
using
1+z
3
z
1
+z
) = (1 + z
1
)(1 + z
= (1 + z
1
)(1
2
) (⇤)
we can write
H(z) = (1 + z
1
)(1
1
z
so that the zeros are z =
non–linear.
2
+z
1
+z
2
)=
(z + 1)(z 2 + 1)
z3
1 and z1,2 = ±j. Because zeros are on unit circle the phase is
(c) We have using the above identity (⇤)
H(z)
=
=
=
Letting ↵ = h[0] and
h[0](1 + z
3
) + h[1](z
h[0](1 + z
1
1
(1 + z
z
2
+z
)(h[0] + (h[1]
2
+z
)
1
) + h[1]z
h[0])z
1
(1 + z
+ h[0]z
2
1
)
)
h[0] and z = ej! we have
= h[1]
H(ej! )
1
)(1
1
=
=
j!/2
e
2e
j!
2 cos(!/2)e
j1.5!
( + 2↵ cos(!))
cos(!/2)( + 2 cos(!))
Since cos(!/2)
0 for ⇡  ! < ⇡, if 2↵ cos(!) +
0 then the phase of the filter would
be 1.5! which is linear. If > 2↵ then the second condition is satisfied. That is, we have the
condition on the impulse response values
h[0] > 2h[0] or h[1] > 3h[0]
h[1]
to guarantee linear phase.
(d) Again letting ↵ = h[0] and
H(z)
with zeros z1 =
h[0] we have
= h[1]
=
(↵ + z
1
+ ↵z
2
)(1 + z
1
)
1 and
z2 +
↵
z+1=0
zeros z2,3 =
/↵ ±
p
( /↵)2
2
4
=
2↵
±
s✓
Copyright 2014, Elsevier, Inc. All rights reserved.
2↵
◆2
1
Chaparro — Signals and Systems using MATLAB
to insure that z2,3 are not on the unit disc we require that ( /2↵)2
1 < 0 the roots are
s
✓ ◆2
z2,3 =
±j 1
2↵
2↵
12.5
1
0 since when ( /2↵)2
having unit magnitude (i.e., on the unit circle).
The zeros shown above are connected in the following way
(z + 1)(↵(z 2 + 1) + z)
z3
zeros z = 1 and roots of ↵(z 2 + 1) + z which satisfy (multiplying by z
h[0] h[1]
z+z 1 =
=
↵
h[0]
H(z) =
1
)
or that if z0 is a zero, 1/z0 is also a zero, and if impose the condition for linear phase they would
not be on the unit disc.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.4
12.6
(a) Poles z = 0 double; zeros z1,2 = e±j⇡/2 = ±j.
(b) Vectors Z~1 (!0 ) and Z~2 (!0 ) go from the zeros to the frequency where we are finding the frequency
response. Likewise, vectors P~1 (!0 ) and P~2 (!0 ) go from the poles to the frequency for which we
are finding the frequency response.
(c) Analytically, |H(ej0 )| = (1
j)(1 + j)/1 = 2. Graphically
p p
|Z~1 (0)||Z~2 (0)|
2 2
j0
|H(e )| =
=
=2
2
~
1
(|P1 (0)|
and the phase would be
\Z~1 (0) + \Z~2 (0)
2\P~1 (0) = (2⇡
)+
+ 0 = 2⇡
so H(ej0 ) = 2. Notice that when ! = 0 then H(ej0 ) = H(z)|z=1 .
(d) Magnitude response: analytically and graphically we have
H(ej⇡/2 ) = 0
H(ej⇡ ) = 2ej0 = 2
The filter is a notch filter with notch frequency ⇡/2.
2
⇥
Figure 12.1: Problem 4: Poles and zeros and vectors to ! = 0 to find H(ej0 ).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.5
12.7
(a) The frequency response is
H(ej! )
=
=
The dc gain gives
e
j!
[ + ↵(ej! + e
e
j!
[ + 2↵ cos(!)]
|H(ej0 )| =
j!
)]
+ 2↵ = 1
For the phase \H(ej! ) = !, we need that + 2↵ cos(!) > 0 for
1  cos(!)  1 and that ↵ > 0, > 0, then
2↵ 
If we let
2
1 or
+ 2↵ cos(!) 
2↵ 0, and use the dc gain condition
1/2 and ↵ = (1
)/2.
(b) For the smallest value of ,
⇡  !  ⇡. Using that
+ 2↵
+ 2↵ = 1, by adding these equations we get
= 1/2, then ↵ = 1/4.
1
H(z) = 0.25 + 0.5z
2
+ 0.25z
=
0.25(z + z
z
1
) + 0.5
the zeros are the values of z satisfying
(z + z
Writing
1
)=
2
H(z) = 0.25(z 2 + 2z + 1)/z 2 = 0.25(z + 1)2 /z 2
the zeros are at 1, double and poles at zero. Notice the zeros satisfy the condition given above.
In general, we have
H(z) = ↵ + z
1
+ ↵z
2
=
↵(z + z 1 ) +
z
the zeros are the values of z satisfying
(z + z
1
)=
↵
which can be written
z2 +
↵
z+1=0
zeros z1,2 =
/↵ ±
p
( /↵)2
2
4
Notice that the relation between the zeros indicates that if z0 is a zero 1/z0 is also a zero.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.6
12.8
(a) Transfer function can be written as
H(z) = |{z}
1 + ( 2.5) z
| {z }
h[0]
thus the impulse response is
1
h[2]
h[1]
h[n] = [n]
2
+ |{z}
1 z
2.5 [n
1] + [n
e
j!
(ej!
2.5 + e
e
j!
(2 cos(!)
2]
(b) Frequency response
H(ej! )
=
=
=
e
j( !±⇡)
j!
)
2.5)
( 2 cos(!) + 2.5)
|
{z
}
>0
so the phase is
\H(ej! ) =
!±⇡
or linear. This corresponds to the impulse response being symmetric about n = 1 and having no
zeros on the unit circle.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.7
12.9
(a) Letting z = ej! we get
H(ej! )
=
0.05(e2j! + e
2j!
) + 0.5(ej! + e
=
1 + cos(!) + 0.1 cos(2!)
j!
)+1
so that the magnitudes for then given frequencies
|H(ej0 )| = |1 + 1 + 0.1| = 2.1
|H(ej⇡/2 )| = |1 + 0
j⇡
|H(e )| = |1
0.1| = 0.9
1 + 0.1| = 0.1
and the phase
\H(ej0 ) = 0
\H(ej⇡/2 ) = 0
\H(ej⇡ ) = 0
The filter is low-pass with zero phase.
(b) The impulse response is
h[n] = 0.05( [n + 2] + [n
2]) + 0.5( [n + 1] + [n
1]) + [n]
which is non-causal as values of h[n] 6= 0 for n < 0.
(c) To make the filter causal we delay h[n] two samples, which does not affect the magnitude but only
the phase
h1 [n] = h[n
2]
) H1 (ej! ) = e
|H1 (ej! )| = |H(ej! )|
\H1 (ej! ) =
2! + \H(ej! ) =
j2!
H(ej! )
2!
The phase now is linear.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.8
12.10
(a) In negative powers of z
H(z)
2
2
2 z(z
1
z
=
z
=
1
(z + 1)
z 1+z
=
0.5)
1 0.5z
1
z
z 2
+
1
0.5z
1 0.5z 1
so that the impulse response is
h[n] = 0.5n
1
u[n
1] + 0.5n
2
u[n
2]
(b) As an IIR filter it would not have linear phase, h[n] is not symmetric.
(c) Poles z = 0 and z = 0.5 and the zero is z =
representation
|H(ej! )| =
1. The magnitude is found using the vectorial
~
|Z(!)|
1 ⇥ |P~ (!)|
~
where Z(!)
is a vector from the zero at 1 to a frequency ! on the unit circle, while P~ (!) is a
vector from the pole at 0.5 to the frequency ! on the unit circle ( the other pole contributes a unity
value for all frequencies). At three frequencies we have
!
0
⇡/2
⇡
|H(ej! )|
2/(1/2)
p =4 p
p
2/ 5/4 = 8/5
0/1.5 = 0
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.11
12.9 This filter is all-pass. Consider
H(z) = H1 (z)H2 (z) =
where the poles z =
|H1 (ej! )|2 =
z+2 z 2
z + 0.5 z 0.5
0.5, 0.5 are the inverses of the zeros z =
(ej! + 2)(e
(ej! + 0.5)(e
j!
j!
2, 2. The magnitude is
+ 2)
2(1 + 0.5ej! )2(1 + 0.5e j! )
= j!
=4
+ 0.5)
e (1 + 0.5e j! )e j! (1 + 0.5ej! )
and likewise for |H2 (ej! )|2 , so that |H(ej! )| = 4.
Magnitude response from vectorial form
|H(ej! )| =
~ 1 (!)Z
~ 2 (!)
Z
~
P2 (!)P~2 (!)
~ i (!), i = 1, 2 are vectors from the zeros to the frequency on the unit circle we are computing
where Z
the magnitude. Likewise P~i (!), i = 1, 2 are vectors from the poles to the frequency on the unit circle.
We thus have
!
|H(ej! )|
0
4
⇡/2
4
⇡
4
The filter is all-pass. The poles are the inverse of the zeros.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.10
12.12
(a)
i. From ↵min = 20 = 20 log10 ( ) then = 10
0.92 = 20 log10 (1
) = 20 log10 0.9.
ii. !p = 0.5⇡ and !st = 0.75⇡
(b)
i. The dc loss ↵(ej0 ) = 10 dB, and subtracting it we get that
1
= 0.1 and it can be verified that ↵max =
↵max = 0.1 dB
↵min = 50 dB.
ii. The maximum frequency 5 kHz fs /2, so the sampling frequency is fs
iii. Using ! = 2⇡f /fs and defining ↵
ˆ (ej! ) = ↵(ej! ) 10 we get
0↵
ˆ (ej! )  0.1 dBs
↵
ˆ (ej! )
50 dBs
0  !  0.4⇡
0.8⇡  !  ⇡
with dc loss of 0 dB.
Copyright 2014, Elsevier, Inc. All rights reserved.
10 kHz.
Chaparro — Signals and Systems using MATLAB
12.11
12.13
(a) The dc gain is |H(j0)| = 1 and the gain at ⌦ = 1 is
1
|H(j1)| = p |H(j0)|
2
so that ⌦ = 1 is the half-power frequency.
(b) K matches the normalized half-power frequency ⌦hp = 1 with the half-power frequency !hp
according to
⌦hp
K=
) !hp = 2 tan (1) = ⇡/2
1
tan (0.5!hp )
(c) Replacing s by the bilinear transformation we get
1
p
|s=(1
s2 + 2s + 1
z
1 )/(1+z
1)
=
(2 +
p
(1 + z 1 )2
p
2) + (2
2)z
(d) The analog H(s) has no zeros, and its poles are
s1,2 = 1e±j3⇡/4
or on the left-hand s-plane.
For the discrete filter,
H(z) =
so zeros are z =
(2 +
p
(z + 1)2
2)z 2 + (2
p
2)
1, double, and poles
z1,2 =
p !1/2
2
2
p
e±j⇡/2
2+ 2
or inside the unit circle. Thus both filters are stable.
Copyright 2014, Elsevier, Inc. All rights reserved.
2
Chaparro — Signals and Systems using MATLAB
12.14
12.12 (a), (b) In rational form
H(z) =
1
X
0.5n z
n
=
n=0
1
1
0.5z
1
=
z
z
0.5
with a zero at z = 0 and a pole at z = 0.5. The filter is a low-pass filter.
H1 (z) =
1
X
( 0.5)n z
n
=
n=0
1
1 + 0.5z
1
=
z
z + 0.5
with zero at z = 0 and pole at z = 0.5. The filter is a high-pass filter, as the frequency response of
h1 [n] = ej⇡n h[n] so that H1 (ej! ) = H(ej(! ⇡) ) which is the low-pass filter shifted to ⇡.
(c) Suppose
X
H(Z) =
h[n]Z n
n
is the transfer function of a LPF, if we let Z =
X
h[n][( 1)z]
n
z = ( 1)z we obtain
X
n
=
(h[n]( 1)n )z
n
n
so that the resulting filter has h[n]( 1)n as impulse response, therefore it is high-pass.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.13
12.15
(a) Differential equation
dy(t)
+ y(t) = x(t)
dt
(b) Replacing s = K(1
z
1
)/(1 + z
1
!
s+1
1
) in H(s) we obtain
1
K(1 z 1 )
1+z 1
=
+1
=
1+z
(1 + K) + (1
1+z 1
Kz 1 + 1 + z
K
1
K)z
=
1
1
Y (z)
X(z)
giving
(1
K)y[n
1] + (1 + K)y[n] = x[n] + x[n
1]
(c) Using Laplace
X(s)
=
Y (s)
=
y(t)
=
1
(1 e 0.5s )
s

X(s)
1
1
=
(1
s+1
s s+1
(1
e t )u(t) + (1
e
e
0.5s
(t 0.5)
)
)u(t
0.5)
(d) The sampled signal is
x(nTs ) =
⇢
1
0
0  2n/K  0.5 or 0  n  0.25K
otherwise
If K = 1000 = 2/Ts = 103 , then x[n] = u[n]
y[n]
=
(999/1001)y[n
=
0.9980y[n
u[n
251] and
1] + (1/1001)(x[n] + x[n
1] + 0.000999(x[n] + x[n
Computing the input
x[n] + x[n
8
1
>
>
<
2
1] =
1
>
>
:
0
n=0
1  n  250
n = 251
otherwise
we use it to find the first three values of y[n]
y[0] = 0.000999
y[1] = 0.0030
y[2] = 0.0050
while the exact values are
y(0) = 0
y(0.002) = 0.0020
y(0.004) = 0.0040
Copyright 2014, Elsevier, Inc. All rights reserved.
1])
1])
Chaparro — Signals and Systems using MATLAB
12.14
12.16
(a) From the realization
X(z)
1 + z 1 + Gz
Y (z)
1+z 1+z 2
Y (z) = E(z)(1 + z 1 + z 2 ) )
=
X(z)
1 + z 1 + Gz 2
E(z) = X(z)
E(z)(z
1
+ Gz
2
) ) E(z) =
2
or
Y (z)[1 + z
1
+ Gz
2
] = X(z)[1 + z
1
+z
2
]
which gives the difference equation:
y[n]
=
y[n
1]
Gy[n
2] + x[n] + x[n
1] + x[n
2]
(b) The transfer function of the filter is
H(z) =
1+z 1+z 2
1 + z 1 + Gz 2
p1,2 =
0.5 ±
with poles
p
1
4G
2
4G < 0 or G > 1/4. The BIBO stability
for these to be complex conjugates we need that 1
requires that |p1,2 | < 1 (inside the unit circle), or
r
1 4G 1
+
<1
4
4
or G < 1. Thus for the system to have complex conjugate poles and to be BIBO stable we need
that 1/4 < G < 1.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.17
12.15 (a) Let
H(z) =
p
2(1 z 1 )
1 + 2z 1 + z 2
1 + 0.5z 1 1 0.9z 1 + 0.81z 2
|
{z
} |
{z
}
H1 (z)
H2 (z)
The cascade realization of H(z) is as shown in Fig. 12.2
x[n]
2
+
+
+
+
+
z
+
1
z
1
p
2
0.9
2
0.5
y[n]
+
z
1
0.81
Figure 12.2: Problem 15: Cascade realization of H(z).
(b) To obtain the parallel realization we do a partial fraction expansion of H(z). Notice that H(z)
is not proper rational and so we have to obtain a constant term before performing the partial fraction
expansion
H(z) =
4.94 +
2.16
1 + 0.5z
1
+
1
4.78
0.9z
1.6z 1
1 + 0.81z
Copyright 2014, Elsevier, Inc. All rights reserved.
2
Chaparro — Signals and Systems using MATLAB
12.18
4.94
2.16
x[n]
y[n]
+
+
z
0.5
1
4.78
+
+
z
1
z
1
1.6
0.9
0.81
Figure 12.3: Problem 15: Parallel realization of H(z).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.19
12.16 Using the variables v[n] and w[n] we obtain the following expressions
g[n] = 2v[n] + 1.8v[n
v[n] = x[n] + 1.3v[n
1] + 0.4v[n
1]
0.8v[n
2]
2]
with Z-transforms
G(z) = (2 + 1.8z 1 + 0.4z
X(z)
V (z) =
1 1.3z 1 + 0.8z
so that
G(z)
2 + 1.8z
=
X(z)
1 1.3z
1
1
+ 0.4z
+ 0.8z
2
)V (z)
2
2
2
.
Thus, the difference equation relating g[n] to x[n] is
g[n] = 1.3g[n
1]
0.8g[n
2] + 2x[n] + 1.8x[n
1] + 0.4x[n
2]
For the second cascade, we have
y[n] = 3w[n] + 4.5w[n
w[n] = g[n] + 0.3w[n
so that
Y (z)
3 + 4.5z
=
G(z)
1 0.3z
1] ) Y (z) = (3 + 4.5z 1 )W (z)
G(z)
1] ) W (z) =
1 0.3z 1
1
1
) y[n] = 0.3y[n
1] + 3g[n] + 4.5g[n
1]
where the term on the right is the difference equation relating y[n] and g[n].
(b) The overall transfer function is
H(z) =
Y (z)
Y (z) G(z)
(3 + 4.5z
=
=
X(z)
G(z) X(z)
(1 0.3z
1
)(2 + 1.8z
1 )(1
1.3z
1
+ 0.4z
1 + 0.8z
Copyright 2014, Elsevier, Inc. All rights reserved.
2
)
2)
Chaparro — Signals and Systems using MATLAB
12.2
12.20
Problems using MATLAB
12.17 (a) The transfer function is
H(z) =
letting z = ej!
H(ej! ) = (↵e
(b) The dc gain is
Y (z)
= (↵z
X(z)
j!
1
+ 1 + ↵z)
+ 1 + ↵ej! ) = (1 + 2↵ cos(!))
H(ej0 ) = (1 + 2↵) = 1
so that
1
1 + 2↵
For the phase to be zero H(ej! )
0 and so we could let > 0, and 1 + 2↵ cos(!)
equation requires that for all ! the amplitude of the cos(!) be 2↵  1 or ↵  1/2.
=
If we let ↵ = 0.5 then
0. The last
= 0.5 and
H(ej! ) = 0.5(1 + cos(!))
having a unit dc and zero phase as H(ej! )
For ↵ = = 0.5, the transfer function is
H(z) = 0.5(0.5z
1
⇡!<⇡
0.
+ 1 + 0.5z) = 0.25z
1
(1 + 2z + z 2 ) = 0.25
so pole z = 0 and double zero z = 1 .
(c) We have that v[n] = y[n 1] = (↵x[n 2] + x[n
previous filter was non-causal. The transfer function
G(z) =
V (z)
=z
X(z)
1
H(z) =
(1 + z)2
z
1] + ↵x[n]) so the new filter is causal. The
0.25(z + 1)2
z2
with double poles at z = 0 and double zero at z = 1. Since H(z) is zero phase, G(z) has linear phase
\G(ej! = !.
The following script computes and plots the frequency responses of the two filters.
%% Pr 12_17
clear all; clf
N=128; w=[0:N/2-1]*(2*pi/N);
H=0.5*(1+cos(w));
figure(1)
subplot(221)
plot(w, abs(H)); axis([0 pi 0 1]); ylabel(’|H|’)
subplot(222)
plot(w,angle(H));axis([0 pi -0.1 0.1]); ylabel(’<H’)
beta=0.5;alpha=0.5;
b=[0.25 0.5 0.25]
[G,w]=freqz(b,1);
subplot(223)
plot(w,abs(G)); axis([0 pi 0 1]); ylabel(’|G|’)
subplot(224)
plot(w,unwrap(angle(G))); axis([0 pi -pi 0]); ylabel(’<G’); xlabel(’\omega’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.21
1
0.1
0.8
0.05
<H
|H|
0.6
0.4
−0.05
0.2
0
0
0
1
2
−0.1
3
1
0
0.8
−0.5
<G
|G|
1
0
1
2
3
2
3
−1
0.6
0.4
−1.5
−2
0.2
0
0
−2.5
−3
0
1
2
ω
3
ω
Figure 12.4: Problem 17: Frequency responses of H(ej! ) (top) and G(ej! ) (bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.22
12.18 (a) We have that
1
(1 + z 1 )2
3
1
4e j!
G(ej! ) = e j! (2 cos(!/2))2 =
0.5(1 + cos(!))
3
3
4
H(ej! ) = G(ej! )G(e j! ) = |G(ej! )|2 = (1 + cos(!))2
9
G(z) =
where we used cos2 (!/2) = 0.5(1 + cos(!)). The phase of H(ej! ) should be zero. Indeed, H(ej! ) is
real and positive for all ⇡  !  ⇡.
(b) If we multiply the polynomials G(z) and G(z 1 ) we get
H(z) =
1 2
(z + 4z + 6 + 4z
9
1
+z
2
)
The impulse response is
h[n] =
1
( [n + 2] + 4 [n + 1] + 6 [n] + 4 [n
9
1] + [n
2])
which is non-causal. It can be made causal by delaying it by 2 samples. Calling
H1 (z) = z
2
H(z) =
2
z
9
(z 2 + 4z + 6 + 4z
1
+z
2
)=
1
(1 + 4z
9
1
+ 6z
2
+ 4z
3
+z
4
)
its impulse response is
h1 [n] = h[n
2] =
1
( [n] + 4 [n
9
1] + 6 [n
2] + 4 [n
3] + [n
4])
which is causal. The phase of this filter is 2! or linear.
(c) The following script computes the phase of H(z). To compute the poles and zeros we consider the
causal filter H1 (z) with 4 poles at zero, and 4 zeros. Since H(z) = z 2 H1 (z) two of the poles of H1 (z)
are cancelled so that H(z) has two poles at zero and the zeros of H1 (z).
%% Pr 12_18
clear all; clf
N=128; w=[0:N/2-1]*(2*pi/N);
H=(4/9)*(1+cos(w)).ˆ2;
figure(1)
subplot(211)
plot(w,angle(H));axis([0 pi -0.1 0.1]);ylabel(’<H’)
b=[1 4 6 4 1];
roots(b)
subplot(212)
zplane(b,1); title(’poles and zeros of H_1(z)’)
(d) To find the coefficients of H(z) = G(z)G(z
z
2
H(z) = G(z)z
2
1
G(z
) we make it causal by multiplying by z
1
)=
1
(1 + 2z
9
1
+z
2
so that
2 2
)
then we use conv to find the coefficients of the product of G(z) with itself. The final result is then
advanced by 2 to get the coefficients of H(z). In MATLAB this is done by
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.23
0.1
<H
0.05
0
−0.05
−0.1
0
0.5
1
1.5
2
2.5
3
2
3
poles and zeros of H1(z)
Imaginary Part
1
0.5
4
0
4
−0.5
−1
−3
−2
−1
0
Real Part
1
Figure 12.5: Problem 18
% convolution sum
g=(1/3)*[1 2 1]; gg=conv(g,g)
which gives
gg = 0.1111
0.4444
0.6667
0.4444
the coefficients of H(z) corresponding to z 2 , z, 1, z
(e) The transfer function is
H(z) =
(1
and
H(ej! ) =
0.5z
1
and z
0.1111
2
.
1
1 )(1
0.5z)
1
1.25 cos(!)
which is real and positive, so its phase is zero. The poles are at z = 0.5 and z = 2 and the zero at z = 0.
If the filter is causal, then its ROC is bigger than 2 and as such it is not stable as the pole at 2 will make
the impulse response grow.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.24
12.19 (a) The impulse responses are
h1 [n] = 0.5 [n] + 0.5 [n
h2 [n] =
0.5 [n]
1] + 2.2 [n
0.5 [n
2] + 0.5 [n
1] + 0.5 [n
3] + 0.5 [n
3] + 0.5 [n
4]
4]
h1 [n] is even with respect to the sample at n = 2, while h2 [n] is odd with respect to the sample at
n = 2.
(b) The transfer function
G(z) = z 2 H1 (z) = 0.5(z 2 + z
so that
2
) + 0.5(z + z
1
) + 2.2
G(ej! ) = cos(2!) + cos(!) + 2.2
which is positive or zero for ! = ( ⇡, ⇡], so it is zero phase. Then H1 (ej! ) = e
\H1 (ej! ) = 2! + 0 = 2!, i.e., linear.
(c) The transfer function
F (z) = z 2 H2 (z) =
0.5(z 2
z
2
)
0.5(z
z
1
j2!
G(ej! ) and
)
so that its frequency response is
F (ej! )
=
ej2! H2 (ej! ) =
=
j sin(2!)
j sin(!) =
which is purely imaginary, so its phase is
⇢
⇡/2
j!
\F (e ) =
⇡/2 ± ⇡
Thus the phase of H2 (z) is
\H2 (e ) =
j!
⇢
2!
2!
0.5(ej2!
⇡/2
⇡/2 ± ⇡
e
j2!
)
0.5(ej!
e
j!
)
j(sin(2!) + sin(!))
when sin(2!) + sin(!) 0
when sin(2!) + sin(!) < 0
when sin(2!) + sin(!) 0
when sin(2!) + sin(!) < 0
and the corresponding group delay is a constant, so the phase of H2 (ej! ) is linear.
The following script computes and plots the impulse responses and the phase responses of the filters.
%% Pr 12_19
clear all; clf
n=0:9;
b1=[0.5 0.5 2.2 0.5 0.5];h1=[b1 zeros(1,5)];
b2=[-0.5 -0.5 0 0.5 0.5];h2=[b2 zeros(1,5)];
[H1,w]=freqz(b1,1);
[H2,w]=freqz(b2,1);
figure(1)
subplot(221)
stem(n,h1);ylabel(’h_1[n]’);axis([0 9 1.1*min(h1) 1.1*max(h1)])
subplot(222)
plot(w, unwrap(angle(H1)));ylabel(’<H1’);axis([0 pi -2*pi 0])
subplot(223)
stem(n,h2);ylabel(’h_2[n]’);axis([0 9 1.1*min(h2) 1.1*max(h2)])
xlabel(’n’)
subplot(224)
plot(w, unwrap(angle(H2)));ylabel(’<H2’);axis([0 pi -2*pi 0])
xlabel(’\omega’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.25
(d) In the above cases the impulse response of the FIRs were symmetric with respect to some sample
value, and could be shifted to get a zero phase or constant phase and then show they have linear phase.
That might not be possible for IIR filters since they might not have the required symmetry or we might
have to shift by a very large value to obtain it.
0
−1
2
−2
<H1
h1[n]
1.5
1
−4
0.5
0
−3
−5
−6
0
2
4
6
8
0
0.5
1
1.5
2
2.5
3
0
0.5
1
1.5
ω
2
2.5
3
0
0.5
−1
<H2
h2[n]
−2
0
−3
−4
−5
−0.5
−6
0
2
4
6
n
8
Figure 12.6: Problem 19: Notice h1 [n] is even with respect to sample at n = 2, and h2 [n] is odd with respect
to sample at n = 2. Linear phases of H1 (ej! ) and H2 (ej! ) (right).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.26
12.20 (a) Clearly H1 (z) has unit magnitude. H2 (z) is all-pass filter: let H2 (z) = (F (z))10 ,
j!
2
|F (e )| =
✓
1 2e j!
0.5
1 0.5e j!
◆✓
◆ ✓
◆✓
1 2ej!
1 2e j!
2ej! (1 0.5e
0.5
=
0.5
0.5
1 0.5ej!
1 0.5e j!
0.5ej! (1 2e
j!
)
j! )
so |H2 (ej! )| = |F (ej! )|10 = 1. Since H2 (z) is the product of F (z) ten times, its coefficients can be
computed using the function conv to find the coefficients.
(b) The following script computes the coefficients of the filters and their frequency responses and then
processes handel.
%% Pr 12_20
clear all; clf
b1=[zeros(1,99) 1];
b=[0.5 -1];a=[1 -0.5];
b2=b;a2=a;
for k=2:10; % computing coefficients of H_2(z)
b2=conv(b,b2);
a2=conv(a,a2);
end
[H1,w]=freqz(b1,1);
[H2,w]=freqz(b2,a2);
figure(1)
subplot(221)
plot(w,abs(H1));ylabel(’|H1|’);axis([0 pi 0 1.2])
subplot(222)
plot(w,unwrap(angle(H1)));ylabel(’<H1’);axis([0 pi -320 0])
subplot(223)
plot(w,abs(H2));ylabel(’|H2|’);axis([0 pi 0 1.2])
subplot(224)
plot(w,unwrap(angle(H2)));ylabel(’<H1’);axis([0 pi -32 0])
load handel; x=y’;
y1=filter(b1,1,x);
y2=filter(b2,a2,x);
figure(2)
subplot(311)
plot(x(1:200));ylabel(’x[n]’);axis([0 199 -0.4 0.4])
subplot(312)
plot(y1(1:200));ylabel(’y_1[n]’);axis([0 199 -0.4 0.4])
subplot(313)
plot(y2(1:200));ylabel(’y_2[n]’);axis([0 199 -0.4 0.4])
xlabel(’n’)
The output of H1 (z) is the input signal delayed 100 samples, the output of H2 (z) is not due to its phase
not being exactly linear, although the filter is all-pass.
(c) If the phase is linear advancing the signal 100 samples gives the original signal, while that is not
possible for the non-linear phase.
Copyright 2014, Elsevier, Inc. All rights reserved.
◆
=1
12.27
0.4
−50
0.2
0.8
−100
0.6
−150
−0.2
−200
−0.4
0.4
1
2
3
0
1
2
−0.4
−5
0.6
−15
0.4
1
2
3
100
120
140
160
180
0
20
40
60
80
100
120
140
160
180
0
20
40
60
80
100
n
120
140
160
180
0
−0.2
−30
0
80
0.2
−20
−25
0.2
60
0.4
y2[n]
<H1
|H2|
−0.2
−10
40
0
0
1
20
0.2
3
y1[n]
0
0
0.4
−300
0.8
0
0
−250
0.2
0
x[n]
0
1
<H1
|H1|
Chaparro — Signals and Systems using MATLAB
0
1
2
3
−0.4
Figure 12.7: Problem 20: Magnitude and phase of filters (left). Part of handel signal (top right) and outputs
of linear–phase and non–linear phase filters.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.28
12.21 The minimum orders for the Chebyshev and the Butterworth are given by
cosh
Nch
log
Nb
1
⇣
100.1↵min 1
100.1↵max 1
⌘1/2
⇣
⌘
st /2)
cosh 1 tan(!
tan(!p /2)
h 0.1↵min
i
(10
(100.1↵min
2 log
⇣
1)
1)
tan(!st /2)
tan(!p /2)
⌘
where for Fs = 1/Ts = 104 samp/sec, !p = 2⇡fp /Fs = 0.2⇡ (rad), !st = 2⇡fst /Fs = 0.24⇡ (rad).
Using these values and the loss specifications, we find Nb 9.97 or Nb = 10, and for the Chebyshev
we then have
⇣ 0.1↵
⌘1/2
min 1
10
cosh 1 10
0.1↵max 1
⇣
⌘  10
9<
st /2)
cosh 1 tan(!
tan(!p /2)
which gives that
1
cosh
9
|
1
✓
which gives that
10 1
100.07 1
{z
◆1/2
> cosh
}
0.295
1
✓
tan(!st /2)
tan(!p /2)
1.044 tan(!p /2) > tan(!st /2)
|
{z
}
0.339
Using !st = 2⇡fst Ts we obtain that
tan
|
1
(0.399)/(⇡Ts ) > fst
{z
}
1040.37
tan
|
◆
1
cosh
10
|
1
✓
10 1
100.07 1
{z
0.266
◆1/2
}
1.036 tan(!p /2)
|
{z
}
0.336
1
(0.366)/(⇡Ts )
{z
}
1033.1
So any value within this range will give a Chebyshev filter of the same order as the Butterworth. Notice
that the transition band shrinks from [1000 1200] for the Butterworth to [1000 1035] if we choose
fst = 1035 as illustrated by the following script we get Nb = Nc = 10.
%% Pr 12_21
clear all; clf
alphamax=0.7; alphamin=10;Fs=1/10ˆ(-4);
wp=2*pi*1000/Fs;ws=2*pi*1200/Fs;
[Nb,whp]=buttord(wp/pi,ws/pi,alphamax,alphamin)
ws=2*pi*1035/Fs;
[Nc,wn]=cheb1ord(wp/pi,ws/pi,alphamax,alphamin)
Nb =10
Nc =10
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.29
12.22 The second order low-pass filter (normalized in frequency) is
H(s) =
applying the bilinear transformation s = (1
H(z)
z
s2
1
1
p
+ 2s + 1
)/(1 + z
1
) we obtain the following discrete filter
(1 + z 1 )2
p
(1 z 1 )2 + 2(1 z 2 ) + (1 + z 1 )2
(1 + z 1 )2
(z + 1)2
p
p
p
p
p
=
(2 + 2) + (2
2)z 2
(2 + 2)(z 2 + (2
2)/(2 + 2))
=
=
so we have a double zero at z =
1 and poles at z1,2 = ±j
q
(2
p
2)/(2 +
p
2).
We have that Kb transforms the normalized half-power analog frequency ⌦hp = 1 into the normalized
half-power frequency !hp of the discrete filter, so that
Kb = 1 =
1
) !hp = ⇡/2
tan(!hp /2)
The following script verifies the analytic results
%% Pr 12_22
clear all;clf
n=1;d=[1 sqrt(2) 1];
[b,a]=bilinear(n,d,0.5)
[H,w]=freqz(b,a)
figure(1)
subplot(211)
zplane(b,a)
subplot(212)
plot(w/pi,abs(H));grid;ylabel(’|H(eˆ{j\omega})|’); xlabel(’\omega/\pi’)
The obtained coefficients are
b =0.2929
a =1.0000
0.5858
0.0000
0.2929
0.1716
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.30
Imaginary Part
1
0.5
2
0
−0.5
−1
−3
−2
−1
0
Real Part
1
2
3
1
|H(ejω)|
0.8
0.6
0.4
0.2
0
0
0.1
0.2
0.3
0.4
0.5
ω/π
0.6
0.7
0.8
0.9
1
Figure 12.8: Problem 22: Poles/zeros of H(z) with !hp = ⇡/2.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.31
12.23 (a)(b) The following script computes the analog filters and does the bilinear transformations.
%% Pr 12_23
clear all; clf
figure(1)
%% --- part (a)
[b,a]=butter(6,[10 20],’s’) % bandpass filter of order 12
%% --- part (b)
%[b,a]=butter(7,[10 20],’s’)
[G,w1]=freqs(b,a); % freq response of analog filter
subplot(221)
plot(w1,abs(G));grid;title(’mag of analog filter’)
hold on
plot(w1,0.707*ones(1,length(w1)),’r’)
hold off
subplot(222)
plot(w1,unwrap(angle(G)));title(’phase of analog filter’)
K=1;
[num,den]=bilinear(b,a,K/2); % bilinear transformation
[H,w]=freqz(num,den); % frequency response of discrete filter
subplot(223)
plot(w/pi, abs(H)); grid;title(’mag of discrete filter’);xlabel(’\omega/\pi’)
hold on
plot(w/pi,0.707*ones(1,length(w)),’r’);xlabel(’\omega/\pi’)
hold off
subplot(224)
plot(w/pi, unwrap(angle(H))); title(’phase of discrete filter’);xlabel(’\omega/\pi’)
% poles and zeros of filters
figure(2)
subplot(121)
zplane(b,a); title(’poles/zeros of analog filter’) % analog
subplot(122)
zplane(num,den); title(’poles/zeros of discrete filter’) %discrete
A slight increase in the order changes the performance of bilinear, as the warping makes all the poles
to be clustered around the ±⇡ frequency. The second discrete filter cannot be accurately designed.
Poles and zeros for the two cases are shown below.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
mag of analog filter
1.5
0.5
0
0
20
40
60
80
100
mag of discrete filter
1.5
phase of analog filter
5
1
mag of analog filter
1
0
0.8
−5
0.6
−10
−10
0.4
−15
−15
0.2
−20
−20
0
0
20
40
60
80
100
phase of discrete filter
0
20
60
80
−25
100
mag of discrete filter
2
0
40
phase of analog filter
0
−5
5
1
12.32
0
20
40
60
80
100
0.8
1
phase of discrete filter
0
1.5
−5
−5
1
−10
0.5
−10
0.5
−15
0
0
0.2
0.4
0.6
0.8
1
−20
0
0.2
0.4
ω/π
0.6
0.8
0
1
0
0.2
ω/π
0.4
0.6
0.8
−15
1
0
0.2
0.4
ω/π
0.6
ω/π
Figure 12.9: Problem 23: Warping effect of bilinear transformation filter of order 12 (left) and 14 (right).
poles/zeros of analog filter
poles/zeros of discrete filter
poles/zeros of analog filter
20
2
20
15
1.5
15
poles/zeros of discrete filter
2
10
5
0.5
5
6
0
0
1
7
0
−5
−0.5
−5
−10
−1
−10
Imaginary Part
1
Imaginary Part
10
Imaginary Part
Imaginary Part
1.5
0.5
0
−0.5
−1
−1.5
−15
−1.5
−15
−20
−2
−20
−2
−10
−5
0
Real Part
5
−1
−0.5
0
Real Part
0.5
1
−10
−5
0
Real Part
5
−1
−0.5
0
0.5
Real Part
1
Figure 12.10: Problem 23: Poles/zeros of discrete filter for bilinear transformation of order 12 (left) and 14
(right).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.33
12.24 (a)(b) The filter G(s) is an all-pass filter with linear phase ✓(⌦) = 5⌦. The frequency range 0 
⌦  20 (rad/sec) is transformed by the ⌦ = K tan(!/2) = tan(!/2) for K = 1, into 0  ! 
2 tan 1 (20) = 3.04 (rad). The phase is then transformed into 5 tan(!/2), the phase of the discrete
filter. The ⌦ vs ! is computed and plotted in the following script.
% Pr. 12_24
clear all;clf
W=0:0.1:20;N=5;G=exp(-j* N*W); % discretization of linear phase of G(s)
w=2*atan(W); % discrete frequencies
figure(1)
plot(w,W); axis([0 max(w) 0 max(W)]);
grid;xlabel(’\omega (rad)’);ylabel(’\Omega (rad/sec)’)
H=exp(-j*N*tan(w/2))
figure(2)
subplot(211)
plot(W,unwrap(angle(G))); ylabel(’\angle{G(j\Omega)}’)
xlabel(’\Omega (rad/sec)’)
subplot(212)
plot(w,unwrap(angle(H))) ; ylabel(’\angle{H(eˆ{j\omega})}’);
xlabel(’\omega (rad/sec)’)
(c) Since the BT is a frequency transformation, H(z) is also an all-pass filter, indeed
H(ej! ) = 1e
j5 tan(!)/2
.
Although the phase of G(s) is linear, the phase of H(z) is not.
0
20
−20
18
∠G(jΩ)
−40
16
−80
−100
12
−120
0
2
4
6
10
8
10
12
Ω (rad/sec)
14
16
18
20
0
8
−20
6
∠H(ejω)
Ω (rad/sec)
14
−60
4
2
−40
−60
−80
0
0
0.5
1
1.5
ω (rad)
2
2.5
3
−100
0
0.5
1
1.5
2
ω (rad/sec)
2.5
Figure 12.11: Problem 24: Effect of bilinear transformation on phase.
Copyright 2014, Elsevier, Inc. All rights reserved.
3
3.5
Chaparro — Signals and Systems using MATLAB
12.34
12.25 We have that Ts = 1/Fs = 0.5 ⇥ 10 3 sec/sample, so Kb = cot(0.5!hp ) = cot(2⇡fhp /(2Fs )) =
25.45. In this case, we use the loss function for the Butterworth to find the order
↵(ej!st ) = 10 log [1 + (Kb tan(2⇡fst /(2Fs )))]
The minimum order is
2N
38
log(103.8 1)
= 6.298
2 log(0.078Kb )
N
so that N = 7.
The frequency normalized analog filter in factorized form is
H7 (s) =
G
= GH1 (s)H2 (s)H3 (s)H4 (s)
(s + 1)(s2 + 1.8s + 1)(s2 + 1.25s + 1)(s2 + 0.45s + 1)
We have then
H1 (z) =
1
|
s + 1 s=Kb (1
z
1 )/(1+z
1)
=
(1/(Kb 1)(1 + z 1 )
(Kb + 1)/(Kb 1) z
1
For the others which are second-order we have
Hi (z)
=
=
Hi (s)|s=Kb (1
z
1
|BT
s2 + (1/Qi )s + 1
(1 + z 1 )2
2(Kb2 1)z 1 + (Kb2 Kb2 /Qi + 1)z
1 )/(1+z
(Kb2 + Kb /Qi + 1)
1)
=
2
for i = 2, 3, 4 and Q2 = 1/1.8, Q3 = 1/1.25, and Q4 = 1/0.45. Replacing Kb and Qi we get
0.04(1 + z 1 )
1 0.92z 1
1.44 ⇥ 10 3 (1 + z 1 )2
H2 (z) =
1 1.86z 1 + 0.87z 2
1.47 ⇥ 10 3 (1 + z 1 )2
H3 (z) =
1 1.9z 1 + 0.91z 2
1.51 ⇥ 10 3 (1 + z 1 )2
H4 (z) =
1 1.96z 1 + 0.91z 2
H1 (z) =
To get H7 (ej0 ) = 1 so that the dc loss is 0 db,
GH1 (1)H2 (1)H3 (1)H4 (1) = 1
which gives G = 1.
%% Pr 12_25
N = 7; fhp = 25; Fs = 2000;
whp = 2*pi*fhp/Fs;
[b, a] = butter(N, whp/pi);
% analytic results
% coefficients of H1
b1 = [0.04, 0.04]; a1 = [1, -0.92];
% coefficients of H2
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.35
b2 = 1.44e-3*[1, 2, 1]; a2 = [1, -1.86, 0.87];
% coefficients of H3
b3 = 1.47e-3*[1, 2, 1]; a3 = [1, -1.9, 0.91];
% coefficients of H4
b4 = 1.51e-3*[1, 2, 1]; a4 = [1, -1.96, 0.91];
% comparison of analytic and MATLAB results
analyticalB = conv(conv(conv(b1, b2), b3), b4)
matlabB = b
analyticalA = conv(conv(conv(a1, a2), a3), a4)
matlabA = a
The comparison of analytic and computational results gives
analyticalB =1.0e-08 *
0.0128
0.0895
0.2685
matlabB =1.0e-08 *
0.0121
0.0848
0.2544
0.4475
0.4475
0.2685
0.0895
0.0128
0.4240
0.4240
0.2544
0.0848
0.0121
analyticalA = 1.0000
-6.6400
18.8560 -29.6888
27.9928 -15.8063
4.9490
-0.6628
matlabA = 1.0000
-6.6471
18.9442 -30.0084
28.5329 -16.2848
5.1656
-0.7025
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.36
12.26 According to the results of the following script, we have:
(a) The given filter is all–pass.
(b) Using K = 1.4 we get the desired response. The discrete filter is also all-pass given given the location of its
poles and zeros
(c) The output differs from a shifted input, but it is a good approximation, so the phase is approximately linear.
%% Pr 12_26
clear all; clf
b=[1 -4 8 -8 4];a=[1 4 8 8 4];
[G,W]=freqs(b,a); % all-pass analog filter
figure(1)
subplot(221)
plot(W,abs(G))
subplot(222)
plot(W,unwrap(angle(G)))
subplot(223)
splane(b,a)
figure(2)
K=1.4; % bilinear transformation
[num,den]=bilinear(b,a,K/2);
[H,w]=freqz(num,den);
[H,w]=freqz(num/H(1),den); % unit-gain filter
subplot(311)
plot(w/pi, abs(H)); grid
hold on
plot(w/pi,0.707*ones(1,length(w)),’r’)
hold off
subplot(312)
plot(w/pi,unwrap(angle(H)))
subplot(313)
zplane(num,den)
n=0:100;
x=sin(0.2*pi*n);
y=filter(num,den,x); % output of H(z)
figure(4)
subplot(211)
plot(n,x)
subplot(212)
plot(n,y,’r’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1
12.37
0
1
−2
1
|H|
1
<G
|G|
−4
1
−6
1
1
0
−8
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0.1
0.2
0.3
0.4
0.5
ω/π
0.6
0.7
0.8
0.9
1
1
−10
0
2
4
6
8
10
−12
0
2
4
6
8
−5
10
<H
1
0
ω/π
2
−10
−15
0
1
Imaginary Part
jΩ
2
0
−1
−2
−2
−1
0
1
2
2
1
2
2
0
−1
−2
2
−10
3
−5
0
Real Part
σ
5
10
1
x[n]
0.5
0
−0.5
−1
0
10
20
30
40
50
60
70
80
90
100
0
10
20
30
40
50
n
60
70
80
90
100
1.5
1
y[n]
0.5
0
−0.5
−1
Figure 12.12: Problem 26: Magnitude and phase of G(s), H(z) (top, left and right). Input and output of
H(z).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.38
12.27 The desired filter is a low-pass, with fp = 1 kHz, ↵max = 3 dB, so that fp = fhp ; fst = 2 kHz,
↵min = 10 dB, and dc gain of 10 after the design with dc of 0 dB. Since fmax = 5 kHz, then we can
choose Fs = 10 kHz. The coefficients of the resulting filter are shown below.
%% Pr 12_27
Fs=10000;fp=1000;fst=2000;
wp=2*pi*fp/Fs/pi; ws=2*pi*fst/Fs/pi;
alphamax=3; alphamin=10;
[N,wn]=buttord(wp,ws,alphamax,alphamin)
[b,a]=butter(N,wp); % to guarantee that wp is half-power frequency (wn\ne wp)
G=10*sum(b)/sum(a);
b=G*b;
[H,w]=freqz(b,a);
figure(1)
subplot(221)
zplane(b,a)
subplot(222)
plot(w/pi*Fs/2, abs(H));grid; axis([0 Fs/2 -0.1 11])
subplot(223)
plot(w/pi*Fs/2,unwrap(angle(H)));grid; axis([0 Fs/2 -4 0])
b = 0.6746
1.3491
0.6746
a = 1.0000
-1.1430
0.4128
Imaginary Part
1
10
0.5
8
6
2
0
4
−0.5
2
−1
−1
−0.5
0
0.5
Real Part
0
1
0
1000 2000
3000 4000
5000
0
−1
−2
−3
−4
0
1000 2000
3000 4000
5000
Figure 12.13: Problem 27: Poles/zeros and magnitude and phase responses.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.39
12.28 The following script designs the desired filters, computes and plots the output of the filtered signals and
different spectra:
%% Pr 12_28
clear all; clf
load train;y=y’; N=256;
noise=0.1*randn(1,N);
yc=y(1:N);
yn=yc+noise;
% noisy signal
%[b,a]=butter(20,0.5);
% butterworth
[b,a]=cheby2(20,60,0.5);
% cheby2
%[b,a]=cheby1(20,0.01,0.5)
% cheby1
figure(1)
[H,w]=freqz(b,a);
b=b/H(1);
[H,w]=freqz(b,a); % unit dc gain
subplot(311)
plot(w/pi, abs(H)); grid
hold on
plot(w/pi,0.707*ones(1,length(w)),’r’)
hold off
subplot(312)
plot(w/pi,unwrap(angle(H)))
subplot(313)
zplane(b,a)
k=0:N-1;w1=k*2*pi/N;w1=w1/pi-1;
Ns=fftshift(abs(fft(noise)));
% noise spectrum
Yc=fftshift(abs(fft(yc)));
% clean signal spectrum
Yn=fftshift(abs(fft(yn)));
% noisy signal spectrum
figure(2)
subplot(311)
plot(w1,Yc); title(’clean signal spectrum’)
subplot(312)
plot(w1,Yn); title(’noisy signal spectrum’)
subplot(313)
plot(w1,Ns); title(’noise spectrum’)
yy=filter(b,a,yn);
n=0:N-1;
figure(3)
subplot(311)
plot(n,yn,’r’);title(’noisy/clean signal’)
hold on
plot(n,yc);legend(’noisy’,’clean’)
hold off
subplot(312)
plot(n,yy,’r’);legend(’clean signal’)
subplot(313)
plot(n,yc); legend(’filtered’,’clean’)
hold off
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
1.5
15
1
10
0.5
5
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
−1
10
15
0
10
−10
−20
Imaginary Part
12.40
clean signal spectrum
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
0.4
0.6
0.8
1
0.4
0.6
0.8
1
noisy signal spectrum
5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
−1
1
4
0.5
3
0
2
−0.5
−0.8
−0.6
−0.4
−0.2
0
0.2
noise spectrum
1
−1
−5
−4
−3
−2
−1
0
Real Part
1
2
3
4
0
−1
5
−0.8
−0.6
−0.4
−0.2
0
0.2
noisy/clean signal
0.4
0.2
0
−0.2
−0.4
−0.6
noisy
clean
0
50
100
150
200
250
0.4
clean signal
0.2
0
−0.2
−0.4
0
50
100
150
200
0.4
250
filtered
0.2
0
−0.2
−0.4
0
50
100
150
200
250
Figure 12.14: Problem 28: Chebyshev 2 case: Filter frequency response and poles zeros (top left), spectra of
different signals, signals (bottom)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.29 (a)(b) Multiplying by
12.41
1 the gain specifications we obtain the loss specifications
0  ↵(!)  0.1
↵(!)
60
0  !  0.2⇡
0.3⇡  !  ⇡
so that the d.c. loss is 0 dB, ↵max = 0.1 and ↵min = 15 dBs. The frequencies are !p = 0.2⇡,
!st = 0.3⇡
%% Pr 12_29
clear all; clf
alphamax=0.1; alphamin=60; wp=0.2; ws=0.3;
[Nb,wn]=buttord(wp,ws,alphamax,alphamin)
[b1,a1]=butter(Nb,wn);
[Hb,w]=freqz(b1,a1);
[Nc,wn]=cheb1ord(wp,ws,alphamax,alphamin);
[b2,a2]=cheby1(Nc,alphamax,wn);
[Hc,w]=freqz(b2,a2);
[Ne,wn]=ellipord(wp,ws,alphamax,alphamin);
[b3,a3]=ellip(Ne,alphamax,alphamin,wn)
[He,w]=freqz(b3,a3);
figure(1)
subplot(221)
zplane(b1,a1)
subplot(222)
zplane(b2,a2)
subplot(223)
zplane(b3,a3)
figure(2)
plot(w/pi, abs(Hb))
hold on
plot(w/pi, abs(Hc),’r’)
hold on
plot(w/pi, abs(He),’g’);grid; axis([0 1 -0.1 1.1])
legend(’Butterworth’,’Chebyshev’, ’Elliptic’)
The minimum orders of the filters are
Nb =20 Butterworth
Nc =10 Chebyshev
Ne =6 Elliptic
The frequency responses are very similar.
Copyright 2014, Elsevier, Inc. All rights reserved.
1
1
0.5
0.5
Imaginary Part
Imaginary Part
Chaparro — Signals and Systems using MATLAB
0
−0.5
−1
−1.5
−0.5
0
Real Part
0.5
1
0
0.8
−0.5
−1
−0.5
0
0.5
Real Part
1
0.6
0.4
1
Imaginary Part
Butterworth
Chebyshev
Elliptic
1
−1
−1
12.42
0.5
0.2
0
0
−0.5
−1
0
−1
−0.5
0
0.5
Real Part
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1
Figure 12.15: Problem 29: Poles/zeros (left, clockwise from top left) and magnitude responses of Butterworth,
Chebyshev and elliptic filters.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.43
12.30 (a) For the filter to be all-pass the zeros must be the inverse of the poles 0.5 and
H(z) = K
(1 2z
(1 0.5z
1
)(1 + 2z 1 )
(1 4z 2 )
=K
1
+ 0.5z )
(1 0.25z 2 )
1 )(1
0.5 or 2 and
2. Thus
K>0
As an all-pass H(z) has a constant magnitude (at any frequency) and in this case we want it to be unity.
For instance, for this filter to have unit gain at ! = ⇡/2 we need that
|H(ej⇡/2 )| = K
1
1
4j 2
5
1.25
=K
=1 ) K=
= 0.25
0.25j 2
1.25
5
(b) The zeros of H(z) are ↵1 and ↵2 which are real. For H(z) to be a notch filter |↵i | = 1, and so we
let ↵1 = ↵2 = 1 for notches at ! = 0, ⇡. Thus
H(z) = K
(1 z
(1 0.5z
1
)(1 + z 1 )
(1 z 2 )
=K
1
+ 0.5z )
(1 0.25z 2 )
1 )(1
and for it to have unit gain at ! = ⇡/2
|H(ej⇡/2 )| = K
1
1
j2
2
1.25
=K
=1 ) K=
= 0.25
2
0.25j
1.25
2
(c) In general, the filter
H(z) = K
(1 ↵2 z 2 )
(1 0.25z 2 )
for 1  ↵  2 is a family of notch filters with notches at ! = 0, ⇡, including an all-pass filter when
↵ = 2. The gain K > 0 is
|H(ej⇡/2 )| = K
(d) If we let z
1
= jZ
1
1 ↵2 j 2
1 + ↵2
1.25
=K
=1)K=
2
1 0.25j
1.25
1 + ↵2
the filter becomes
H(Z) = K
(1 ↵2 j 2 Z 2 )
(1 + ↵2 Z 2 )
=K
2
2
(1 0.25j Z )
(1 + 0.25Z 2 )
with poles at ±0.5ej⇡/2 and zeros at ±↵ej⇡/2 , i.e., shifted 90o with respect to the ones before. For
values of 1  ↵  2, H(Z) is a family of notch filters at ! = ⇡/2, including an all-pass filter when
↵ = 2.
When running the following script make the numerator and the denominator correspond to H(z) or to
H(Z) by deleting the comment symbol.
%% Pr 12_30
clear all;clf
%a=[1 0 -0.25];
%% denominator of H(z)
a=[1 0 0.25]; %% denominator of H(Z)
figure(1)
for alpha=2:-0.1:1;
alpha
K=1.25/(1+alphaˆ2)
%b=[K 0 -(alphaˆ2)*K]; %% numerator of H(z)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.44
b=[K 0 (alphaˆ2)*K]; %% numerator of H(Z)
[H,w]=freqz(b,a);
subplot(211)
zplane(b,a); axis([-2 2 -2.5 2.5])
hold on
subplot(212)
plot(w/pi,abs(H));axis([0 1 0 1.5])
hold on
pause(1)
end
hold off
Imaginary Part
2
1
0
−1
−2
−2
0
Real Part
2
1.5
1
0.5
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Imaginary Part
2
1
0
−1
−2
−2
0
Real Part
2
1.5
1
0.5
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Figure 12.16: Problem 30: Loci of poles and zeros and magnitude responses of H(z) (top) and of H(Z)
(bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.31 (a)(b)The filter transfer function is
H(z) = K
so that at ! = 0 we get
H(1) = K
12.45
1 + z4
1/16 + z 4
2
=1
17/16
)
K=
17
32
The zeros and poles of H(z) are:
Zeros: z 4 + 1 = 0
)
Poles: z 4 + 1/16 = 0
zk = ej(2k+1)⇡/4 ,
k = 0, · · · , 3
1 j(2k+1)⇡/4
) zk = e
,
k = 0, · · · , 3
2
The distribution of the zeros and poles makes the magnitude frequency response look like a comb.
The phase is plotted using MATLAB, it cannot be unwrapped because of the zeros on the unit circle
make the phase discontinuous.
%% Pr 12_31
clear all;clf
b=[1 0 0 0 1];
a=[1 0 0 0 1/16];
[H,w]=freqz(b,a);
figure(1)
[H,w]=freqz(b,a);
b=b/H(1);
[H,w]=freqz(b,a);
subplot(311)
plot(w/pi, abs(H)); grid
hold on
plot(w/pi,0.707*ones(1,length(w)),’r’)
hold off
subplot(312)
plot(w/pi,unwrap(angle(H)))
subplot(313)
zplane(b,a)
(c) The two filters are obtained as shown below. Notice the change in the coefficients of the numerators
to get unit gain in the bands outside the notches. Connecting the two filters in parallel gives a sharper
notch filter than the above one. The coefficients are computed using conv to implement multiplication
of polynomials.
% Butterworth implementation
[b1,a1]=butter(5,[0.245 0.255],’stop’)
[b2,a2]=butter(5,[0.745 0.755],’stop’)
[H1,w]=freqz(b1/2,a1);
[H2,w]=freqz(b2/2,a2);
H12=H1+H2; % parallel connection
% coefficients of H
a12=conv(a1,a2)
b12=conv(a1,b2)+conv(a2,b1)
figure(2)
subplot(311)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.46
plot(w/pi, abs(H12)); grid
subplot(312)
plot(w/pi,unwrap(angle(H12)))
subplot(313)
zplane(b12,a12)
1
1.5
1
0.5
0.5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0
1
2
1
1
0
0
−1
−1
−2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
−2
1
1
Imaginary Part
Imaginary Part
0
2
0.5
0
−0.5
−1
−5
−4
−3
−2
−1
0
Real Part
1
2
3
4
5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
−3
−2
−1
0
Real Part
1
2
3
4
1
0.5
0
−0.5
−1
−5
−4
5
Figure 12.17: Problem 31: Magnitude and phase responses of comb filter (left) and of sharper notch filter.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.47
12.32 Designing a low-pass, a band-pass and a high-pass and connecting them in parallel we obtain the desired
bank of filters. The following script does the filtering design and the filtering of the speech signal.
%% Pr 12_32
clear all; clf
fs=10000;f1=fs/4;f2=3*fs/8;
w1=2*pi*f1/fs;w1=w1/pi
w2=2*pi*f2/fs;w2=w2/pi
[b1,a1]=butter(20,w1,’low’)
[b2,a2]=butter(10,[w1 w2])
[b3,a3]=butter(20,w2,’high’)
[H1,w]=freqz(b1,a1);
figure(1)
subplot(311)
plot(w/pi, abs(H1)); grid
subplot(312)
plot(w/pi,unwrap(angle(H1)))
subplot(313)
zplane(b1,a1)
[H2,w]=freqz(b2,a2);
figure(2)
subplot(311)
plot(w/pi, abs(H2)); grid
subplot(312)
plot(w/pi,unwrap(angle(H2)))
subplot(313)
zplane(b2,a2)
[H3,w]=freqz(b3,a3);
figure(3)
subplot(311)
plot(w/pi, abs(H3)); grid; xlabel(’\omega/\pi’)
subplot(312)
plot(w/pi,unwrap(angle(H3))); xlabel(’\omega/\pi’)
subplot(313)
zplane(b3,a3)
H=H1+H2+H3;
figure(4)
subplot(211)
plot(w/pi, abs(H1));grid;
hold on
plot(w/pi, abs(H2),’r’);
hold on
plot(w/pi, abs(H3),’g’); xlabel(’\omega/\pi’)
hold off
subplot(212)
plot(w/pi, abs(H)); grid
axis([0 1 0 1.1*max(abs(H))]); xlabel(’\omega/\pi’)
load handel; y=y(1:1001)’;
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
y1=filter(b1,a1,y);
y2=filter(b2,a2,y);
y3=filter(b3,a3,y);
n=0:1000;
figure(5)
subplot(411)
plot(n,y);axis([0 1000 -0.3 0.3])
subplot(412)
plot(y1);axis([0 1000 -0.3 0.3])
subplot(413)
plot(y2);axis([0 1000 -0.3 0.3])
subplot(414)
plot(y3);axis([0 1000 -0.3 0.3])
w=[0:1000]*2*pi/1000-pi;f =w*Fs
figure(6)
subplot(411)
plot(f,abs(fftshift(fft(y)))); axis([min(f) max(f) 0 20])
subplot(412)
plot(f,abs(fftshift(fft(y1)))); axis([min(f) max(f) 0 20])
subplot(413)
plot(f,abs(fftshift(fft(y2)))); axis([min(f) max(f) 0 3])
subplot(414)
plot(f,abs(fftshift(fft(y3)))); axis([min(f) max(f) 0 1])
Copyright 2014, Elsevier, Inc. All rights reserved.
12.48
Chaparro — Signals and Systems using MATLAB
12.49
1.5
0.2
0
1
−0.2
0.5
0
100
200
300
400
500
600
700
800
900
1000
0
100
200
300
400
500
600
700
800
900
1000
0
100
200
300
400
500
600
700
800
900
1000
0
100
200
300
400
500
n
600
700
800
900
1000
0.2
0
0
0
0.1
0.2
0.3
0.4
0.5
ω/π
0.6
0.7
0.8
0.9
−0.2
1
0.2
1
0
0.8
−0.2
0.6
0.2
0.4
0
0.2
−0.2
0
0
0.1
0.2
0.3
0.4
0.5
ω/π
20
0.6
0.7
0.8
0.9
1
10
0
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
4
x 10
20
10
0
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
4
x 10
3
2
1
0
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
4
x 10
1
0.5
0
−2.5
−2
−1.5
−1
−0.5
0
f (Hz)
0.5
1
1.5
2
2.5
4
x 10
Figure 12.18: Problem 32: Bank of filters (top left), handel signal and filtered signals, and their spectra
(bottom figure)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.50
12.33 For fs = 2000 Hz, the cutoff frequency of the FIR is
!c =
2⇡fc
= 0.25⇡
fs
so that the desired impulse response is
1
hd [n] =
2⇡
Z
⇡/4
1e
j!n
d! =
⇡/4
⇢
sin(⇡n/4)/(⇡n)
0.25
n 6= 0
n=0
The designed filter has a transfer function
Ĥ(z) =
20
X
hd [n
10]w[n
10]z
n
n=0
where w[n] is a window, centered at n = 0.
If w[n] is a rectangular window,
Ĥ(z) = 0.25 +
20
X
n=0,n6=10
sin(⇡(n
⇡(n
10)/4)
z
10)
n
With Barlett’s window
Ĥ(z) = 0.25 +
20
X
n=0,n6=10
sin(⇡(n
⇡(n

10)/4)
1
10)
2|n
10|
20
z
n
This script will compute the impulse responses and their corresponding frequency responses.
%% Pr 12_33
clear all; clf
for n=0:20,
if n==10,
h1(n+1)=0.25;h2(n+1)=0.25;
else
h1(n+1)=sin(pi*(n-10)/4)/(pi*(n-10)); % rectangular window
h2(n+1)=h1(n+1)*(1-abs(n-10)/10); % Barlett’s window
end
end
[H1,w]=freqz(h1,1);[H2,w]=freqz(h2,1);
figure(1)
subplot(221)
plot(w/pi,abs(H1));axis([0 1 0 1.1]);grid;ylabel(’|H1|’)
subplot(222)
plot(w/pi, unwrap(angle(H1)));axis([0 1 -10 0]);grid; ylabel(’<H1’)
subplot(223)
plot(w/pi,abs(H2));axis([0 1 0 1.1]);grid; ylabel(’|H2|’);xlabel(’\omega/\pi’)
subplot(224)
plot(w/pi, unwrap(angle(H2)));axis([0 1 -20 0]);grid;ylabel(’<H1’)
xlabel(’\omega/\pi’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.51
0
1
−2
0.6
<H1
|H1|
0.8
−4
0.4
−6
0.2
−8
0
0
0.2
0.4
0.6
0.8
−10
1
0
0.2
0.4
0
0.2
0.4
0.6
0.8
1
0.6
0.8
1
0
1
−5
0.6
<H1
|H2|
0.8
−10
0.4
−15
0.2
0
0
0.2
0.4
0.6
ω/π
0.8
1
−20
ω/π
Figure 12.19: Problem 33: Magnitude and phase responses of FIR using rectangular (top) and Barlett’s
window. Design with Barlett’s window is smoother but has wider bandwidth.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.52
12.34 The desired impulse response is
1
hd [n] =
2⇡
Z
⇡/3
1e
j!n
d! =
⇡/3
⇢
sin(⇡n/3)/(⇡n)
0.33
n 6= 0
n=0
The designed filter has a transfer function
Ĥ(z) =
N
X1
hd [n
(N
1)/2]w[n
(N
1)/2]z
n
n=0
where w[n] is a window, centered at n = 0.
If w[n] is a rectangular window, N = 21 then
Ĥ(z) = 0.33 +
20
X
n=0,n6=10
sin(⇡(n
⇡(n
10)/3)
z
10)
n
Similarly for N = 81. The following script shows how to design the different filters (notice the computation of the desired impulse response h[n]).
%% Pr 12_34
clear all;clf
N=81;% N=21
wk=kaiser(N,4.5)’;
wh=hamming(N)’;M=floor(N/2)
for n=0:N-1,
if n==floor(N/2),
h1(n+1)=0.33;
else
h1(n+1)=sin(pi*(n-M)/3)/(pi*(n-M));
end
end
h2=h1.*wk;
h3=h1.*wh;
[H1,w]=freqz(h1,1);[H2,w]=freqz(h2,1);[H3,w]=freqz(h3,1);
figure(1)
subplot(321)
stem(h1)
subplot(322)
plot(w/pi,abs(H1)); axis([0 1 0 1.1]);grid
subplot(323)
stem(h2)
subplot(324)
plot(w/pi,abs(H2)); axis([0 1 0 1.1]);grid
subplot(325)
stem(h3)
subplot(326)
plot(w/pi,abs(H3)); axis([0 1 0 1.1]);grid
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.53
1
0.4
0.3
0.2
0.1
0
0.5
0
20
40
60
80
0
0
0.2
0.4
0.6
0.8
1
0
0.2
0.4
0.6
0.8
1
0
0.2
0.4
0.6
0.8
1
1
0.4
0.3
0.2
0.1
0
0.5
0
20
40
60
80
0
1
0.4
0.3
0.2
0.1
0
0.5
0
20
40
60
80
0
Figure 12.20: Problem 34: Impulse and magnitude responses of FIR using rectangular (top), Kaiser and
Hamming (bottom) windows.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.54
12.35 (a) Modulating the impulse response h[n] of an IIR filter gives a new filter with transfer function
Ĥ(z)
=
=
1
X
n=0
1
X
2h[n] cos(!0 n)z
h[n](ej!0 z
n
1 n
) +
n=0
=
1
X
h[n](e
j!0
z
1 n
)
n=0
H(e
j!0
z) + H(ej!0 z)
so that if H(z) = B(z)/A(z) then
Ĥ(z) =
B(ej!0 z) B(e
+
A(ej!0 z)
A(e
j!0
z)
j!0 z)
.
(b) For the given transfer function
H(z) =
1
1
az
1
for 0 < a < 1. The transformed filter is
Ĥ(z)
=
=
=
H(e
1
1
j!0
z) + H(ej!0 z)
1
1
+
aej!o z 1
1 ae j!o z
2 2a cos(!0 )z 1
2a cos(!0 )z 1 + a2 z 2
1
If a = 0.5 and !0 = ⇡/2, i.e., we want to convert the prototype low-pass filter into a band-pass filter,
we get
2
2z 2
Ĥ(z) =
= 2
2
1 + 0.25z
z + 0.25
with two zeros at z = 0 and two poles at z = ±j0.5, so that the filter is a bandpass filter with center
frequency ⇡/2.
(c) To get a high–pass filter we let !0 = ⇡. The following script computes and plots the different
frequency responses.
%% Pr 12_35
clear all; clf
b=1;a=[1 -0.5];
[H,w]=freqz(b,a);
alpha=0.5; w0=pi/2
b1=[2 -2*alpha*cos(w0)];a1=[1 -2*alpha*cos(w0) alphaˆ2];
w0=pi
b2=[2 -2*alpha*cos(w0)];a2=[1 -2*alpha*cos(w0) alphaˆ2];
[H1,w]=freqz(b1,a1);
[H2,w]=freqz(b2,a2);
figure(1)
lot(311)
plot(w/pi,abs(H));axis([0 1 0 2]);grid
subplot(312)
plot(w/pi,abs(H1));axis([0 1 0 3]);grid
subplot(313)
plot(w/pi,abs(H2));axis([0 1 0 4]);grid
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.55
2
1.5
1
0.5
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
3
2
1
0
4
3
2
1
0
Figure 12.21: Problem 35: Magnitude responses of low–pass prototype (top) and band–pass and high–pass
filters (middle and bottom).
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.56
12.36 (a) The impulse response h[n] = 0.5n u[n], and so the downsampled impulse response is
g[n] = h[2n] = 0.52n u[2n] = 0.25n u[n]
since
u[2n] =
⇢
1
0
2n 0 or n
n<0
0
i.e., equal to u[n].
(b) The transfer function of the original filter is
H(z) =
1
1
0.5z
=
1
1
X
0.5n z
n
n=0
while that of the downsampled filter is
G(z) =
1
1
0.25z
1
=
1
X
0.25n z
1
n=0
If h[n] were bandlimited to ⇡/2 we would expect that G(ej! ) = 0.5H(ej!/2 ). We have that
H(ej!/2 ) =
G(ej! ) =
1
1
1
0.5e j!/2
1
0.25e j!
which is not as expected since the maximum frequency in h[n] is higher than ⇡/2.
%% Pr 12_36
clear all; clf
n=0:100;
h=0.5.ˆn;a=[1 -0.5];
g=0.25.ˆn;c=[1 -0.25];
[H,w]=freqz(1,a);
[G,w]=freqz(1,c);
figure(1)
subplot(221)
stem(n(1:10),h(1:10));ylabel(’h[n]’)
subplot(222)
plot(w/pi,abs(H));axis([0 1 0 2]);grid
ylabel(’|H|’)
subplot(223)
stem(n(1:10),g(1:10));ylabel(’g[n]’);xlabel(’n’)
subplot(224)
plot(w/pi,abs(G));axis([0 1 0 2]);grid
ylabel(’|G|’);xlabel(’\omega/\pi’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.57
1
2
0.8
1.5
|H|
h[n]
0.6
1
0.4
0.5
0.2
0
0
2
4
6
8
0
10
1
0
0.2
0.4
0
0.2
0.4
0.6
0.8
1
0.6
0.8
1
2
0.8
1.5
|G|
g[n]
0.6
0.4
0
1
0.5
0.2
0
2
4
6
n
8
10
0
ω/π
Figure 12.22: Problem 36: Impulse and magnitude responses.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.58
12.37 (a) The impulse response h[n] corresponding to H(z) is
h[n] =
1
( [n] + [n
3
1] + [n
2])
and the desired impulse response is
g[n]
=
cos(⇡n)h[n] =
1
( 1)n ( [n] + [n
3
=
1
( [n]
3
1] + [n
[n
1] + [n
2])
2])
The frequency response of the high-pass filter is obtained from g[n] directly, or by using the modulation
property according to which the Fourier transform of g[n] = cos(⇡n)h[n] is
G(ej! )
=
=
=
0.5H(ej(! ⇡) ) + 0.5H(ej(!+⇡) ) = H( ej! )
1
(1 e j! + e j2! )
3
e j!
(2 cos(!) 1)
2
(b)
%% Pr 12_37
clear all;clf
n=0:10;
h=(1/3)*[1 1 1];
g=(1/3)*[1 -1 1];
[H,w]=freqz(h,1);
[G,w]=freqz(g,1);
figure(1)
subplot(221)
stem(n,[h zeros(1,8)]); ylabel(’h[n]’)
subplot(222)
plot(w/pi,abs(H));axis([0 1 0 1.1]);grid;ylabel(’|H|’)
subplot(223)
stem(n,[g zeros(1,8)]);ylabel(’h[n]’);xlabel(’n’)
subplot(224)
plot(w/pi,abs(G));axis([0 1 0 1.1]);grid;ylabel(’|H|’);xlabel(’\omega/pi’)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.59
0.4
1
0.8
|H|
h[n]
0.3
0.2
0.6
0.4
0.1
0
0.2
0
2
4
6
8
0
10
0
0.2
0.4
0
0.2
0.4
0.6
0.8
1
0.6
0.8
1
0.4
1
0.8
|H|
h[n]
0.2
0
0.6
0.4
−0.2
−0.4
0.2
0
2
4
6
n
8
10
0
ω/pi
Figure 12.23: Problem 37: Impulse and magnitude responses of low– and high–pass filters.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.60
12.38 Let the transformation be of a general form
Z
1
=
N (z)
D(z)
Given the low-pass prototype filter found from MATLAB to be
H(Z) =
To get the desired filter we replace Z
H(z)
=
=
b0 + b1 Z
a0 + a1 Z
1
+ b2 Z
1+a Z
2
2
2
1
b0 + b1 N (z)/D(z) + b2 N 2 (z)/D2 (z)
a0 + a1 N (z)/D(z) + a2 N 2 (z)/D2 (z)
b0 D2 (z) + b1 N (z)D(z) + b2 N 2 (z)
a0 D2 (z) + a1 N (z)D(z) + a2 N 2 (z)
To implement the multiplication of the polynomials we use the convolution sum property, i.e., the
coefficients of products of polynomials are obtained by their convolution. So,
D2 (z)
2
N (z)
N (z)D(z)
,
d⇤d
,
n⇤d
,
n⇤n
where d = [d0 d1 d2 ], n = [n0 n1 n2 ] are vectors formed by the coefficients of D(z) and N (z) in
increasing powers of z 1 . The coefficients of the numerator and denominator of H(z) are thus
b̂ = b0 (d ⇤ d) + b1 (n ⇤ d) + b2 (n ⇤ n)
â = a0 (d ⇤ d) + a1 (n ⇤ d) + a2 (n ⇤ n)
(a)–(c) Using the above results, the following script is used to design the prototype low-pass, to determine the transformations and to obtain the desired filters.
%% Pr 12_38
clear all; clf
[b,a]=butter(2,0.5); % prototype lpf
[H,w]=freqz(b,a);
% transformation parameters
thetap=pi/2;wp=pi/3;
alpha1= -cos((thetap+wp)/2)/cos((thetap-wp)/2);
wp1=pi/2;wp2=3*pi/4;
alpha2=cos((wp2+wp1)/2)/cos((wp2-wp1)/2);
k=cot((wp2-wp1)/2)*tan(thetap/2);
%% high-pass
alp1=[1 -alpha1];alp2=[-alpha1 1];
bhp=b(1)*conv(alp1,alp1)-b(2)*conv(alp1,alp2)+b(3)*conv(alp2,alp2);
ahp=a(1)*conv(alp1,alp1)-a(2)*conv(alp1,alp2)+a(3)*conv(alp2,alp2);
[Hhp,w]=freqz(bhp,ahp);
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.61
%% band-pass
bb=2*alpha2/(k+1)
cc=(k-1)/(k+1)
alp1=[-1 bb -cc];alp2=[cc -bb 1];
bbp=b(1)*conv(alp1,alp1)+b(2)*conv(alp1,alp2)+b(3)*conv(alp2,alp2);
abp=a(1)*conv(alp1,alp1)+a(2)*conv(alp1,alp2)+a(3)*conv(alp2,alp2);
[Hbp,w]=freqz(bbp,abp);
figure(1)
subplot(311)
plot(w/pi,abs(H))
ylabel(’|H(eˆ{j\omega})|’)
subplot(312)
plot(w/pi,abs(Hhp))
ylabel(’|H_{hp}(eˆ{j\omega})|’)
subplot(313)
plot(w/pi,abs(Hbp))
ylabel(’|H_{bp}(eˆ{j\omega})|’)
xlabel(’\omega/\pi’)
|H(ejω)|
1
0.5
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0
0.1
0.2
0.3
0.4
0.5
ω/π
0.6
0.7
0.8
0.9
1
|Hhp(ejω)|
1
0.5
0
|Hbp(ejω)|
1
0.5
0
Figure 12.24: Problem 38: Magnitude responses of low–, high– and band–pass filters.
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.62
12.39 (a) The impulse response h1 [n] is the up-sampled version of h[n] and given as
⇢
h[n/2] n = 0, 2, 4, · · ·
h1 [n] =
0
otherwise
so that H1 (z) = H(z 2 ). If we let H(z) be a prototype low-pass filter, H1 (z) is a band-eliminating
filter.
(b) Using the modulation property we have
h1 [n] , H1 (z)
h2 [n] = 2h1 [n] cos(⇡n/2) , H2 (z) = H1 (ej⇡/2 z) + H1 (e
j⇡/2
z)
giving a band-pass filter centered around ⇡/2. If z0 = r0 ej!0 is a pole/zero of H1 (z) then changing
z0 ! ej⇡/2 z0 gives that r0 ej!0 +⇡/2 is the location of a pole/zero of H2 (z), i.e., there is a rotation of
⇡/2. There is also a rotation of ⇡/2, to thus double the order of the filter.
(c) The parallel connection has a transfer function G(z) = H1 (z) + H2 (z). The numerator and denominator coefficients of G(z) are found using the conv function.
Solution
%% Pr 12_39
clear all; clf
[b,a]=butter(2,0.5); % prototype lpf
[H,w]=freqz(b,a);
% upsampled filter
a1=[a(1) 0 a(2) 0 a(3)];b1=[b(1) 0 b(2) 0 b(3)];
[H1,w]=freqz(b1,a1);
% bandpass filter transformation
br=roots(b1);
cr1=br*exp(j*pi/2);
cr2=br*exp(-j*pi/2);
C=poly([cr1;cr2]);
ar=roots(a1);
dr1=ar*exp(j*pi/2);
dr2=ar*exp(-j*pi/2);
D=poly([dr1;dr2]);
[H2,w]=freqz(C,D); % bandpass
C=C/max(abs(H2));
[H2,w]=freqz(C,D); % unit gain in passband
% parallel connection
gnum=conv(C,a1)+conv(D,b1)
gden=conv(D,a1)
[G,w]=freqz(gnum,gden);
figure(1)
subplot(221)
zplane(b,a)
subplot(222)
zplane(b1,a1)
subplot(223)
zplane(C,D)
subplot(224)
zplane(gnum,gden)
figure(2)
Copyright 2014, Elsevier, Inc. All rights reserved.
Chaparro — Signals and Systems using MATLAB
12.63
subplot(221)
plot(w/pi,abs(H));axis([ 0 1 0 1.2]); ylabel(’|H|’)
subplot(222)
plot(w/pi,abs(H1));axis([ 0 1 0 1.2])
hold on
plot(w/pi,abs(H2),’r’);axis([ 0 1 0 1.2])
legend(’|H_1|’,’|H_2|’)
hold off
ylabel(’|H_1|, |H_2|’);xlabel(’\omega/\pi’)
subplot(223)
plot(w/pi,abs(G));axis([ 0 1 0 1.2]);; ylabel(’|G|’)
xlabel(’\omega/\pi’)
The numerator and denominator coefficients of H(z), H1 (z), the bandpass filter H2 (z) and G(z) are
0.5
0.5
0
2
−0.5
−1
0
−0.5
0
0.5
Real Part
1
1
0.8
0.6
0.2
2
−1
1
1
0.8
0.4
−0.5
−1
−1
0
0.0858
0.0000 0.0294
-0.2010
0.0000
-0.0000
2
|H1|, |H2|
1
|H|
1
Imaginary Part
Imaginary Part
b = 0.2929
0.5858
0.2929
a =1.0000
-0.0000
0.1716
a1 = 1.0000
0
-0.0000
0
0.1716
b1 = 0.2929
0
0.5858
0
0.2929
C = 0.0858
0
-0.3431
0
0.5147
0
-0.3431
D = 1.0000
0
-0.0000
0
0.3431
0
-0.0000
gnum = 0.3787
0
0.2426
0
0.9228
0
0.2832
0.0000
-0.0416
0.0000
0.0233
gden = 1.0000
0
-0.0000
0
0.5147
0
0.0883
-0.0000
-0.0000
0.0000
0.0051
−0.5
0
0.5
Real Part
0
1
|H1|
|H2|
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
0
0
0.2
0.4
0.6
0.8
1
ω/π
1
2
2
2
4
−0.5
4
0.5
3
3
3
3
0.8
|G|
0
2
Imaginary Part
Imaginary Part
1
0.5
0
−0.5
0.6
0.4
0.2
−1
−1
−1
−0.5
0
0.5
Real Part
1
−1
−0.5
0
0.5
Real Part
1
0
0
0.2
0.4
0.6
0.8
1
ω/π
Figure 12.25: Problem 39: Left (clockwise from top left) Poles/zeros of lowpass, notch, bandpass and parallel; right: corresponding magnitude responses.
Copyright 2014, Elsevier, Inc. All rights reserved.
0.0000
Download