DSP Lecture Notes
DSP Lecture Notes
For this reason, although x[n] is strictly the nth number in the sequence, we often refer to it as
the nth sample. We also often refer to \the sequence x[n]" when we mean the entire sequence.
Discrete-time signals are often depicted graphically as follows:
Discrete-time systems
A discrete-time system is de_ned as a transformation or mapping operator that maps an input
signal x[n] to an output signal y[n]. This can be denoted as
If the system is additionally time invariant, then the response to _[n -k] is h[n -k]. The previous
equation then becomes
This expression is called the convolution sum. Therefore, a LTI system has the property that
given h[n], we can _nd y[n] for any input x[n]. Alternatively, y[n] is the convolution of x[n] with
h[n], denoted as follows:
The previous derivation suggests the interpretation that the input sample at n = k, represented
by
is transformed by the system into an output sequence. For each k, these
sequences are superimposed to yield the overall output sequence: A slightly di_erent
interpretation, however, leads to a onvenient computational form: the nth value of the output,
namely y[n], is obtained by multiplying the input sequence (expressed as a function of k) by the
sequence with values h[n-k], and then summing all the values of the products x[k]h[n-k]. The
key to this method is in understanding how to form the sequence h[n -k] for all values of n of
interest. To this end, note that h[n -k] = h[- (k -n)]. The sequence h[-k] is seen to be equivalent to
the sequence h[k] reected around the origin
Since
sequences are non-overlapping for all negative n, the output must be zero y[n] = 0; n < 0:
the
An important property of the DFT is that it is cyclic, with period N, both in the discrete-time and
discrete-frequency domains. For example, for any integer r,
Linear Convolution:
Linear convolution of two finite-length sequences Consider a sequence x1[n] with length L
points, and x2[n] with length P points. The linear convolution of the sequences,
It is easy to see that the circular convolution product will be equal to the linear onvolution
product on the interval 0 to N 1 as long as we choose N - L + P +1. The process of augmenting
a sequence with zeros to make it of a required length is called zero padding.
Fast Fourier transforms
The widespread application of the DFT to convolution and spectrum analysis is due to the
existence of fast algorithms for its implementation. The class of methods are referred to as fast
Fourier transforms (FFTs). Consider a direct implementation of an 8-point DFT:
If the factors have been calculated in advance (and perhaps stored in a lookup table), then the
calculation of X[k] for each value of k requires 8 complex multiplications and 7 complex
additions. The 8-point DFT therefore requires 8 * 8 multiplications and 8* 7 additions. For an Npoint DFT these become N2 and N(N - 1) respectively. If N = 1024, then approximately one
million complex multiplications and one million complex additions are required. The key to
reducing the computational complexity lies in the observation that the same values of x[n] are
efectively calculated many times as the computation proceeds | particularly if the transform is
long. The conventional decomposition involves decimation-in-time, where at each stage a N-
point transform is decomposed into two N=2-point transforms. That is, X[k] can be written as
X[k] =N
The original N-point DFT can therefore be expressed in terms of two N=2-point DFTs.
The N=2-point transforms can again be decomposed, and the process repeated until only 2-point
transforms remain. In general this requires log2N stages of decomposition. Since each stage
requires approximately N complex multiplications, the complexity of the resulting algorithm is
of the order of N log2 N. The difference between N2 and N log2 N complex multiplications can
become considerable for large values of N. For example, if N = 2048 then N2=(N log2 N) _ 200.
There are numerous variations of FFT algorithms, and all exploit the basic redundancy in the
computation of the DFT. In almost all cases an
Of the shelf implementation of the FFT will be sufficient | there is seldom any reason to
implement a FFT yourself.
S ome forms of digital filters are more appropriate than others when real-world effects are
considered. This article looks at the effects of finite word length and suggests that some
implementation forms are less susceptible to the errors that finite word length effects introduce.
In articles about digital signal processing (DSP) and digital filter design, one thing I've noticed is
that after an in-depth development of the filter design, the implementation is often just given a
passing nod. References abound concerning digital filter design, but surprisingly few deal with
implementation. The implementation of a digital filter can take many forms. Some forms are
more appropriate than others when various real-world effects are considered. This article
examines the effects of finite word length. It suggests that certain implementation forms are less
susceptible than others to the errors introduced by finite word length effects.
Introduction to DFT:
The discrete Fourier transform (DFT) derived from the Fourier series The exponential
Fourier series of a continuous time periodic signal x(t) with fundamental period T 0 is given
by the synthesis equation
with the fundamental frequency F 0 and the period T 0 related by F 0 (Hz) = 1/T 0 (sec).
To obtain finite-sum approximations for the above two equations, consider the analog
periodic signal x(t) shown in Figure and its sampled version x s (nT). Using x s (nT), we can
approximate the integral for X k by the sum
k =
0, 1,
,
N1
x
(
n
)
e
j
2
k
n
/
N
k =
0, 1,
,
N1
where we used the relation F 0 T = 1/N, and approximated dt (or t) by T, and have used the
shorthand notation x(n) = x s (nT). (This procedure is similar to that used in a typical
introduction to integral calculus).
is sometimes
It
better to reason in terms of these periodic extensions when dealing with the DFT. Specifically, if
X[k] is the DFT of x[n], then the inverse DFT of X[k] is ~x[n]. The signals x[n] and ~x[n] are
identical over the interval 0 to N 1, but may differ outside of this range. Similar statements can
be made regarding the transform Xf[k].
Properties of the DFT
Many of the properties of the DFT are analogous to those of the discrete-time Fourier
transform, with the notable exception that all shifts involved must be considered to be
circular,
or
modulo
N.
Defining
the
DFT
pairs
and
A finite series
approximation for x(t) is obtained by truncating the series for x(t) in equation (1) to N
terms and substituting t = nT and F 0 = 1/TN. This will necessarily give the discrete
sequence x(n) instead of the continuous function x(t):
N 1
x(n) or x n =
Xk
k=0
j 2 k n / N
, n = 0, 1, , N1
x(t)
t
0
T0
2T 0
x(t)
x s (nT)
T 0 = NT
2T
(N1)T
N samples at n = 0, 1, , N1
t or dt = T = T 0 /N
The above two equations define the discrete Fourier transform (DFT) pair. A slight
adjustment of the (1/N) factor is needed so as to conform to standard usage. The
adjustment consists of moving the (1/N) factor from one equation to the other. Then the
direct DFT of the time series x 0 , x 1 , , x N-1 is defined as
N 1
Xk =
x n
n=0
j 2 k n / N
, k = 0, 1, , N1
(3)
n = 0, 1, , N1
(4)
It can be shown that substituting equation (3) into equation (4) produces an identity, so that
the two equations are indeed mutually inverse operations and therefore constitute a valid
transform pair.
(End of Omit)
The discrete Fourier transform as a discretized (sampled) version of the DTFT A
finite-duration sequence x(n) of length N (the length N may have been achieved by zeroj
padding a sequence of shorter length) has a Fourier transform denoted X() or X(e ),
N 1
X() =
x(n) e j n
0 < 2
N 1
X(k) X 2 k =
x(n) e j 2 k n / N ,
N
n=0
Since these frequency samples are obtained by evaluating the Fourier transform X() at N
equally spaced discrete frequencies, the above relation is called the discrete Fourier
transform (DFT) of x(n). In other words, X(k) are discrete samples of the continuous X().
N samples of X()
The corresponding inverse discrete Fourier transform (IDFT) is given by
1 N 1
j 2 k n / N
, n = 0, 1, , N1
X (k ) e
x(n) =
k = 0
Example 1 Find the DFT of the unit sample x(n) = {1, 0, 0, 0}. (Aside. What is the DTFT
of x(n) = {1, 0, 0, 0}?)
x(n) = {1, 0, 0, 0}
1
n
1
3
N1
4
N
Sequence
Solution The number of samples is N = 4. The DFT is given by
N 1
X(k) =
x(n) e
= x(n) e
j k 2 n / N
j k 2 n / 4
0 k N1
, 0k3
n=0
3
= x(n) e
j k 2 n / 4
k = 0, 1, 2, 3
n=0
x(n) e
j k 2 n / 4
, k = 0, 1, 2, 3
n=0
k=0
X(0) =
x(n) e
j 0.2 n / 4
n=0
x(n) .1 = x(n)
n=0
n=0
X(1) = x(n) e
j1 . 2 n / 4
n=0
k=2
x(n) e
j 2 . 2 n / 4
n=0
k=3
x(n) e
n=0
= x(0) e
=1.1=1
x(n) e
jn
j 0
= x(0) e
=1.1=1
n=0
X(3) =
j 0
j n /2
n=0
X(2) =
x(n) e
j 3 . 2 n / 4
x(n) e
j3 n/2
= x(0) e
j 0
=1.1=1
n=0
The DFT is X(k) = {1, 1, 1, 1} and contains all (four) frequency components. In this example
X(k) is real-valued.
00
0.5
1.5
2.5