Lecture 9: Brief Summary of Digital Signal Processing.: 1.1 Operations

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Lecture 9: Brief Summary of Digital Signal Processing.

In this pages I summarize the basic concepts of DSP needed for the rest of
the class. Other material will be introduced as necessary. NOTE: most of
this material can be found in any good introductory textbook. I followed the
presentation from Digital Signal Processing, S. J. Mitra, 3d edition (all rights
reserved).

Discrete Time Signals and Systems

Discrete time signals can be represented in the time domain as a sequence of


values indexed by the integer numbers (positive and negative). We will typically
use small letters to represent whole signals, and indicate a specific sample using
square parenthesis. For example, the sample in position 2 of signal x will be
written x[2]. The generic sample will be indicated x[n].
If the signal is effectively sampled from a continuous time signal, the typical
interpretation will make a sample correspond to the value of the analog signal
at regular intervals separated by the sampling period T , that is: y[n] = ya (nT ).
In such case, the inverse of the sampling period FT = 1/T will be called the
sampling frequency.
Digital Signals are discrete time signals that have been truncated or rounded,
to make it possible to represent them in a digital format.
A finite length signal will have all the samples equal to 0, but for a finite
number. Its length is the number Nmax Nmin + 1 where Nmax and Nmin
are the largest and the smallest indices of a non-zero element of the sequence,
respectively. An infinite length signal can be two sided, right-sided or left-sided.
A right sided sequence with Nmin 0 is called causal, a left sided sequence with
Nmax 0 anticausal.

1.1

Operations

Elementary operations between sequences are:


Modulation: product of 2 sequences: y[n] = x1 [n]x2 [n]
Scalar Multiplication: product of a sequence with a constant: y[n] =
Ax[n]
Addition: sum of 2 sequences: y[n] = x1 [n] + x2 [n]
Time Shift: a new sequence whose samples are delayed or antucipated
versions of the original sequence: y[n] = x[n N ]. This operation is
often indicated with the expression z N , whose meaning is related to the
z-transform of the signal - see below.
Time Reversal: a new sequence with opposite indices y[n] = x[n]

Combination of the elementary operations (with the addition of a few others), will allow description of most DSP systems; block diuagram will be extremely helpful to analyze different DSP algorithms and their implementations.
Another useful operation consists in sampling rate alteration, where the number of samples per time unit gets altered. The alteration is characterized by the
sampling rate alteration ratio R = FT0 /FT , where FT0 and FT represent the new
and original sampling frequencies. If R > 1 the alteration is called interpolation,
if R < 1 decimation.
Elementary forms of alterations are:
Up-sampling: the sampling rate increases, R > 1, and new samples
need to be inserted. The added samples are zero, or interpolations of the
existing samples.
Down-sampling: the sampling rate decreases, R < 1, and some samples
get discarded.

1.2

Type of sequences

A sequence is conjugate-symmetric if x[n] = x [n], where the asterisk represents complex conjugation. In the case of real signals this is equivalent to
symmetry.
A sequence is conjugate-antisymmetric if x[n] = x [n], where the asterisk
represents complex conjugation. In the case of real signals this is equivalent to
antisymmetry.
Any signal can be decomposed as a sum of (conjugate-)symmetric and antisymmetric.
A signal is called periodic if there exist a number N such that x[n] = x[n +
kN ] for all n and integers k. The minumum number N for which this is true is
called the period of the sequence.
P
An Energy signal is such that the series n= |x[n]|2 converges to a finite
value called its energy Ex .
A sequence is called bounded if |x[n]| <= Bx < .
Unit Sequence: [n] = 1 if and only if n = 0, otherwise it is 0
Unit Step Sequence [n] = 1 for all n >= 0, otherwise it is 0.
Sinusoidal Sequence Acos(0 n + )
Exponential Sequence An
One interesting fact about the Sinusoidal sequence is that 2 such sequences
are equivalent if 1 = 2 + 2, all rest remaining the same. This is a first
simple consequence of the Sampling Theorem that states that certain signals in
continuous time will be aliased to lower frequencies.
Sampling continuous sinusoidal signals will result in observing the signal
at times t = nT = n/FT = 2n/T , so if xa (t) = Asin(0 t + ), x[n] =
2

Asin(0 /T 2n + ) = Acos(0 n + ) where 0 = 20 /T = 0 T . 0 is the


normalized frequency after sampling, and it has periodicity of 2, thus showing
that any 0 + kT will be equivalent, for the same sampling period T, so that
the univocally represented frequencies are < 0 <= , and is a folding
frequency. Therefore, we need to guarantee that any significant frequency 0 ,
T > 20 .

1.3

Discrete Time Systems and classification

A Discrete Time system takes a discrete signal x[n] as input and produces
another discrete signal y[n] as output.
Simple examples of systems are the accumulator:
y[n] =

n
X

x[l]

l=

the moving average:


y[n] = 1/M

M
1
X

x[l]

l=0

Typical classes of discrete-time systems are:


Linear: If x[n] = x1 [n] + x2 [n] then y[n] = y1 [n] + y2 [n], where y1 [n]
and y2 [n] are the responses to x1 [n] and x2 [n] respectively.
Shift-Invariant (or Time-Invariant): y[n n0 ] is the response to x[n n0 ],
if y[n] is the response to x[n].
Causal: if x1 [n] agrees with x2 [n] for all n < N , their responses agree also
for n < N .
Stable: if x[n] is bounded, then also y[n] is bounded.
Passive: if x is of finite energy Ex , than also y is and Ey <= Ex . If
equality holds always, then the system is called lossless.

1.4

Impulse Response and LTI

The response of a system to the unit input [n] is called the Impulse Response,
normally written as h[n].
In the case of Linear-Time-Invariant (LTI) systems it conpletely characterizes their behavior. This is because every input sequence can be described as
a linear combination of delayed copies of the unit sequence, and using linearity and time-invariance, the reponse can be built as a superposition of delayed
impulse reponses. Such superposition can be written as the sum:

x[k]h[n k] =

k=

x[n k]h[k] = x[n] h[n]

k=

called convolution of the input and the impulse response.


The convolution has interesting properties, such as commutativity (xy = y
x), associativity ((xy)z = x(yz)) and distributivity (x(y+z) = xy+xz).
Furthermore, properties of LTI systems are simply described by h[n]:
Stability: A system
is stable if and only if the impulse response is absoP
lutely summable ( |x[n]| < )
Causality: A system is causal if and only if its impluse response is a causal
signal.

Finally, simple interconnection schemes of systems result in simple composition of the impulse response:
Cascade connection: The impulse response is the convolution of the responses (htot = h1 h2 ). Important consequence is the fact that order is
not important in cascade connections. Stability, passivity and losslessness
are preserved.
Parallel connection: The response is the sume of the responses (htot =
h1 + h2 ). Stability is preserved.

1.5

Finite Dimensional LTI systems

They can be described by the equations:


N
X

dk y[n k] =

k=0

M
X

pk [n k]

k=0

max(N, M ) is called the order of the system. the relation can be re-written
to show y[n] explicitly as a function of previous values of y and previous and
current values of x.
If N=0, the system is a Finite Impulse Resonse (FIR) system (it can be
shown that h[n] is a finite sequence, otherwise is a Infinite Impulse Response
(IIR) system.

Discrete Time Fourier Transform

The DTFT is the most common transform used to capture the frequency behavior of discrete-time signals and systems. It transforms a discrete sequence in
a continuous function, simular to the Fourier transform of a continuous signal.

2.1

Summary of Fourier Transform

Ordinary Fourier Transform (Continuous Time Fourier Transform CTFT), transform a continuous signal ointo a continuous signal, with no loss of information,
by the two formulas:
Z +
Xa (j) =
xa (t)ejt dt

and
xa (t) = 1/(2)

Xa (j)ejt d

A signal admits a CTFT if it has a discrete number of discontinuities and


discontinuous first derivatives, and is absolutely integrable. It also converges in
square average if it has finite energy.
In general, the function |Xa (j)|2 is called the density energy function, and
represents the portion of energy of the signal that is concentrated in a certain
frequency. Such name is justified by Parsevals theorem:
Z +
Z +
|xa (t)|2 dt = 1/(2)
|Xa (j)|2 d

A signal is called band-limited if its CTFT is 0 outside of a certain interval


of frequencies (its band).
The power of the CTFT consists in the conversion of the (continuous) convolution in a simple product, so that the input-output relation of a continuous
system can be described by the formula:
Y (j) = H(j)Y (j)
and derivatives are converted to multiplication by j.

2.2

DTFT - Definition and Properties

The DTFT is defined by the following formula:


X(ej ) =

x[n]ejn

n=

The inverse transform is as follows:


Z +
x[n] = 1/(2)
X(ej )ejn d

The transform pairs satisfy a large number of symmetry properties:


x[n] X(ej )

x [n] X (ej )
Re(x[n]) 1/2(X(ej ) + X (ej ))
Im(x[n]) 1/2(X(ej ) X (ej ))
Even more useful properties for real time-domain signals:
xeven [n] Xre (ej )
xodd [n] jXim (ej )
X(ej ) = X (ej )
Xre (ej ) = Xre (ej )
Xim (ej ) = Xim (ej )
|X(ej )| = |X(ej )|
arg(X(ej )) = arg(X(ej ))

2.3

DTFT Theorems

Most important properties of the DTFT are expressed by the following theorems:
Linearity:
x1 [n] + x2 [n] X1 + X2
Time Reversal:
x[n] X(ej )
Time Shift:
x[n n0 ] X(ej )ejn0
Frequency Shift:
x[n]ej0 n X(ej(0 ) )
Convolution:
x[n] y[n] XY
Modulation:
x[n]y[n] 1/(2)
Parseval:

X(e(j) Y (ej() )d

x[n]y [n] = 1/(2)

XY d

n=

Similarly to the CTFT, energy density and band-limited signals can be defined.
6

2.4

DTFT and LTI Systems

The DTFT of the impulse response is called the Frequency Response of the
system, and, due to the convolution theorem, has a direct meaning in terms of
the systems behavior.
H(ej ) = Y (ej )/X(ej )
Analogously, its magnitude |H(ej | (called the Magnitude Response) and its
phase = arg(H(ej ) (called the Phase Response) characterize completely the
I/O behavior.
It is easy to see, using the DTFT, that the response to a sinusoidal input
of given frequency, the output is a sinusoidal signal of the same frequency, but
with mgnitude multiplied by the magnitude response a that frequency, and
phase increased by the phase response at the same frequency.
The phase delay is defined as (0 )/0 and subtracts to the sample index
for each frequency. On the bother hand, the group delay, defined as d/d
represents a delay of the envelope of any signal, and to ensure non-distorsion of
waveforms should be kept constant throughput the frequencies of interest.
Filters are typically designed using magnitude constraints, and linear phase
is normally a necessary requirement for the band portion of a filter.

2.5

DTFT of Finite-Dimension LTI Systems

In this case, direct transform of the defining relation gives the following additional information:
FIR: the DTFT is a polynomial in ej , and is always defined.
IIR: the DTFT is a rational function of in ej , and is always defined.

Continuous to Discrete Time Conversions

DSP systems typically operate on signals that are continuous in nature to start
with, and their outputs also need to operate continuously. For this reason, it is
important to understand the relationship between the continuous and discrete
realm, as well as the limitations of the conversion process. A typical DSP system
is composed of the following components:
Anti-aliasing Filter: limits the continuous signal to the frequencies of interest, according to the sampling theorem (makes sure no component with
> T /2 is allowed to the rest of the chain).
Sampling and Hold: Samples the filtered continuous signal at a given
sampling period and keeps the value to allow the ADC to operate properly.
Analog to Digital Converter (ADC): converts the sampled continuous input into a finite number of digital levels, to allow digital processing.
7

DSP: the core of the system performs the required processing.


Digital to Analog Converter (DAC): converts the results of the processing
back into analog format.
Reconstruction Filter: Reconstructs a continuous output signal and tries
to minimize the effect of non-idealities of the DAC operation (droop and
further filtering)

3.1

Sampling in Frequency Domain

The effect of sampling can be accurately modeled in frequency (DTFT) domain,


by using the trick of modling the effect of sampling with an infinite train of
Diracs deltas. The final result is that, given a continuous time input described
with a CTFT Ga (j), sampling generates a discrete-time signal with a DTFT
(with = /T ):
G(ej ) = 1/T

Ga (j jkT )

k=

In other words, besides the normalization of the frequencies and the factor
1/T , the sampled sequence suffers from Aliasing from higher frequencies. For
this reason, it is necessary to limit the frequency content of the input signal
through an Anti-aliasing filter to avoid corruption of the signal - if no filter is
designed, the original signal is irrecoverable in principle.
Similar formulas show that, starting from a sampled signal where antialiasing was guaranteed, perfect reconstruction is possible by using a Reconstruction Filter whose impulse response is the IDTFT of a rectangular function, that
corresponds to a impulse response of the form sin((tnT )/T )/(((tnT )/T ),
that is unrealizable in principle (2-sided), but can be appropriately approximated.
An important note is that, for pass-band signals with high middle band
frequencies, the bandwidth is the parameter that needs to be used to calculate
the sampling frequency, rather than the maximum signal frequency.
In the construction of the anti-aliasing filter, oversampling can be beneficial,
as it helps relax the filter requirements.
The reconstruction filter needs to correct two problems:
The signal replicas that naturally arise from generating a continuous signal
from a discrete-time signal.
The droop originated by the (typical) Zero-order Hold shape of the DAC
output.
Note that, while the first problem is unavoidable, the droop can be corrected
by preventive equalization in the digital domain.

Discrete Fourier Transform

The Discrete Fourier Transform is a transform scheme that converts a finite


discrete-time sequence into a discrete-frequency sequence of the same length,
and can be used to sample the values of a DTFT in an efficient way. Implementation of Fast DFT techniques is at the heart of modern development of such
transform.

4.1

Orthogonal Discrete Transforms

Many discrete transforms are typically cases of the general technique of orthogonal transforms. The equations of such transforms are, for the direct transform:
X[k] =

N
1
X

x[n] [k, n]

n=0

and the inverse transform:


x[n] = 1/N

N
1
X

X[k][k, n]

k=0

Such transform are true if the functions respect an orthogonality condition:


1/N

N
1
X

[k, n] [l, n] = kl

n=0

where the delta is 1 if and only if k = l.


Under these assumption it is easy to prove the equivalent of Parsevals theorem:
N
1
X

|x[n]|2 = 1/N

n=0

4.2

N
1
X

|X[k]|2

k=0

DFT

The DFT is just a specialization of the previous formula to the case [k, n] =
e2jkn/N . The direct transform becomes:
X[k] =

N
1
X

x[n]ej2kn/N

n=0

and the inverse transform:


x[n] = 1/N

N
1
X
k=0

X[k]ej2kn/N

With the shothand WN = ej2/N , and defining the matrix DN whose rows
are
(111 1)
(1WN WN2 WN3 WNN 1 )
2(N 1)

(1WN2 WN4 WN6 WN

2(N 1)
3(N 1)
(N 1)(N 1)
(1WNN 1 WN
WN
WN
)

It is easy to show that DFT and IDFT can be simply written:


X = DN x

x = (1/N )DN
X

4.3

Relations Between DTFT and DFT

The main formula relating the two transforms is:


X(ej )|=2k/N = X[k]
In other words, with the appropriate frequency scaling, the DFT is just a
faithful sampling of the DTFT.
On the other hand, using the IDFT on a DTFT-transformed discrete signal
is governed by:

y[n] =

x[n + mN ]

m=

where x[n] is the original signal, and y[n] the result of the inverse DFT. In
other words, the IDFT introduces aliasing in time that needs to be avoided (by
guarding the sequences appropriately).

4.4

Circular Convolution

The DFT satisfies a convolution theorem, but in its case the convolution is
defined differently:
h[n] N x[n] =

N
1
X

h[n]x[< k n >N ]

k=0

where the expression < k n >N means difference modulo N.


Due to this difference with respect to the ordinary convolution, the DFT can
be used to compute the linear convolution only with caution, by either padding
zeros (in the case of a convolution between two finite-length sequences) or by
appropriate corrections (overlap-add, overlap-save).

10

4.5

Symmetric Relations

The most important symmetry relations for the DFT pairs (complex x signals)
are:
x [n] X [< k >N ]
x [< n >N ] X [k]
xre 1/2(X[k] + X [< k >N ])
xim 1/2(X[k] X [< k >N ])
For the case of real x signals:
xeven [n] Xre [k]
xodd [n] jXim [k]
X[k] = X [< k >N ]
Xre [k] = Xre [< k >N ]
Xim [k] = Xim [< k >N ]
|X[k]| = |X[< k >N ]|
arg(X[k]) = arg(X[< k >N ])

4.6

DFT Properties

Most important properties of the DFT are expressed by the following theorems:
Linearity:
x1 [n] + x2 [n] X1 + X2
Circular Time Shift:
x[< n n0 >N ] X(ej )WNkn0
Frequency Shift:

x[n]WNk0 n X(< k k0 >N )

Duality:
X[n] N x[< k >N ]
Circular Convolution:
x[n] N y[n] XY
Modulation:
x[n]y[n] (1/N )G N H
Parseval:

N
1
X

x[n]y [n] = (1/N )

n=0

N
1
X
k=0

11

X[k]Y [k]

Z Transform

A new transform operation is often used to represent LTI system, for its ability
to capture properties of signals and systems quite naturally, and its amenability
to symbolic and block-diagram manipulation, and its simplicity when compared
to the DTFT. The transform is defined by the following formula:
X(z) =

g[n]z n

n=

and is called the z-transform of the discrete-time signal. The variable z is


taken to be complex, so the formula - when defined - describes a discrete-time
signal with a complex variable function - even more, an analytic function (i.e.
a function defined by power series). Much of the advantage of the description
derives from the powerful theory behind analytic functions. The basic concept
of power series (with positive and negative exponents - also known as Laurent
series - is that they define a function in annular regions of the complex plane,
delimited by circles centered at the origin of the plane. The circles that form
the boundary of the regions are themselves defined by the convergence of the
function: Typically a complex function defined as above willPnot be defined in

the whole plane. For example, the function 1/(1 2z 1) = n=0 2n z n is not
defined for z = 2, and the series converges for all values ofP
z whose absolute
1
value is larger than 2. It is interesting to note that the series n= (z/2)n
converges to the exact same function inside the circle of radius 2. However, the
two functions represent completely different sequences: a causal sequence the
first one, an anticausal sequence the second one. For this reason, when dealing
with the z-transform, it is not sufficient to indicate the transform itself, but also
its Region of Convergence (ROC) that in general is delimited by circles centered
in the origin.
While complex analytic functions can have different types of singularities,
the most commonly found in practice is similar to the one shown in the above
example, where the function fails to be defined at a single point (isolated singularity), and more in particular they behave around the singularities like 1/z n
functions: Such points are typically called poles and indicated as crosses in the
graphical representation of the complex plane (in the example, the change of
variable z 0 = z 2 shows that around the point 2 it behaves like a single pole
((z 0 + 2)/z 0 ).
It is clear from the definition of the transform that, if we substitute z = ej
we obtain the expression for the DTFT, and that in this case the z-transform
is a generalization of the DTFT. Such substitution is equivalent to evaluating
the z-transform on the unit circle in the z-plane: Therefore only if the ROC of
the z-transform contains the unit circle the two representation correspond to
the same sequence.

12

5.1

z-transform of finite dimensional LTI

In the case of finite dimensional LTIs it can be easily shown, by using the properties of the z-transform, that the systems can be described with z-transforms
that are rational functions in z 1 , so that they can be written as:
M
+ p1 z M 1 + p2 z M 2 + . . . + pM
p0 + p1 z 1 + p2 z 2 + . . . + pM z M
N M p0 z
=
z
d0 + d1 z 1 + d2 z 2 + . . . + dN z N
d0 z N + d1 z N 1 + d2 z N 2 + . . . + dN

The formula can be also rewritten, remembering that every complex polynomial factors completely in the complex number field:
QM
QM
p0 l=1 (1 l z 1 )
N M p0
l=1 (z l )
=z
Q
QN
1
d0 N
d
0
)
l=1 (1 l z
l=1 (z l )

The l are called the zeros and the the poles of the function. Besides a
constant gain factor (that in many cases is immaterial) the positions of the poles
and zeros in the complex plane completely specify the behavior of the system:
Designing a discrete LTI system is equivalent to locate the poles and zeros in
the complex plane.
The following fact about the ROC of a sequence that has a rational ztransform are a consequence of the definition:
A finite sequence has a z-transform that is defined in the entire plane, save
(perhaps) the origin and the infinity.
A right sided sequence has a ROC that is the entire plane outside a circle,
save perhaps the infinity.
A left sided sequence has a ROC that is the part of the plane inside a
circle, save perhaps the origin.
A two sided sequence has a ROC that is an annulus.
It is important that the position if poles and zeros is not completely arbitrary,
but is subject to constraints depending on the desired systems behavior:
Non-real poles and zero of a real system (or sequence) have to be present
in conjugate pairs - if is a pole, is also a pole (same for zeros).
If the system is stable, the poles need to be contained in the unit circle.
Zeros can also be outside the circle.

5.2

Properties of the z-transform

The following are the most important properties of the z-transform:


Linearity:
x1 [n] + x2 [n] X1 (z) + X2 (z)
13

Time Shift:
x[n n0 ] X(z)z n0
Time Reversal:
x[n] X(1/z)
Convolution:
x[n] y[n] X(z)Y (z)
Multiplication by exponential:
n x[n] X(z/)
Differentiation of X:
nx[n] zdX(z)/dz
Parsevals and modulation theorems exist but are complicated in z, and not
commonly used.
Note that the time shoft property indicates that multiplying a z-transform
with z 1 corresponds to delaying the signal by one unit. This is the reason why
unit delays are typically marked by z 1 in block diagrams.

5.3

Transfer Fucntions

Due to the concolution property, the input-output relationship of an LTI system


can be described in the z-domain by a function that is the z-transform of the
impulse response:
y[n] = h[n] x[n] Y (z) = H(z)Y (z) H(z) = Y (z)/X(z)
It is easy to see that applying the linearity on time shift properties to a
finite dimensional system, its input-output relation can be written as a rational
function. Such function is called the Transfer Function of the system. As an
immediate consequence:
The transfer function of a FIR system is a polynomial in z 1 with degree
equal to its order.
The transfer function of an IIR system is a rational function in z 1 with
numerator and denominator degrees equal to M and N respectively.
Because for a causal IIR filter the response must be causal, i.e. right-sided,
the ROC of its transfer function needs to be the exterior of a circle, and therefore
it is the exterior of the pole with the largest magnitude.
Stability can be related to existence of converging z-transform on the unit
circle: therefore the IIR filters ROC needs to contain the unit circle, and if it
is causal, all its poles need to be inside the circle.

14

5.4

Relation between Transfer functions and frequency response

As the frequency response is the DTFT of the impulse response, and it is in


turn the value of the z-transform on the unit circle, it is possible to evaluate the
frequency response from the z-transform quite easily.
There is an helpful geometric interpretation of the frequency response based
on the positions of poles and zeros in the z-plane, with respect to the position
on the circle corresponding to the desired frequency (p = ej ):
Every zero contributes to the magnitude of the frequency response by a
factor that is equal to its distance from p . In other words, the closer a
zero to the point, the larger the attenuation.
Every pole contributes to the magnitude of the frequency response by a
factor that is equal to the inverse of its distance from p . In other words,
the closer a pole to the point, the larger the gain.
Every zero contributes to the phase of the frequency response by a positive
factor that is equal to the angle from it to p .
Every pole contributes to the phase of the frequency response by a negative
factor that is equal to the angle from it to p .

5.5

Computation of the inverse z-transform

Computing the original sequence starting from the z-transform can be accomplished by a variety of methods:
Residue calculation: Given X(z), it is possible to compute each x[n] by
computing the residues of X(z)z n1 of a closed contour inside the ROC
and circling the origin.
Partial fraction: if X(z) is rational, in order to find its causal inverse transform, it can be expanded in partial fraction and each fraction converted
separately.
Long division: if X(z) is rational, it is possible to apply long division to
obtain one by one the values of its causal x[n].

15

You might also like