0% found this document useful (0 votes)
4 views

DSP 20 Chapter 3

The document defines and discusses discrete-time signals and sequences. Discrete-time signals are functions whose independent variable takes values from a discrete set like integers. Sequences are discrete-time signals represented by a list of samples. Common operations on sequences like addition, multiplication, time-shifting and time-reversal are defined. Basic sequences like the unit sample, unit step and exponential sequences are introduced.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

DSP 20 Chapter 3

The document defines and discusses discrete-time signals and sequences. Discrete-time signals are functions whose independent variable takes values from a discrete set like integers. Sequences are discrete-time signals represented by a list of samples. Common operations on sequences like addition, multiplication, time-shifting and time-reversal are defined. Basic sequences like the unit sample, unit step and exponential sequences are introduced.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Chapter 3

Discrete-Time Signals and Systems

3.1 What are Discrete-Time Signals?

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.

Definition 3.1.1 Sequences. A function x : Z ! C is called a sequence and is notated by


x(n). If x only takes real values, the sequence is called a real sequence.

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

Example 3.1.3 Here are several examples of sequences.

(1) x(n) = a · n + b, where n 2 Z and a, b 2 R. This sequence is called an arithmetic


progression.

(2) x(n) = a · rn , where n 2 Z and a 2 R. This sequence is called a geometric progression.


1 n
(3) x(n) = +i· , n 2 Z, is a complex sequence.
1+n 1 + n2
(4) x(t) = e 2t
, where t 2 R, is a continuous signal.

(5) x(n) = 2n, if n 2 Z, n > 0, and x(n) = 0 elsewhere, is a sequence defined on N.

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.

Definition 3.1.5 Monotonous sequences. A real sequence x(n) is said to be


9 8
increasing >
>
>
>
>
> x(n)  x(n + 1)
>
= >
<
decreasing x(n) x(n + 1)
if and only if for all n 2 Z
strictly increasing >>
>
>
>
> x(n) < x(n + 1)
> >
strictly decreasing ; : x(n) > x(n + 1)

In any of the above cases the sequence is called monotonous.

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]).

Figure 3.2: Bounded and monotonous signals

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).

Next, we define some elementary operations on sequences. These operations combine


sequences through a series of operations to produce new sequences. Elementary operations are
multiplication, addition, scalar multiplication, time shifting, and time reversal.
32 Discrete-Time Signals and Systems

Definition 3.1.8 Elementary operations on sequences. Let x1 , x2 (n) be sequences, where


n 2 Z, and a, b 2 C constants.

(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).

In Figure 3.3 an example of these operations applied to a finite signal is shown.

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).

Exercise 3.1.10 Let x1 (n), x2 (n) be two sequences defined on Z.

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

Figure 3.3: Time-shifting and time-reversal of signals

Problem 3.1.14 Let x(n) be a real sequence defined on Z.

(1) Write x(n) as a combination of the function (n).

(2) Write x(n) as a combination of the function u(n).

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

Figure 3.4: Unit sample and unit step sequences

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

x(n) =b · an = b · (rei✓ )n = b · rn ei✓n =


brn (cos(✓n) + i sin(✓n)) = brn cos(✓n) + ibrn sin(✓n)

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.

3.2 Classification of Discrete-Time Signals

Definition 3.2.1 Symmetric sequences. A real signal x(n), n 2 Z, is said to symmetric if


x(n) = x( n) for all n. The signal x(n) is called antisymmetric when x(n) = x( n) for all
n.

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

Figure 3.5: Symmetric and antisymmetric sequences

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

Definition 3.2.3 Finite sequences. A signal is called a finite sequence if it is defined on a


finite interval [N1 , N2 ], where N1 , N2 2 Z and N1  N2 . We write n = [N1 , N2 ] to establish that
the independent variable n 2 [N1 , N2 ]. Signals defined on infinite intervals are called infinite
sequences.

Finite signals can be thought of as infinite signals taking zero values outside the interval
[N1 , N2 ].

Definition 3.2.4 Sided sequences. A right-sided sequence- x(n) is an infinite sequence


such that x(n) = 0 if n < N1 , for certain N1 2 Z. Analogously, x(n) is left-sided sequences
if x(n) = 0 if N2 > 0 for certain N2 2 Z.

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

Figure 3.6: Periodic signals

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

A signal whose total energy is finite is said to be an energy signal.

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

If x(n) is periodic with fundamental period N , the power signal is


N
1 X
P = |x(n)|2 (3.5)
N n=0

A signal whose average power is finite is called a power signal.

Problem 3.2.10 Explain what E and P are measuring and why they are defined the way they
are.

Problem 3.2.11 Let x(n) be an aperiodic signal.

(1) If E is finite, what is its average power?


3.3. Sampling Processing of Analog Signals 37

(2) If E is infinite, is P necessarily infinite? Determine in what cases P is finite or infinite.

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)

(2) x(n) = en u(n) (4) x(n) = cos(⇡n)u(n)

3.3 Sampling Processing of Analog Signals

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.4 Discrete-Time Systems

3.4.1 Basic Discrete-Time Systems


.
A discrete-time system (DTS) is defined as a transformation between signals. It is often
thought of as an operator R that takes a sequence x(n) as input and returns another sequence
y(n) as output. We write y(n) = R(x(n)). Discrete-time systems are classified according to
the nature and properties of the transformation R. They are also called digital filters.
We next list some basic DTS. Here x(n) is the input signal and y(n) is the output signal.

(1) DTS as elementary operations on sequences. Basic operations on sequences are


in fact DTS themselves. We recall some of them, namely, scalar multiplication, time
38 Discrete-Time Signals and Systems

Figure 3.7: Sampling continuous signals

shifting, and time reversal. Their mathematical expressions are, respectively,

y(n) = ax(n), y(n) = x(n n0 ), y(n) = x( n)

where a 2 R and n0 is an integer.

(2) Compressor systems. It is defined as

y(n) = x(k · n) (3.7)

where k is a non-null integer number.

(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

3.4.2 Classification of Discrete-Time Systems


Definition 3.4.1 Linear systems. Let R be a DTS. This system is said to be linear if, for
all a, b 2 C and signals x1 (n), x2 (n), n 2 Z, the equation

R(ax1 (n) + bx2 (n)) = a R(x1 (n)) + b R(x2 (n)) (3.11)

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.

Problem 3.4.4 Check for time invariance of the system defined as


P
(1) The accumulator y(n) = nk= 1 x(k) (2) The compressor y(n) = x(2n)

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.7 Memoryless systems. A system is said to be memoryless if y(n) is only a


function of x(n).

For example, y(n) = x(n)2 is a memoryless system as it only depends on n.

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)).

3.5 Linear Time-Invariant Discrete-Time Systems

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

Now, we apply the operator R to x(n),


1
!
X
y(n) = R(x(n)) = R x(k) (n k)
k= 1
3.5. Linear Time-Invariant Discrete-Time Systems 41

By using the linearity of R, we can write


1
X 1
X
y(n) = R(x(k) (n k)) = x(k) R( (n k))
k= 1 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 .

(1) Commutative Law. x1 (n) ⇤ x2 (n) = x2 (n) ⇤ x1 (n).

(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).

Review 3.5.1 Review absolute convergence in Section 7.3.2.

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.

(1) Ideal delay: h(n) = (n n0 ), where n0 2 Z

(2) Forward di↵erence: h(n) = (n + 1) (n)

(3) Backward di↵erence: h(n) = (n) (n 1)

(4) Unit step: h(n) = u(n)

(5) h(n) = an · u(n), where a 2 R.


42 Discrete-Time Signals and Systems

3.6 Linear Causal Time-Invariant Discrete-Time


Systems

3.6.1 Characterization of Linear Causal Time-Invariant


Discrete-Time Systems
In general, discrete-time can be described and characterized by a special type of equations, the
so-called di↵erence equations. The unknowns of these equations are sequences, typically the
input signal x(n), and their solutions are also sequences, the output signal y(n).

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.

Linear causal time-invariant discrete-time systems (LCTIDT systems) are charac-


terized by linear di↵erence equations. The general form of those di↵erence equations is
1
X 1
X
y(n) = bm x(n m) am y(n m) (3.15)
m= 1 m= 1

where am , bm are real or complex sequences.


Since the system is causal, the input sequence is not defined for values greater than n (the
present value). If m is negative, then n m is a future value of the independent variable (that
is, greater than n). Therefore, Equation 3.15 can be rewritten as
1
X 1
X
y(n) = bm x(n m) am y(n m) (3.16)
m=0 m=1

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

whereas the explicit di↵erence equation is

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.

3.6.2 Higher-Order Linear Constant-Coefficient Di↵erence


Equations
A very important and frequent case is given by systems governed by linear di↵erence equa-
tions whose coefficients are constant. They are called linear constant-coefficient di↵erence
equations (LCCDE). We are going to show how to solve homogeneous recursive LCCDE in
the case of causal, time-invariant systems for finite sequences. Without loss of generality, we
can assume that n = [0, N ] for the input sequence x(n), for some integer N > 0. The equation
LCCDE is then of the form (by making bm = 0 in Equation 3.17)
n
X
y(n) = am y(n m) (3.19)
m=1

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✓)

Example. Let’s consider the third-order linear equation


(
y(n) 2y(n 1) + y(n 2) + 2y(n 3) = 0,
y(0) = 1, y(1) = 1, y(2) = 2

Its characteristic polynomial is P ( ) = 3 2 2 + +2. By using the MATLAB command


roots, we find that the roots of P ( ) are 1 = i, 2 = i, 3 = 2. The three roots are
distinct. Therefore, the general solution is
y(n) = ↵1 in + ↵2 ( i)n + ↵3 2n
By making y(n) meet the initial conditions, we obtain the following linear system of
equations.
8 8
> 0
< ↵1 i + ↵2 ( i)0 + ↵3 20 = 1 >
< ↵1 + ↵2 + ↵3 = 1
↵1 i1 + ↵2 ( i)1 + ↵3 21 = 1 i↵1 i↵2 + 2↵3 = 1
>
: >
:
↵1 i2 + ↵2 ( i)2 + ↵3 22 = 2 ↵1 ↵2 + 4↵3 = 2
Solving this system by using MATLAB, we find that the values for the ↵i are
↵1 = 1/5 + 11/10i, ↵2 = 1/5 11/10i, ↵3 = 3/5

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

Its characteristic polynomial turns out to be P ( ) = 4 3


6 8. Again, by using
the command
roots([1 -1 0 -6 -8], MATLAB returns the roots 1 = 2 with multiplicity 3 and 2 = 1.
The polynomial P ( ) can be decompose as P ( ) = ( 2)3 · ( + 1). According to the
above discussion, the general solution is
✓ ◆ ✓ ◆
n n n n n
y(n) =↵1 2 + ↵2 2 + ↵3 2 + ↵4 ( 1)n
1 2
n(n 1) n
↵1 2n + ↵2 n2n + ↵3 2 + ↵4 ( 1)n
2

We impose the initial conditions on the general solution,


8
>
> ↵1 + ↵2 · 0 + ↵3 · 0 + ↵4 = 1
>
>
<
2↵1 + 2↵2 + 0 · ↵3 ↵4 = 2
>
> 4↵1 + 8↵2 + ↵3 + ↵4 = 1
>
>
: 8↵ + 16↵ + 3↵ ↵4 = 0
1 2 3

When solved this system in MATLAB, we obtain

↵1 = 0.25, ↵2 = 0.875, ↵3 = 4.25, ↵4 = 0.75

The final solution is


n(n 1)
y(n) = 0.25 · 2n + 0.875 · n2n 4.25 · 2n 0.75 · ( 1)n
2
Exercise 3.6.3 Study the previous cases with the following simple second-order di↵erence
equations.

(1) y(n + 2) = 4y(n) with the initial conditions 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.

Problem 3.6.5 Make a mind map of this chapter.

3.7 MATLAB Exercises

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.

(1) x(n) = 2n2 + 1 on [ 5, 5].


(2) x(n) = 2n on [ 5, 5].
(3) x(n) is given by the table below.
n -2 1 0 1 2
x(n) 1.5 0.3 -0.6 0.2 0.1

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:

(1) x1 (n) · x2 (n) (6) the compressor x2 (2n) system


(2) x1 (n)2 Pn
(7) the accumulator system k= 1 x3 (n)
1
(3) n · x1 (n) · x2 (n)
n (8) the moving average of x3 (n) for M1 =
(4) x2 (n) delayed by 5 samples M2 = 1

(5) the time-reversed sequence of x1 (n) (9) the cross-correlation of x1 (n) and x2 (n)

Compute also the energy of x1 (n) and x1 (n) ⇤ x3 (n).

Program 3.7.4 Given a complex signal x(n), we define its auto-correlation as


1
X
Rx (n) = x(k)x(n k) (3.21)
k= 1

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).

Program 3.7.7 Symbolic calculus in MATLAB. MATLAB is equipped with a symbolic


calculus engine. Read the following web pages from its online help.

• Symbolic variables and functions https://www.mathworks.com/help/symbolic/


syms.html?s tid=doc ta

• Plotting symbolic functions https://www.mathworks.com/help/symbolic/fplot.html?


s tid=doc ta

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.

You might also like