Lecture 9: Brief Summary of Digital Signal Processing.: 1.1 Operations
Lecture 9: Brief Summary of Digital Signal Processing.: 1.1 Operations
Lecture 9: Brief Summary of Digital Signal Processing.: 1.1 Operations
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).
1.1
Operations
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
1.3
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=
M
1
X
x[l]
l=0
1.4
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=
k=
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
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.
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
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
2.2
x[n]ejn
n=
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
XY d
n=
Similarly to the CTFT, energy density and band-limited signals can be defined.
6
2.4
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
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.
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
3.1
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.
4.1
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
N
1
X
X[k][k, n]
k=0
N
1
X
[k, n] [l, n] = kl
n=0
|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
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)
2(N 1)
3(N 1)
(N 1)(N 1)
(1WNN 1 WN
WN
WN
)
x = (1/N )DN
X
4.3
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
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:
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
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=
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
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
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
14
5.4
5.5
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