DSP 20 Chapter 3
DSP 20 Chapter 3
In Chapter 1, a signal was defined as a mathematical function that represents a physical quantity
varying with any independent variable (being time a frequent case). When the independent
variable takes values on a discrete set the signal is called a discrete-time signal. A set of
numbers is said to be discrete if for every number there exists an interval only containing that
number. Clearly, N and Z are discrete sets; in fact, Z will be the most used set in DSP. The
term discrete-time refers to the independent variable, which can be di↵erent from time. For
historical reasons, this terminology has been kept. If the independent variable takes values in a
continuous set, such as R or a real interval, then the signal is called continuous-time signal
In DSP, the values of the function are called amplitude (again for historical reasons). The
amplitude takes values either in the set of real numbers R or in the set of complex numbers C.
Therefore, discrete signals can be represented as a sequence of numbers called samples.
Sometimes sequences of interest are only defined on N. In that case, x(n) is defined as zero
for n < 0. If a sequence x(n) is complex, then it can be written as x(n) = xR (n) + ixI (n),
29
30 Discrete-Time Signals and Systems
where xR (n), xI (n) are real sequences and i is the imaginary unit. In general, the subscript R
will be used to denote the real part of a complex number, whereas the subscript I will refer to
the imaginary part.
The terms signal and sequence will be used interchangeably.
Example 3.1.2 In Figure 3.1 two signals are shown. A continuous-time signal is drawn in
Figure 3.1 (a); the graph of the signal is a connected piece. In Figure 3.1 (b) a discrete-time is
depicted; the signal only takes values on the set {0, 1, . . . , 12}.
Figure 3.1: Two signals: (a) a continuous signal; (b) a discrete signal
Review 3.1.1 Review complex numbers from Section 7.1. The notation used in that Section
will be used throughout.
3.1. What are Discrete-Time Signals? 31
Definition 3.1.4 Bounded sequences. A real sequence x(n) is bounded from below if
there exists a constant K1 such that K1 x(n) for all n 2 Z. A real sequence x(n) is bounded
from above if there exists a constant K2 such that x(n) K2 for all n 2 Z. A real sequence
is said to be bounded if it is bounded from below or from above.
Example 3.1.6 In Figure 3.2 two signals are displayed. Signal (a) corresponds to the sequence
x(n) = 1 e n , n 2 N and it is an increasing, bounded sequence. Signal (b) is the plot of
sequence x(n) = n3 /100, n 2 Z. This sequence is decreasing and unbounded (Figure 3.2 only
shows the plot on the interval [ 10, 10]).
Problem 3.1.7 Let x(n) = f (n) a real sequence defined on Z. What general techniques can be
used in order to determine whether x(n) is monotonous and bounded? Define those techniques
in terms of properties of f (n).
(1) Addition. The sum or addition x(n) of two sequences x1 (n), x2 (n) is defined as x(n) =
x1 (n) + x2 (n).
(2) Multiplication. The product or multiplication x(n) of two sequences x1 (n), x2 (n) is
defined as x(n) = x1 · x2 (n).
(3) Scalar multiplication. The scalar multiplication x(n) of a sequence x1 (n) by a scalar
a 2 C is defined as x(n) = a · x1 (n).
(4) Time shifting. Time shifting a sequence consists of shifting the sequence by a certain
number of samples n0 2 Z. Thus, if x1 (n) is the original sequence, then x(n) = x1 (n n0 )
is the shifted sequence.
(5) Time reversal. The time reversal of a sequence is a sequence with its time reversed,
that is, the time reversal of x1 (n) is defined as x(n) = x1 ( n).
Example 3.1.9 Consider the sequence x(n) defined on Z and given by the pairs
{( 2, 2), ( 1, 4), (0, 3), (1, 5), (2, 4), (3, 2))} and defined as zero elsewhere. Figure 3.3 shows
the plot of the original signal in (a); a time-shifting of +2 samples in (b); a time-shifting of -2
samples in (c); and finally the time-reversal signal in (d).
e n n
x1 (n) = 2
+i , x2 (n) = 2 · 3n
1+n n+1
1
Find the following sequences: x1 (n) · x2 (n), x1 (n)2 , i · x1 (n)
· x2 (n), x2 (n) delayed by 5
n
samples, and the time-reversed sequence of x1 (n). Prove that x2 (n) is not bounded, but it is
bounded from below.
In the next few definitions we list the most basic sequences used in DPS.
Definition 3.1.11 Unit sample sequence. The unit sample sequence (n) is defined as
(
1 if n = 0
(n) = (3.1)
0 if n 6= 0
Definition 3.1.12 Unit step sequence. The unit sample sequence u(n) is defined as
(
1 if n 0
u(n) = (3.2)
0 if n < 0
In Figure 3.4 a unit sample sequence and a unit step sequence are drawn.
Exercise 3.1.13 Write the sequences of (n) and u(n) when time-shifted by k samples, k 2 Z.
3.1. What are Discrete-Time Signals? 33
Definition 3.1.15 Exponential sequence. The sequence x(n) = b · an is called the expo-
nential sequence. If a and b are real, then the sequence is real.
Problem 3.1.16 Let x(n) = b·an a real sequence. Study when x(n) is decreasing as a function
of a and b.
Let’s assume that a, b are complex numbers in x(n) = b·an . Let a be written as a = aR +iaI .
Then, a has a representation in the form of a complex exponential as a = r · ei✓ , where
34 Discrete-Time Signals and Systems
p
r = a2R + a2I is the modulus and ✓ is the argument, the angle between the real axis and a.
Therefore, x(n) can be written as
In view of the last expression, an exponential sequence can be written as A(n) cos(✓n) +
iA(n) sin(✓n), for some real sequence A(n). The expression x(n) = b · rn ei✓n is called the
exponential form of the sequence and x(n) = A(n) cos(✓n) + iA(n) sin(✓n) is called the
polar form of the sequence.
Exercise 3.1.17 Given the sequence x(n) = (1 + 2i)(1 i)n , for n 2 Z, find its exponential
and polar form.
In Figure 3.5 two examples of these sequences can be seen. Figure (a) shows a symmetric
signal whereas Figure (b) shows an antisymmetric signal. A symmetric signal is symmetric
with respect to the y-axis. In the case of antisymmetry, the symmetry is around the origin.
3.2. Classification of Discrete-Time Signals 35
Exercise 3.2.2 Determine whether the following signals are symmetric, antisymmetric, or
neither of the two.
⇡
(1) x(n) = cos(n) (3) x(n) = cos 2
n
⇡
(2) x(n) = sin(n) (4) x(n) = sin 2
n
Finite signals can be thought of as infinite signals taking zero values outside the interval
[N1 , N2 ].
Definition 3.2.5 Periodic sequences. A sequence x(n) is said to be periodic if there exists
k 2 Z such that x(n) = x(n+k) for all n 2 Z. The smallest value of k for which x(n) = x(n+k)
is called the fundamental period. Figure 3.6 illustrate this definition.
Real periodic signals are often written as x(n) = A cos(2⇡f · n + ), where f is the fun-
damental frequency —to be defined as the inverse of the fundamental period— and , the
phase. The phase is a shifting in the value of the independent variable.
Problem 3.2.6 Let x1 (n) = cos(n) defined on Z. Prove or disprove that x(n) is periodic.
Consider now the continuous signal x2 (t) = cos(t) defined on R. Answer the same question.
What conclusions can be drawn from this problem?
36 Discrete-Time Signals and Systems
Exercise 3.2.7 Determine whether the following signals are periodic or not. If so, find the
fundamental period.
⇡
(1) x(n) = cos(2n) (2) x(n) = sin 4
n
Review 3.2.1 Review Sections 7.3.1 and 7.3.2 on sequences and numerical series.
Definition 3.2.8 Energy signals. Given a sequence x(n), n 2 Z, the total energy of x(n)
is defined as 1
X
E= |x(n)|2 (3.3)
n= 1
Definition 3.2.9 Power signals. Given an aperiodic sequence x(n), n 2 Z, the average
power of a signal x(n) is defined as the following limit.
XN
1
P = lim |x(n)|2 (3.4)
N !1 2N + 1
n= N
Problem 3.2.10 Explain what E and P are measuring and why they are defined the way they
are.
Problem 3.2.12 Determine whether the sequence x(n) = an u(n), where a 2 R, is an energy
signal, a power signal, or neither, as a function of a.
Problem 3.2.13 Determine whether the sequences defined on Z below are energy signals,
power signal, or neither.
n
(1) x(n) = e u(n) (3) x(n) = nu(n)
Sampling is the conversion of an analog signal into a discrete signal. One way to carry out
sampling is to multiply a continuous-time signal xa (t), t 2 R by a periodic impulse train p(t)
of unit amplitude and period T . A periodic impulse train is a continuous-time signal defined
by (
1 if t = kT , for k 2 Z
p(t) = (3.6)
0 elsewhere
Function p(t) also receives the name of sampling function. Period T is referred to as the
sampling period and the fundamental frequency !T = 2⇡/T as the sampling frequency
(measured in radians). The result of the product xa (t) · p(t) is a discretized signal xp (t), as
illustrated in Figure 3.7.
Problem 3.3.1 Let xp (t) = xa (t)p(t), t 2 R be the product of an analog signal xa (t) and a
periodic impulse train p(t). Write p(t) in terms of the unit sample sequence. Then write xp (t)
by taking into account the new expression of p(t).
(3) Accumulator systems. It captures the idea of accumulating the values of the signal up
to the present time.
Xn
y(n) = x(k) (3.8)
k= 1
3.4. Discrete-Time Systems 39
(4) Moving average systems. Given two positive integers M1 , M2 , a moving average system
is defined as
n+M
X2
1
y(n) = x(k) (3.9)
M1 + M2 + 1 k=n M
1
The output y(n) is calculated as the average of the M1 samples before n, the M2 samples
after, and x(n) itself.
(5) Cross-correlation systems. Given two signals x1 (n), x2 (n) the cross-correlation
rx1 x2 (n) is defined as
1
X
rx1 x2 (n) = x1 (k) · x2 (n k) (3.10)
k= 1
where k is called the lag time shift. The cross-correlation measures the degree of
similarity of two series as a function of the displacement of one relative to the other.
When x1 (n) = x2 (n), we speak of autocorrelation and then we write
1
X
rx1 x1 (n) = x1 (k) · x1 (n k)
k= 1
holds true.
Problem 3.4.2 Determine whether the following systems are linear or not.
P
(1) y(n) = nk= 1 x(k) (2) y(n) = x(n)2 (3) y(n) = x(n n0 ), for
some fixed n0 2 Z.
Definition 3.4.3 Time-invariant systems. A system is said to be time-invariant if, for all
n0 2 Z,
R(x(n n0 )) = y(n n0 ) (3.12)
In other words, when the input signal is shifted, the output signal is shifted by the same amount.
Definition 3.4.5 Causal systems. A causal system is one whose output signal only depends
on past and present samples. More formally, if x(n) is the input and y(n) the output, then
y(n) can be expressed only as a function of x(1), . . . , x(n).
Definition 3.4.6 Anticausal systems. A system is said to be anti-causal if the output y(n)
only depends on future samples x(n + 1), . . . , x(n + k), for some positive integer k.
40 Discrete-Time Signals and Systems
For example, the system y(n) = 3x(n) 2x(n 1) is causal, whereas the system y(n) =
3x(n + 1) 2x(n 1) is not since y(n) depends on a future sample, n + 1.
Definition 3.4.8 Stable system. A system is called stable when every bounded input se-
quence produces a bounded output sequence. Put in mathematical terms, a system is stable if
for every sequence x(n) such that there exists a K1 2 Z such that |x(n)| < K1 for all n 2 Z,
there exists another constant K2 such that |y(n)| < K2 for all n 2 Z.
Problem 3.4.9 Determine whether the following systems are linear or not.
Pn
(1) y(n) = k= 1 x(k) (2) The system y(n) = x(n)3 + 1
Problem 3.4.10 Determine whether the following systems are linear, time invariant, causal,
memoryless, and stable.
Pn
(1) An accumulator y(n) = k= 1 x(k) (4) y(n) = ex(n)
(2) y(n) = g(n)x(n), where g(n) is a fixed
(5) A time reversal system
sequence
(3) A time shifting system (6) y(n) = x(n) + 3u(n + 1)
Definition 3.4.11 Impulse response. Let y(n) = R(x(n)) be a system. The impulse re-
sponse h(n) is the value at the unit sample sequence, h(n) = R( (n)).
Definition 3.4.12 Step response. Let y(n) = R(x(n)) be a system. The step response is
the output given by the input of u(n) in the system, s(n) = R(u(n)).
In this Section we examine linear time-invariant discrete-time systems (LTIDT, for short).
Let R be such an operator or transformation. First, we notice that any discrete-time signal
x(n) can be decomposed as the weighted sum of unit samples sequences
1
X
x(n) = x(k) (n k) (3.13)
k= 1
Let h(n k) be the impulse response at x = n k. Then, the system is given by the following
expression
1
X
y(n) = x(k)h(n k) (3.14)
k= 1
Therefore, LTIDT can be characterized by their values at the impulse response and the input
values x(n). Equation 3.14 is known as the convolution sum. It can be thought of as an
operator and is denoted by ⇤. In our case, y(n) = x(n) ⇤ h(n).
Problem 3.5.1 Determine the convolution sum of the following pairs of signals.
✓ ◆n ✓ ◆n ✓ ◆n
1 n 1 1
(1) h(n) = u(n), x(n) = ( 1) u(n) (2) h(n) = u(n), x(n) = u(n)
5 3 5
Problem 3.5.2 Let x(n), h(n) be two finite sequences of lenghts n and m, respectively. Write
the convolution sum in matrix form. For the finite sequences, x(n) = ( 2, 5) and h(n) =
( 2, 1, 3), find their convolution sum.
Theorem 3.5.3 Properties of the convolution sum. Let x1 (n), x2 (n), x3 (n) be sequences
and .
(2) Associative Law. x1 (n) ⇤ (x2 (n) ⇤ x3 (n)) = (x1 (n) ⇤ x2 (n)) ⇤ x3 (n).
(3) Distributive Law. x1 (n) ⇤ (x2 (n) + x3 (n)) = x1 (n) ⇤ x2 (n) + x1 (n) ⇤ x3 (n).
Problem 3.5.4 Study the conditions for a LTIDT to be a causal system. Find when the
following LTIDT systems are causal in terms of the given impulse sequences.
Review 3.6.1 Review di↵erence equations in Section 7.5.1. Do the exercises and examples
there before carrying on with the material.
which is the general equation for LCTIDT systems. In this equation, the values of the
dependent variable y(n) depends on previous values of y, in particular, those values less than
n. This situation happens when am 6= 0 for all m 2 N. When this is the case, the LCTIDT
equation is said to be recursive. If all am are zero, then the LCTIDT is called a non-recursive
di↵erence equation or explicit di↵erence equation.
A particular interesting class of LCTIDT systems are finite sequences. Assume that the
sequence is finite and n = [N1 , N2 ], N1 < N2 . This means that x(n) = 0 if either n < N1 or
n > N2 . The corresponding recursive di↵erence equation is then
nXN1 nXN1
y(n) = bm x(n m) am y(n m) (3.17)
m=0 m=1
nXN1
y(n) = bm x(n m) (3.18)
m=0
3.6. Linear Causal Time-Invariant Discrete-Time Systems 43
Exercise 3.6.1 A LTI system is at rest position. It is tested with an input signal x(n) whose
values are given by (
2n if n 5
x(n) =
10 if n 6
Obtain the impulse response of the system and deduce the di↵erence equation of the system.
Problem 3.6.2 Justify how the indices of the summations changed when going from Equa-
tion 3.15 to Equation 3.16. Find also how the indices changed in Equations 3.17 and 3.18 when
finite sequences were considered.
Review 3.6.2 Review linear di↵erence equations in Section 7.5.2 and Section 7.5.3. Do all the
problems and exercises in those sections before carrying on.
where am are complex numbers. This equation can be rewritten as the homogeneous equation
n
X
y(n) + am y(n m) = 0 (3.20)
m=1
Let’s assume for the time being that the solution of that equation is given by a polynomial
y(n) = n , where is a complex number. If that is the case, by substituting in the left side of
Equation 3.20, we obtain
n
X n 1
X
n n m n m
+ am = + an m =
m=1 m=0
n n 1 n 2 0
+ a1 + a2 + . . . + an
Here a change of index in the summation was made. The polynomial
n n 1 n 2 0
P( ) = + a1 + a2 + . . . + an
is called the characteristic polynomial of the di↵erence equation. Our reasoning has proved
that the roots of the characteristic polynomial are particular solutions of the di↵erence equation.
If { 1 , . . . , n } are the roots of P ( ), there are n particular solutions given by yi (n) = ni , for
i = 1, . . . , n. The general solution is then a linear combination of those particular solutions
n n
y(n) = y1 (n) + . . . + yn (n) = ↵1 1 + . . . + ↵1 n
44 Discrete-Time Signals and Systems
where ↵i , i = 1, . . . , n, are constants. These constants are determined by imposing the initial
conditions on the equation and solving the corresponding system of linear equations.
However, our analysis is not still complete. We know from the theory that if the order of
the equation is n there must be n distinct particular solutions. In the case of repeated roots,
such a condition does not hold. We next provide a discussion where that issue is addressed.
Case (1): Distinct roots . The general solution is given by y(n) = ↵1 n1 + . . . + ↵n nn since
all the roots are distinct. Some of the roots of P ( ) may be complex roots. Let 1 = a+ib
a complex root of P ( ). We know from basic algebra that its conjugate 2 = 1 = a ib
is also a root (see the properties of the conjugate in Section 7.1). Two particular solutions
are therefore y1 (n) = ↵1 (a + ib)n and y1 (n) = ↵2 (a ib)n . Their sum is also a particular
solution
y1 (n) + y2 (n) = ↵1 (a + ib)n + ↵2 (a ib)n
If we use the exponential form of a complex number by letting a + ib = rei✓ and a ib =
re i✓ , where r is the radius of a + ib and ✓ is its argument. Notice that the argument of
the conjugate is ✓.
y1 (n) + y2 (n) = ↵1 rn ei✓n + ↵2 rn e i✓n =
= ↵1 rn (cos(✓) + i sin(✓))n + ↵2 rn (cos(✓) i sin(✓))n
= ↵1 rn (cos(n✓) + i sin(n✓)) + ↵2 rn (cos(n✓) i sin(n✓))
= rn (↵1 + ↵2 ) cos(n✓) + irn (↵1 ↵2 ) sin(n✓)
The argument of i is ⇡/2 and its radius 1. Then, i can be represented as i = ei⇡/2 =
sin(⇡/2) and i = as i = e i⇡/2 . By applying the computations above for the conjugate
complex roots, the final form of the solution is
y(n) =2/5 cos(n⇡/2) + 11/5 sin(n⇡/2) + 3/5 · 2n
3.6. Linear Causal Time-Invariant Discrete-Time Systems 45
Case (2): Repeated roots . The number of distinct roots is now less than n, the degree of
P ( ). Let { 1 , . . . , r } be the set of roots where r < n. Furthermore, let mi , i = 1, . . . , r
be the multiplicities of roots i , i = 1, . . . , r. The sum m1 + . . . + mr is equal to n. It can
be proved (see [Ela05], Section 2.3) that the set Gi
⇢ ✓ ◆ ✓ ◆ ✓ ◆
n n n 1 n n 2 n n mi +1
Gi = i, , ,...,
1 i 2 i mi 1 i
is a set of solutions for i = 1, . . . , r. The whole set of solutions of the di↵erence equation
is the union of the Gi , G1 [ G2 . . . Gr .
Example. For this case, we consider the equation below.
(
y(n) y(n 1) 6y(n 3) 8y(n 4) = 0,
y(0) = 1, y(1) = 2, y(2) = 1, y(3) = 0
(2) y(n + 1) 4y(n) + 4y(n 1) = 0 with the initial conditions y(1) = 5 and y(2) = 8.
46 Discrete-Time Signals and Systems
(3) y(n) + 4y(n 2) = 0 with the initial conditions y(1) = 1 and y(2) = 4.
Problem 3.6.4 Solve the di↵erence equation. If needed, use MatLab to find the roots of the
characteristic polynomial.
y(n) 7y(n 1) + 16y(n 2) 12y(n 3) = 0
with the initial conditions y(0) = 0, y(1) = 1, y(2) = 1.
Program 3.7.1 Plot the following finite signals in MATLAB. Make a neat figure by adding
title, legends, x- and y-ticks, the right limits for the plots.
Program 3.7.2 Plot the real part, the imaginary part, the radius, and argument of the signal
x(n) = exp(2 · i · pi · n/100) for n = 0, . . . , 100.
Program 3.7.3 Define in MATLAB the signals x1 (n) = [1, 1, 0, 1, 1, 0, 1, 1] and x2 (n) =
[ 1, 2, 1, 0, 1/2, 1/2, 1, 1] on n = [ 3, 4], and signal x3 (n) = [1, 2, 3, 4] on n = [ 1, 2].
Compute the following sequences:
(5) the time-reversed sequence of x1 (n) (9) the cross-correlation of x1 (n) and x2 (n)
Find the autocorrelation of signasl x1 (n), x2 (n), x3 (n) in Program 3.7.3. Explain the meaning
of this operator.
3.7. MATLAB Exercises 47
Program 3.7.5 Write three scripts to define the following functions: the unit sample, the step
sequence, and the rectangular pulse. The last function is defined as 1 on n = [N1 , N2 ] and 0
elsewhere.
Program 3.7.6 Let x(n) be a signal defined by x(n) = [0.5, 1, 1.1, 0.3, 0.2] en n = [ 2, 2].
Compute a matrix A such that b(n) · A = x(n) ⇤ b(n), where b(n) is an arbitrary signal of length
6. Check your solution with di↵erent signals b(n).
Plot the graphs of the continuous-time functions sin(t), sin(2t), 2 sin(t) on the interval [ 2⇡, 2⇡].
Program 3.7.8 Write a MATLAB script that takes an analog signal and a train pulse as input
and outputs the discretized signal. Assume that the train pulse is defined on n = [N1 , N2 ]. Try
to generalize your script to the symbolic domain.