0% found this document useful (0 votes)
128 views73 pages

Discrete-Time Signal Processing Basics

Digital signal processing involves analyzing and processing discrete-time signals. A discrete-time signal is a sequence of real or complex numbers indexed by a discrete variable such as time. Common signal types include finite, infinite, periodic, and aperiodic signals. Discrete-time systems transform an input signal into an output signal according to a fixed set of rules. System properties like memorylessness and additivity depend on whether the output only depends on current input or allows past inputs, and whether the system response to summed inputs equals the sum of individual responses.

Uploaded by

Aira Mae Crespo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
128 views73 pages

Discrete-Time Signal Processing Basics

Digital signal processing involves analyzing and processing discrete-time signals. A discrete-time signal is a sequence of real or complex numbers indexed by a discrete variable such as time. Common signal types include finite, infinite, periodic, and aperiodic signals. Discrete-time systems transform an input signal into an output signal according to a fixed set of rules. System properties like memorylessness and additivity depend on whether the output only depends on current input or allows past inputs, and whether the system response to summed inputs equals the sum of individual responses.

Uploaded by

Aira Mae Crespo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

Digital Signal Processing

Signals And Systems


Discrete-Time Signals
 An indexed sequence of real or complex numbers
 A function of an integer-valued variable, n, that is
denoted by x(n).

The graphical representation of a discrete-time signal x(n)


Discrete-Time Signals
The sequence values x(0) to x(N – 1) may be
considered to be the elements of a column
vector: x = éë x ( 0 ) , x (1) , ..., x ( N - 1 )ùû
T

Often derived by sampling a continuous-time


signal, such as speech, with an analog-to-
digital (A/D) converter.
continuous-time signal: xa ( t ) sampling rate: f s = 1/ Ts samples per second
sampled signal: x ( n )
x ( n ) = xa ( nTs )
Complex Sequences
 A discrete-time signal may be complex-valued.
 A complex signal may be expressed either in terms of its real and
imaginary parts
z ( n ) = a ( n ) + jb ( n) = Re { z ( n)} + j Im{ z ( n)}
Or in polar form in terms of magnitude and phase
z ( n ) = z ( n ) exp éë j arg { z ( n)}ùû
 The magnitude may be2derived from the real and imaginary parts
z ( n ) = Re2 { z ( n)} + Im 2 { z ( n)}
whereas the phase may be found using arg { z ( n )} = tan -1 Im { z ( n )}
Re { z ( n )}
 If z(n) is a complex sequence, the complex-conjugate denoted by
z*(n):
z * ( n ) = Re { z ( n )} - j Im{ z ( n)} = z ( n) exp éë - j arg{ z( n)} ùû
Some Fundamental Sequences
ì1 n=0
The unit impulse/sample d ( n) = í
î0 otherwise

The unit step ì1


u ( n) = í
n³0
î0 otherwise n
and is related to the unit impulse u ( n ) = å d ( k )
k =-¥
Similarly, a unit sample may be as a difference of
two steps d ( n ) = u ( n ) - u ( n - 1)
Exponential sequence ( ) x n = a n

Complex exponential e jnw = cos ( nw0 ) + j sin ( nw0 )


0
Signal Duration
D i s c r e t e - s i g n a l s m a y b e c o n v e n i e n t l y
classified in terms of their duration or extent.
A discrete-time signal is finite-length sequence
if it is equal to zero for all values of n outside a
finite interval [N1, N2].
Signals that are not finite in length, e.g. unit
step and complex exponential, are said to be
infinite-length sequences.
Signal Duration
A right-sided sequence, e.g. unit-step, is any
infinite-length sequence that is equal to zero
for all values of n < n0 for some integer n0.
A left-sided sequence is any infinite-length
sequence that is equal to zero for all values of
n > n0 for some integer n0. An example is
ì1 n £ n0
x ( n ) = u ( n0 - n ) = í
î0 n > n0
A two-sided sequence is neither right-sided nor
left-sided, such as the complex exponential.
Periodic and Aperiodic Sequences
A signal is said to be periodic if, for some
positive real integer N,
x (n) = x (n + N )
For all N. This is also periodic with period 2N,
3N, and so on.
If the above equation is not satisfied for any
integer N, x(n) is said to be an aperiodic signal.
Example
ì a n
n³0
The signals x1 ( n ) = a nu ( n ) = í
n<0 î0
and x2 ( n ) = cos ( n )
2

are not periodic, whereas the signal


x3 ( n ) = e jp n /8

is periodic and has a fundamental period of N =


16.
Example
If x1(n) is a sequence that is periodic with a period
N1, and x2(n) is another sequence that is period N2,
the sum
x ( n ) = x1 ( n ) + x2 ( n)

will always be periodic and the fundamental period


is N1 N 2
N=
gcd ( N1 , N 2 )
where gcd(N 1 , N 2 ) means the greatest common
denominator of N 1 and N 2 . The same is true for
the product x ( n ) = x1 ( n ) x2 ( n)
Periodic and Aperiodic Sequences
Given any sequence x(n), a periodic signal may
always be formed by replicating x(n)
¥
y ( n) = å x ( n - kN )
k =-¥
where N is a positive integer. In this case, y(n)
will be periodic with period N.
Symmetric Sequences
Definition: A real valued signal is said to be
even if, for all n,
x ( n ) = x ( -n )
whereas a signal is said to be odd if, for all n,
x ( n ) = - x ( -n )
A signal x(n) may be decomposed into a sum of
its even part, x e (n) and its odd part, x o (n), as
follows: x ( n ) = xe ( n ) + xo ( n )
Symmetric Sequences
To find the even part of x(n) we form the sum
xe ( n ) = 12 éë x ( n ) + x ( -n )ùû
whereas to find the odd part we take the
difference
xo ( n ) = 12 éë x ( n ) - x ( -n )ùû
Symmetric Sequence
Definition: A complex signal is said to be
conjugate symmetric if, for all n,
x ( n ) = x * ( -n )
and a signal is said to be conjugate
antisymmetric if, for all n,
x ( n ) = - x * ( -n )
Any complex signal may always be decomposed
into a sum of a conjugate symmetric signal and
a conjugate antisymmetric signal.
Signal Manipulations
Transformations of the Independent Variable
y ( n ) = x ( f ( n) )
where f(n) is some function of n.
Shifting. Defined by f(n) = n – n0. If y(n) = x(n
– n0), x(n) is shifted to the right by n0 samples
if n 0 is positive (referred to as delay)and
shifted to the left by n 0 samples if n 0 is
negative.
Signal Manipulations
Reversal. Given by f(n) = – n and simply
involves “flipping” the signal x(n) with respect
to the index n.
Time Scaling. Defined by f(n) = Mn (down-
sampling) or f(n) = n/N (up-sampling) where
M and N are positive integers.
Signal Manipulations
Signal Manipulations
Signal Manipulations
Addition, Multiplication, and Scaling
Addition. The sum of two signals
y ( n ) = x1 ( n ) + x2 ( n ) -¥ < n < ¥

Multiplication. The product of two signals


y ( n ) = x1 ( n ) x2 ( n ) -¥ < n < ¥
Scaling. Amplitude scaling of a signal x(n) by
a constant c
y ( n ) = cx ( n ) -¥ < n < ¥
Signal Decomposition
The unit sample may be used to decompose an
arbitrary signal x(n) into a sum of weighted and
shifted unit samples as follows:
x ( n ) = ... + x ( -1) d ( n + 1) + x ( 0) d ( n ) + x (1) d ( n - 1) + x ( 2) d ( n - 2) + ...
This decomposition may¥ be written concisely as
x (n) = å x ( k ) d (n - k )
k =-¥
where each term in the sum, x(k)δ(n – k), is a signal
that has an amplitude of x(k) at time n = k and
value of zero for all other values of n (sifting
property).
Discrete-Time Systems
A mathematical operator or mapping the
transforms one signal (the input) into another
signal (the output) by means of a fixed set of
rules or operations.
The notation T[·] is used to represent a general
system in which an input signal x(n) is
transformed into an output signal y(n) through
the transformation T[·].
Discrete-Time Systems
 The relationship between the input and output may be
expressed in terms of a concise mathematical rule or
function such as
y (n) = x (n)
2
or y ( n ) = 0.5 y ( n - 1) + x ( n )
 It is possible to describe a system in terms of an algorithm
that provides a sequence of instructions or operations that is
to be applied to the input signal such as
y1 ( n ) = 0.5 y1 ( n - 1) + 0.25x (n )
y2 ( n ) = 0.25 y2 ( n - 1) + 0.5x (n )
y3 ( n ) = 0.4 y3 ( n - 1) + 0.5x (n )

then y ( n ) = y1 ( n ) + y2 ( n ) + y3 (n )
Discrete-Time Systems

The representation of a discrete-time system as a


transformation T[·] that maps an input signal
x(n) into an output signal y(n).
.
System Properties
Memoryless System
Definition: A system is said to be memoryless if the
output at any time n = n0 depends only on the input at
time n = n0.
Example: The system y ( n ) = x 2 ( n )
is less memoryless because y(n 0 ) depends only on the
value of x(n) at time n0. The system
y ( n ) = x ( n ) + x ( n - 1)
on the other hand, is not memoryless because the output at
time n0 depends on the value of the input both at n0 – 1.
System Properties
Additivity
Definition: A system is said to be additive if
T éë x1 ( n ) + x2 ( n )ùû = T éë x1 ( n )ùû + T éë x2 ( n )ùû
for any signals x1(n) and x2(n).
x (n)
2

Example: The system defined by y ( n ) = x ( n - 1)


( x ( n ) + x (n ))
2

is not additive because T éë x ( n ) + x ( n )ùû =


1 2

x ( n - 1) + x ( n - 1)
1 2
1 2

x (n) 2
x (n ) 2

which is not the same as T éë x ( n ) + x ( n )ùû =


1 2
1
+
x ( n - 1) x ( n - 1)
1 2
2
System Properties
Homogeneity
Definition: A system is said to be homogeneous
if T éëcx ( n )ùû = cT éë x ( n )ùû
for any complex constant c and for any input
sequence x(n).
Example: The previous system is homogeneous
for an input cx(n) the ouptut is
( cx ( n ) )
2
2
x (n)
T écx ( n ) ù =
ë û =c = cT é x ( n )ù
ë û
cx ( n - 1) x ( n - 1)
System Properties
Linear Systems
Definition: A system is said to be linear if
T éë a1 x1 ( n ) + a2 x2 ( n )ùû = a1T éë x1 ( n )ùû + a2T éë x2 ( n )ùû
For any two inputs x 1 (n) and x 2 (n) and for any
complex constants a1 and a2.
System Properties
Time-Invariance
Definition: Let y(n) be the response of a system
to an arbitrary input x(n). The system is said to
be time-invariant if, for any delay n 0 , the
response to x(n – n0) is y(n – n0). A system that
is not time-invariant is said to be time-varying.
System Properties
Linear Time-Invariant Systems (LTI)
A system that is both linear and time-invariant is
referred to as linear time-invariant (LTI) system.
hk ( n ) = h ( n - k )

It follows that ¥
y (n) = å x (k ) h (n - k )
k =-¥

which is known as the convolution sum, written as


y ( n ) = x ( n) * h ( n)
System Properties
Causality
Definition: A system is said to be causal if, for
any n0, the response of the system at time n0
depends only on the input up to time n = n0.
System Properties
Stability
Definition: A system is said to be stable in the bounded
input-bounded output sense if, for any input that is
bounded, |x(n)| ≤ A < ∞, the output will be bounded,
y (n) £ B < ¥
For a linear shift-invariant system, stability is guaranteed
if the unit sample response is absolutely summable.
¥

. å h ( n) < ¥
n =-¥
System Properties
Invertibility
Important in applications such as channel
equalization and deconvolution
A system is said to be invertible if the input to
the system may be uniquely determined from
the output.
It is necessary for distinct inputs to produce
distinct outputs.
Convolution
The relationship between the input to a linear
shift-invariant system, x(n), and the output,
y(n), is given by the convolution sum
¥
x (n) * h (n) = å x (k ) h (n - k )
k =-¥
Convolution Properties
Commutative Property
States that the order in which two sequences
are convolved is not important. Mathematically,
the commutative property is

x ( n) * h (n) = h (n ) * x (n )
Convolution Properties
Associative Property
T h e c o n v o l u t i o n o p e r a t o r s a t i s f i e s t h e
associative property

{ x ( n ) * h ( n )} * h ( n) = x ( n) *{ h ( n) * h ( n)}
1 2 1 2
Convolution Properties
Distributive Property
The distributive property of the convolution
operator states that
x ( n ) * {h1 ( n ) + h2 ( n )} = x (n ) * h1 (n ) + x (n )* h2 (n )
Convolution Properties
Convolution – Performing Calculations
Direct Evaluation
Using simple closed-form mathematical
expressions.

Example:
ì a n
n³0
x ( n ) = anu ( n ) = í
î0 n<0
h ( n) = u ( n)
Closed-Form Expressions for Some
Commonly Encountered Series
N
N -1
1 - a ¥
1
å
n =0
an =
1- a å n
a =
1- a
a <1
n =0
N -1
( N - 1) a N +1
- Na N
+a ¥
a
å n
na = å na n = a <1
(1 - a )
2
(1 - a )
2
n =0 n =0

N -1 N -1

å n = 12 N ( N - 1) å 6 N ( N - 1)( 2N - 1)
n 2

n =0
= 1

n =0
Direct Evaluation
With the direct evaluation of the convolution
¥ ¥

sum y ( n ) = x ( n ) * h ( n ) = å x ( k ) h ( n - k ) = å a u (k )u (n - k )
k

k =-¥ k =-¥

because u(k) is equal to zero for k < 0 and u(n –


k) is equal to zero for k > n, when n < 0, there
are no nonzero terms in the sum and y(n) = 0.
On the other hand, if n ≥ 0, n
1 - a n +1
y (n) = å a = k

k =0 1- a
1 - a n +1
y (n) = u (n )
1- a
Convolution – Performing Calculations
Graphical Approach
1. Plot both sequences, x(k) and h(k), as
functions of k.
2. Choose one of the sequences, say h(k), and
time-reverse it to form the sequence h(–k).
3. Shift the time-reversed sequence by n.
4. Multiply the two sequences x(k) and h(n – k)
and sum the product for all values of k. The
resulting value will be equal to y(n).
Graphical Approach
Convolution – Performing Calculations
Slide Rule Method
1. Write the values of x(k) along the top of a
piece of paper, and the values of h(–k) along
the top of another piece of paper.
2. Line up the two sequence values x(0) and h(0),
multiply each pair of numbers, and add the
products to form the value of y(0).
Slide Rule Method
Convolution – Performing Calculations
Slide Rule Method
3. Slide the paper with the time-reversed
sequence h(k) to the right by one, multiply
each pair of numbers, sum the products to find
the value y(1), and repeat for all shifts to the
right by n > 0. Do the same, shifting the time-
reversed sequence to the left, to find the values
for y(n) for n < 0.
Difference Equations
For example, a system that has a unit sample
response h(n) = a n u(n) is described by the
equation ¥
y ( n) = åa k x ( n - k )
k =0

In some cases it may be possible to more efficiently


express the output in terms of past values of the
output in addition to the current and past values of
the input. The previous system may be described
more concisely as:
y ( n ) = a y ( n - 1) + x ( n)
.
Difference Equations
The previous system is a special case of what is
known as linear constant coefficient difference
equation, or LCCDE. q
The generalp form of an
LCCDE is
y ( n ) = å b ( k ) x ( n - k ) - å a (k ) y (n - k )
k =0 k =1
Where the coefficients a(k) and b(k) are constants
that define the system.
If the difference equation has one or more terms a(k)
that are nonzero, the difference equation is said to
be recursive. If all the coefficients of a(k) are
equal to zero, it is said to be nonrecursive.
Difference Equations
Given an LCCDE, the general solution is a sum
of two parts,
y ( n ) = yh ( n ) + y p ( n )
Where y h (n) is known as the homogeneous
solution and yp(n) is the particular solution.
Difference Equations
The homogeneous solution is found by solving the
homogeneous difference equation
p
y (n) + å a (k ) y (n - k )
Assuming h y ( n ) = z n
p
k =1

Then substituting z n + å a ( k ) z n -k = 0
Or k =1

z n - p { z p + a (1) z p -1 + a ( 2 ) z p - 2 + ... + a ( p - 1) z + a ( p )} = 0
If the p roots zi are distinct, the general solution to
the homogeneous difference p
equation is
. yh ( n ) = å Ak zkn
k =1
Difference Equations
If z1 is a root of multiplicity m with the
remaining p – m roots distinct, the
homogeneous solution becomes p
yh ( n ) = ( A1 + A2 n + ... + Am n m -1 ) z1n + å Ak zkn
k = m +1

For a function such as, x(n) = Ca n u(n), the


particular solution will be of the form
y p ( n ) = Ca u ( n )
n
Difference Equations
Term in x(n) Particular Solution

C C 1

C n C 1n + C 2

n n
C a C 1a
C c o s ( nw 0 ) C 1 c o s ( nw 0 ) + C 2 s in ( nw 0 )
C s in ( nw 0 ) C 1 c o s ( nw 0 ) + C 2 s in ( nw 0 )
C a n c o s ( nw 0 ) C 1 a n c o s ( n w 0 ) + C 2 a n s in ( n w 0 )
C d ( n ) N o n e
Difference Equations
y ( n ) = 5 x ( n + 2 ) - 3x ( n ) + 2 x ( n - 1)

x ( n ) = 5d ( n + 2 ) + 3d ( n ) - d ( n - 3)
Difference Equations
y ( n ) = 5 x ( n + 2 ) - 3 x ( n) + 2 x ( n - 1)
x ( n ) = 5d ( n + 2 ) + 3d (n ) - d (n - 1 )
Difference Equations
y ( n ) = 5 x ( n + 2 ) - 3 x ( n) + 2 x ( n - 1)
x ( n ) = 5d ( n + 2 ) + 3d (n ) - d (n - 1 )

y ( n ) = 25d ( n + 4 ) + 10d ( n + 1) - 9d ( n) + d ( n - 1) + 3d ( n - 3) - 2d ( n - 4)
Difference Equation in Block
Diagrams
Difference Equation: Moving Average
Difference Equation: Autoregressive
Difference Equation: Autoregressive
Moving Average (ARMA)
Realizations of Filters
Recursive cumulative averaging system

Square-root system
Realizations of Filters
Nonrecursive (a) and recursive (b) systems
Example
Find the solution to the difference equation
y ( n ) - 0.25 y ( n - 2 ) = x ( n )
For x(n) = u(n) assuming initial conditions of
y(–1) = 1 and y(–2) = 0
Solution: From the table y p ( n ) = C
Then C1 - 0.25C1 = 1
1 4
C1 = =
1 - 0.25 3
Example
To find the homogeneous solution, we set yh(n) =
zn z 2 - 0.25 = 0
Or ( z + 0.5)( z - 0.5) = 0
Therefore, the solution has the form
yh ( n ) = A1 ( 0.5 ) + A2 ( -0.5 )
n n

Thus, the total solution is


y ( n ) = 3 + A1 ( 0.5 ) + A2 ( -0.5 )
n n
4
n³0
Example
Evaluating at n = 0 and n = 1
y ( 0 ) - 0.25 y ( -2 ) = x ( 0 ) = 1
y (1) - 0.25 y ( -1) = x (1) = 1
Substituting the derived conditions
y ( 0 ) = 3 + A1 + A2 = 1
4

y (1) = 43 + 12 A1 - 12 A2 = 1.25
Solving for A1 and A2 A1 = - 14 A2 = - 121
Thus, the solution is
y ( n ) = 3 - ( 0.5 ) + 6 ( -0.5 ) ù u ( n )
é 4 n+2 1 n +1
ë û
Example
Determine the zero-input response of the system
(assuming yzi(n) = 0)
y ( n ) + a1 y ( n - 1) = x ( n ) (1)

let: x ( n ) = 0, y ( n ) = l n
l n + a1l n -1 = 0
l = - a1
Example
therefore:
yh ( n) = C l n ® yh ( n) = C ( - a1 ) ( 2)
n

from (1) , for n = 0 :


y ( 0 ) + a1 y ( -1) = 0
from ( 2) , for n = 0 :
yh ( 0 ) = C
Since: yh ( n) = y ( n) , for x ( n) = 0 & y p ( n) = 0
then: C = - a1 y ( -1)
Substitute to ( 2) :

y zi ( n) = ( - a1 ) y ( -1) , n ³ 0
n +1
Example
Determine the particular solution of
y ( n ) = 65 y ( n - 1) - 61 y ( n - 2 ) + x ( n ) (1)
when x ( n ) = 2 n , n ³ 0 and 0 elsewhere.

Solution:
The form of y p ( n ) = A ( 2 ) , n ³ 0
n

Substitute y p to the LCCDE (1) ,


A ( 2 ) u ( n ) = 65 A ( 2 ) u ( n - 1) - 61 A ( 2 ) u ( n - 2 ) + ( 2 ) u (n ) , (2 )
n n -1 n-2 n

for n ³ 2, all terms exist, so let n = 2 and substitute to ( 2 )


4A = ( 2 A) - 61 A + 4
5
6

since u ( 2 ) = u (1) = u ( 0 ) = 1
Example
Solving for A :
A= 8
5

Therefore,
y p ( n) = ( 2) u ( n)
8 n
5
Example
Solve the difference equation with the given initial conditions:
y ( n ) = -0.5 y ( n - 1) + 0.5 y ( n - 2 ) + x (n ) - x (n - 1)
x ( n ) = ( 0.5) u ( n ) , y ( -1) = 1 and y ( -2 ) = -1
n

Solution:
Homogeneous solution yh ( n )
yh ( n ) + 0.5 yh ( n - 1) - 0.5 yh ( n - 2 ) = 0
l 2 + 0.5l - 0.5 = 0 ® (l + 1)(l - 0.5 ) , where l = -1, 0.5
yh ( n ) = C1 ( -1) + C 2 ( 2 ) u ( n )
é 1 nù
n

ë û
Example
Since the input is x ( n ) = ( ) u (n)
1 n
2

Particular solution, y p ( n ) = An ( 2 ) u ( n )
1 n

Substitute to LCCDE:
An ( 2)
1 n
= - A ( n - 1) (
1
2 2)
1 n -1
+ A (n - 2 ) (
1
2 2)
1 n-2
+( ) -( )
1 n
2
1 n -1
2 , for n ³ 2
Example
Let n = 2 :
A ( 2) ( 2)
1 2
= - A ( 2 - 1) (
1
2 2)
1 2 -1
+ A ( 2 - 2) (
1
2 2)
1 2-2
+( ) -( )
1 2
2
1 2 -1
2
1
2 A = 14 A + 14 - 12
A = - 13
Total solution:
y ( n ) = C1 ( -1) + C 2 ( 2 ) - 3 n ( 2 ) u ( n )
é 1 n 1 nù
n 1
ë û
Example
To solve for C1 and C 2 , use the initial cond itions given:
LCCDE ® y ( n ) = -0.5 y (n - 1 ) + 0.5 y (n - 2 ) + x (n ) - x (n - 1 )
Initial conditions ® x ( n ) = (0.5 ) u (n ), y (-1 ) = 1, and y (-2 ) = -1
n

n = 0,
y ( 0 ) = - 12 y ( -1) + 12 y (-2 ) + x (0 ) - x (-1 )
y ( 0 ) = - 12 (1) + 12 ( -1) + 1 ® y (0 ) = 0
n = 1,
y (1) = - 12 y (0 ) + 12 y ( -1) + x (1) - x (0 )
y (1) = - 12 (0 ) + 12 (1) + 12 - 1 ® y (1 ) = 0
Example
Substitute these values to the total general solution:
y ( n) = éC1 ( -1) + C2 ( 12 ) - 13 n ( 12 ) ù u ( n)
n n n

ë û
n = 0,
y ( 0 ) = C1 + 12 C2
0 = C1 + 12 C2
n = 1,
y (1) = -C1 + 12 C2 - 61
0 = -C1 + 12 C2 - 61 ® -C1 + 12 C2 = 1
6

Solving C1 and C2 simultaneously:


C1 = - 19 , C2 = 1
9

Total particular solution:

y ( n) = é - 19 ( -1) + 19 ( 12 ) - 13 n ( 12 ) ù u ( n)
n n n

ë û

You might also like