Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
24 views

Digital Signal Processing: Dr. Muayad

This document discusses the discrete Fourier transform (DFT) which is used to analyze discrete-time signals in the frequency domain. It begins by introducing the need for a discrete frequency representation when working with digital signals. It then defines the DFT and inverse DFT (IDFT) mathematically. Some key properties of the DFT are described, including linearity, behavior under time shifting and time reversal, and the relationship between circular convolution in the time domain and multiplication of DFTs in the frequency domain. Examples are provided to demonstrate computing the DFT and IDFT of simple signals and finding the circular convolution of two sequences.

Uploaded by

ljjb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Digital Signal Processing: Dr. Muayad

This document discusses the discrete Fourier transform (DFT) which is used to analyze discrete-time signals in the frequency domain. It begins by introducing the need for a discrete frequency representation when working with digital signals. It then defines the DFT and inverse DFT (IDFT) mathematically. Some key properties of the DFT are described, including linearity, behavior under time shifting and time reversal, and the relationship between circular convolution in the time domain and multiplication of DFTs in the frequency domain. Examples are provided to demonstrate computing the DFT and IDFT of simple signals and finding the circular convolution of two sequences.

Uploaded by

ljjb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Digital Signal Processing

Lecture 7

Dr. Muayad

3rd year
The Discrete Fourier transforms (DFT)
7.1 Introduction
Frequency analysis of discrete-time signals is usually and most
conveniently performed on a digital signal processor, which may be a
general-purpose digital computer or specially designed digital hardware. To
perform frequency analysis on a discrete-time signal x(n), we convert the
time-domain sequence to an equivalent frequency-domain representation.
We know that such a representation is given by the Fourier transform X ( w )
of the sequence x(n). However, X(w) is a continuous function of frequency
and therefore. it is not a computationally convenient representation of the
sequence x(n). In this lecture ,we consider the representation of a sequence
x(n) by samples of its spectrum X(w). Such a frequency-domain
representation leads to the discrete Fourier transform (DFT), which is a
powerful computational tool for performing frequency analysis of discrete-
time signals. In other words, digital computers can only work with
information that is discrete and finite in length.
7.2 The Discrete Fourier Transform (DFT)
The DFT is the frequency-domain sampling of an aperiodic sequence x(n).
The discrete Fourier transform (DFT) of x(n) is defined as

… (7.1)
the frequency samples are obtained by evaluating the Fourier transform
X(w) at a set of N (equally spaced) discrete frequencies. In turn, the relation
which allows us to recover the sequence x(n) from the frequency samples is
… (7.2)

The formulas for the DFT and IDFT may be expressed as

… (7.3)

… (7.4)
where, by definition,

… (7.5)

WN, namely the trigonometric constant ,which is an Nth root of unity.


Define an N-point vector xN of the signal sequence x(n), n = 0, 1 , . . . , N-1,
an N-point vector XN of frequency samples, and an N x N matrix WN as
… (7.6)

With these definitions, the N-point DFT may be expressed in matrix form as

… (7.7)
where WN is the matrix of the linear transformation.
expression for the IDFT

… (7.8)
The DFT copes with complex as well as real signal. Given the time
domain signal, the process of calculating the frequency domain is called
decomposition. The DFT of a signal x(n) defined over the range 0 ≤ 𝑛 ≤
𝑁−1
The additional value of the spectrum outside the range 0 ≤ 𝑘 ≤ 𝑁 − 1
form a periodic spectral sequence. Likewise, the additional of the signal x(n)
outside the range 0 ≤ 𝑛 ≤ 𝑁 − 1 yields a periodic version of the signal.
We can see that both DFT and IDFT represented finite length sequences as
one period of a periodic sequence.
The power 𝑊𝑁 for k = 0.. . N - 1 embraces all the N roots. Thinking of
the complex numbers as points in the plan𝑒 𝑊 𝑘𝑛 is clearly on the unit circle
(since its absolute value is one). Each successive power moves a further h
around the circle until for N = 1 we return to 𝑊𝑁0 = 1. This is illustrated in
the Figure (7.1) for N = 8. The power 𝑊𝑁 of must be determined for N=8,
where
𝑊𝑁0 = 𝑊𝑁8 = 𝑊𝑁16
𝑊𝑁1 = 𝑊𝑁9 = 𝑊𝑁17
𝑊𝑁2 = 𝑊𝑁10 = 𝑊𝑁18
𝑊𝑁3 = 𝑊𝑁11 = 𝑊𝑁17 and so on

Figure 7.1: The N complex roots of unity displayed graphically. (Here N = 8.)

We note that the computation of each point of the DFT can be accomplished
by N complex multiplications and (N-1) complex additions. Hence the N-
point DFT values can be computed in a total of 𝑁 2 complex multiplications
and N(N-1) complex additions.
Example (7.1):- Compute the DFT of the following four point sequence
x(n)=[0 1 2 3]
Solution:-
𝑘𝑛
𝑋(𝑘) = ∑𝑁−1
𝑛=0 𝑥(𝑛)𝑊𝑁 , the length of this signal is N=4
𝑋(0) = 𝑥(0)𝑊𝑁0 + 𝑥(1)𝑊𝑁0 + 𝑥(2)𝑊𝑁0 + 𝑥(3)𝑊𝑁0
𝑋(1) = 𝑥(0)𝑊𝑁0 + 𝑥(1)𝑊𝑁1 + 𝑥(2)𝑊𝑁2 + 𝑥(3)𝑊𝑁3
𝑋(2) = 𝑥(0)𝑊𝑁0 + 𝑥(1)𝑊𝑁2 + 𝑥(2)𝑊𝑁4 + 𝑥(3)𝑊𝑁6
𝑋(3) = 𝑥(0)𝑊𝑁0 + 𝑥(1)𝑊𝑁3 + 𝑥(2)𝑊𝑁6 + 𝑥(3)𝑊𝑁9
𝑋(𝑘) = 𝑊𝑁 𝑥(𝑛)
1 1 1 1 0
1 𝑊41 𝑊42 𝑊43 1
𝑋(𝑘) = [ ]
1 𝑊42 𝑊44 𝑊46 2
[1 𝑊43 𝑊46 𝑊49 ] 3
2𝜋𝑗
𝑊𝑁 = 𝑊4 = 𝑒 − 𝑁 = 𝑒 −𝜋𝑗/2 = −𝑗
ْ𝑋(0) 1 1 1 1 0 6
𝑋(1) 1 –𝑗 − 1 𝑗 1 −2 + 2𝑗
=[ ][ ] = [ ]
X(2) 1 −1 1−1 2 −2
[ X(3) ] 1 𝑗 −1 −𝑗 3 −2 − 2𝑗

ImagX(k)
2

1.5

0.5

-0.5

-1

-1.5

-2
0 1 2 3 4 5 6
k
ReX(k)
6

-1

-2
0 1 2 3 4 5 6
k

Figure (7.2) the 4-point DFT spectrum real and imaginary of example 7.1

Example (7.2):- Find the IDFT for the following spectrum to obtain the
original signal 𝑋(𝑘) = [2 1 + 𝑗 0 1 − 𝑗]
1
Solution: - 𝑥(𝑛) = ∑𝑁−1 −𝑘𝑛
𝑘=0 𝑋(𝑘)𝑊𝑁 , the length of this signal is N=4
4
1
𝑥(𝑛) = ∑3𝑘=0 𝑋(𝑘)𝑊𝑁−𝑘𝑛
4

𝑊𝑁 = 𝑊4 = −𝑗
1
𝑥(0) = [𝑋(0)(−𝑗)0 + 𝑋(1) + 𝑋(2) + 𝑋(3)] = 1
4
1
𝑥(1) = [𝑋(0)(−𝑗)0 + 𝑋(1)(−𝑗)−1 + 0 + 𝑋(3)(−𝑗)−3 ] = 0
4
1
𝑥(2) = [2(−𝑗)0 + 𝑋(1)(−𝑗)−2 + 0 + 𝑋(3)(−𝑗)−6 ] = 0
4
1
𝑥(3) = [2(−𝑗)0 + 𝑋(1)(−𝑗)−3 + 0 + 𝑋(3)(−𝑗)−9 ] = 1
4

Then x(n)=[1,0 ,0,1]


7.3 DFT PROPERTIES
The properties of the DFT when the sequence is assumed to be finite in
length
1.

… (7.9)

In using this property, it is important to ensure that the DFTs are the same
length. If x1(n) and x2(n) have different lengths, the shorter sequence must
be padded with zeros in order to make it the same length as the longer
sequence. For example, if x1(n) is of length N1and x2(n) is of length N2 with
N2 > N1. X1(n) may be considered to be a sequence of length N2 with the
last N2 - NI values equal to zero, and DFTs of length N2 may be taken for
both sequences.
2. Circular shift of a Sequence
The circular shift of a sequence x(n) is defined as follows:
𝑥((𝑛 − 𝑛0 ))𝑁 𝑅𝑁 (𝑛) = 𝑥𝑝 (𝑛 − 𝑛0 )𝑅𝑁 (𝑛)
Where no is the amount of the shift and 𝑅𝑁 (𝑛) is a rectangular
window. A circular shift may be visualized as follows. Suppose that
the values of a sequence x(n) from n = 0 to n =N - 1 , are marked
around a circle as illustrated in Figure (7.3 e). A circular shift to the
right by no corresponds to a rotation of the circle no positions in a
clockwise direction. Another way to circularly shift a sequence is to
form the periodic sequence xp( n ) , perform a linear shift, xp(n - no),
and then extract one period of xp(n - no) by multiplying by a
rectangular window as shown in Figure (7.3 a,b,c,d). Hence x'(n) is
simply x(n) shifted circularly by two units in time, where the
counterclockwise direction has been arbitrarily selected as the positive
direction. Thus we conclude that a circular shift of an N-point
sequence is equivalent to a linear shift of its periodic extension, and
vice versa.

the circular shift of the sequence can be represented as the index modulo N.
Thus we can write

… (7.12)

If a sequence is circularly shifted, the DFT is multiplied by a complex


exponential
𝐷𝐹𝑇
𝑥((𝑛 − 𝑛0))𝑁 ↔ 𝑊𝑁𝑛0𝑘 𝑋(𝑘) … (7.13)
Figure 7.4 Circular shift of a sequence
3. Circular convolution. If

And

Then

… (7.15)
Where 𝑥1 (𝑛) N 𝑥2 (𝑛) denotes the circular convolution of the sequence
xl(n) and x2(n).
4. Time reversal of a sequence. If

Then

… (7.16)
Hence reversing the N-point sequence in time is equivalent to reversing the
DFT values. Time reversal of a sequence x(n) is illustrated in Figure 7.6.

Figure 7.6 Time reversal of a sequence.


7.4 Circular Convolution
The circular convolution is defined as

.. (7.14)
it is not the ordinary linear convolution that, which relates the output
sequence y(n) of a linear system to the input sequence x(n) and the impulse
response h(n). Instead, the convolution sum in (7.14) involves the index ((m
-n))N and is called circular convolution.
The multiplication of the DFTs of two sequences is equivalent to the circular
convolution of the two sequences in the time domain.
Example (7.3) Perform the circular convolution of the following two
sequences:

Solution: Each sequence consists of four nonzero points. For the purposes
of illustrating the operations involved in circular convolution, it is desirable
to graph each sequence as points on a circle. Thus the sequences x l(n) and
x2(n) are graphed as illustrated in Figure(7.5) (a). We note that the sequences
are graphed in a counterclockwise direction on a circle. This establishes the
reference direction in rotating one of the sequences relative to the other.
Now, x3(m) is obtained by circularly convolving xl(n) with x2(n) as specified
by equation(7.14). Beginning with m = 0 we have
𝑥2 ((−𝑛))4 is simply the sequence 𝑥2 (𝑛)folded and graphed on a circle as
illustrated in Figure 7.5(b). In other words, the folded sequence is simply
x2(n) graphed in a clockwise direction. The product sequence is obtained by
multiplying 𝑥1 (𝑛) 𝑤𝑖𝑡ℎ 𝑥2 ((−𝑛))4 point by point. This sequence is also
illustrated in Figure 7.5(b). Finally, we sum the values in the product
sequence to obtain x3(0) =14
For m=1 we have

Then x3(1) =16, x3(2)=14, x3(3) =16 as illustrate in Figure 7.5

Circular convolution involves basically the same four steps as the


ordinary linear convolution folding (time reversing) one sequence, shifting
the folded sequence, multiplying the two sequences to obtain a product
sequence, and finally, summing the values of the product sequence. The
basic difference between these two types of convolution is that, in circular
convolution, the folding and shifting (rotating) operations are performed in a
circular fashion by computing the index of one of the sequences modulo N.
Example (7.4): Determine the sequence x3(n) corresponding to the circular
convolution of the sequences x1(n) and x2(n) given in the previous example
using DFT and IDFT.
Solution: compute the DFTs of xl(n) and x2(n). The four-point DFT of
xl(n) is

Thus 𝑋1 (0) = 6 , 𝑋1 (1) = 0 , 𝑋1 (2) = 2, 𝑋1 (3) = 0


The DFT of x2(n) is

Thus

When we multiply the two DFTs, we obtain the product


X3(k) = Xl( k ). X2( k )
Or, equivalently,

Now, the IDFT of X3(k) is

Which is the result obtained in Example 7.3 from circular convolution.


Figure (7.5) Circular convolution of two sequences of example (7.3).
7.5 LINEAR FILTERING METHODS BASED ON THE DFT
Since the DFT provides a discrete frequency representation of a finite-
duration sequence in the frequency domain, it is interesting to explore its use
as a computational tool for linear system analysis and, especially, for linear
filtering. We have already established that a system with frequency response
H(w), when excited with an input signal that has a spectrum X(w), possesses
an output spectrum Y(w) = X(w)H(w). The DFT provides a convenient way
to perform convolutions without having to evaluate the convolution sum.
Specifically, if h(n) is N1 points long and x(n) is N2 points long. Then h(n)
may be linearly convolved with x(n) as follows:
1. Pad the sequences h(n) and x(n) with zeros so that they are of
length N ≥ NI + N2 - 1.
2. Find the N -point DFTs of h(n) and x(n).
3. Multiply the DFTs to form the product Y (k) = H (k).X ( k ) .
4. Find the inverse DFT of Y(k).
The product of two DFTs is equivalent to the circular convolution of
the corresponding time-domain sequences. Since the sequences x(n) and h(n)
have a duration less than N, we simply pad these sequences with zeros to
increase their length to N. This increase in the size of the sequences does not
alter their spectra X(w) and H(w).
In other words, by increasing the length of the sequences x(n) and h(n) to N
points (by appending zeros), and then circularly convolving the resulting
sequences, we obtain the same result as would have been obtained with
linear convolution. Thus with zero padding, the DFT can be used to perform
linear filtering.
There are some difficulties with the DFT approach. For example, if x(n) is
very long, we must commit a significant amount of time computing very
long DFTs and in the process accept very long processing delays. In some
cases, it may even be possible that x(n) is too long to compute the DFT. The
solution to these problems is to use block convolution, which involves
segmenting the signal to be filtered, x(n), into sections. Each section is then
filtered with the FIR filter h(n), and the filtered sections are pieced together
to form the sequence y(n). There are two block convolution techniques. The
first is overlap-add, and the second is overlap-save.

Example (7.5) use DFT and IDFT, determine the response of the FIR filter
with impulse response

to the input sequence

Solution: The input sequence has length L = 4 and the impulse response has
length M = 3. Linear convolution of these two sequences produces a
sequence of length N = 6. Consequently, the size of the DFTs must be a1
least six. For simplicity we compute eight-point DFTs.

The computation yields


The eight-point DFT of h(n) is

Hence

The product of these two DFTs yields Y(k), which is

Finally, the eight-point IDFT is

Yields
We observe that the first six values of y(n) constitute the set of desired
output values. The last two values are zero because we used an eight-point
DFT and IDFT, when, in fact, the minimum number of points required is six.

You might also like