0% found this document useful (0 votes)
27 views

Advanced Digital Signal Processing Ch2

This document discusses the discrete Fourier transform (DFT) and its properties. It begins by introducing the DFT and how it can be used to analyze a signal's frequency content and amplitude spectrum. It then provides examples of calculating the DFT of periodic signals and plotting the resulting two-sided amplitude spectrum. The document derives the DFT formula and explains how it relates the time and frequency domain representations of a digital signal. It also describes how the Fast Fourier Transform (FFT) algorithm can efficiently compute the DFT.

Uploaded by

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

Advanced Digital Signal Processing Ch2

This document discusses the discrete Fourier transform (DFT) and its properties. It begins by introducing the DFT and how it can be used to analyze a signal's frequency content and amplitude spectrum. It then provides examples of calculating the DFT of periodic signals and plotting the resulting two-sided amplitude spectrum. The document derives the DFT formula and explains how it relates the time and frequency domain representations of a digital signal. It also describes how the Fast Fourier Transform (FFT) algorithm can efficiently compute the DFT.

Uploaded by

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

University of Babylon

College of Engineering
Department of Electrical Engineering

Advanced Digital Signal Processing

Second Term
Ph.D. Course for Electronics & Communications
By
Prof. Dr. Ehab A. Hussein
Chapter (2)
Discrete Fourier Transform and Signal Spectrum
Objectives:
This chapter investigates Discrete Fourier
transform (DFT) and Fast Fourier Transform (FFT)
and their properties; introduces the DFT/FFT algorithms
to compute signal amplitude spectrum and power
spectrum; and uses the window function to reduce spectral
leakage. Finally, the chapter describes the FFT algorithm
and shows how to apply it to estimate a speech spectrum.

2 Prof. Dr. Ehab


2.1 Discrete Fourier Transform
In time domain, representation of digital signals describes the
signal amplitude versus the sampling time instant or the sample
number. However, in some applications, signal frequency content is
very useful otherwise than as digital signal samples. The representation
of the digital signal in terms of its frequency component in a
frequency domain, that is, the signal spectrum, needs to be developed.
As an example, Figure .1 illustrates the time domain
representation of a 1,000-Hz sinusoid with 32 samples at a
sampling rate of 8,000 Hz; the bottom plot shows the signal
spectrum (frequency domain representation), where we can clearly
observe that the amplitude peak is located at the frequency of 1,000
Hz in the calculated spectrum. Hence, the spectral plot better displays
frequency information of a digital signal.

3 Prof. Dr. Ehab


2.1 Discrete Fourier Transform

Figure.1: Example of the digital signal and its


4 Prof. Dr. Ehab amplitude spectrum.
2.1 Discrete Fourier Transform
The algorithm transforming the time domain signal
samples to the frequency domain components is known as the
discrete Fourier transform, or DFT. The DFT also establishes a
relationship between the time domain representation and the
frequency domain representation. Therefore, we can apply the
DFT to perform frequency analysis of a time domain sequence.
In addition, the DFT is widely used in many other areas,
including spectral analysis, acoustics, imaging/video, audio,
instrumentation, and communications systems. To be able to
develop the DFT and understand how to use it, we first study
the spectrum of periodic digital signals using the Fourier series.

5 Prof. Dr. Ehab


2.1.1. Fourier Series Coefficients of Periodic Digital Signals
Let us look at a process in which we want to estimate the spectrum of a
periodic digital signal x(n) sampled at a rate of fs Hz with the fundamental period
T0=NT, as shown in Figure .2, where there are N samples within the duration of the
fundamental period and T=1/fs is the sampling period. For the time being, we assume
that the periodic digital signal is band limited to have all harmonic frequencies less
than the folding frequency fs/2 so that aliasing does not occur.
According to Fourier series analysis, the coefficients of the Fourier series
expansion of a periodic signal x(t) in a complex form is:
1
𝑐𝑘 = 𝑥(𝑡)𝑒 −𝑗𝑘𝜔0 𝑡 𝑑𝑡. −∞ < 𝑘 < ∞
𝑇0 𝑇0
where k is the number of harmonics corresponding to the harmonic frequency of kf0
and w0 = 2p/T0 and f0 = 1/T0 are the fundamental frequency in radians per second
and the fundamental frequency in Hz, respectively. To apply Equation above, we
substitute T0=NT, w0 = 2p/T0 and approximate the integration over one period using
a summation by substituting dt=T and t=nT. We obtain:
𝑁−1
1 −𝑗
2𝜋𝑘𝑛
Prof. Dr. Ehab 𝑐𝑘 = 𝑥 𝑛 𝑒 𝑁 , −∞<𝑘 <∞
6 𝑁
𝑛=0
2.1.1. Fourier Series Coefficients of Periodic Digital Signals
Since the coefficients ck are obtained from the Fourier series expansion
in the complex form, the resultant spectrum ck will have two sides. There is an
important feature of Equation above in which the Fourier series coefficient ck is
periodic of N. We can verify this as follows:
2𝜋(𝑘+𝑁)𝑛 2𝜋𝑘𝑛
1 𝑁−1 −𝑗 1 𝑁−1 −𝑗
𝑐𝑘+𝑁 = 𝑛=0 𝑥 𝑛 𝑒 𝑁 = 𝑛=0 𝑥 𝑛 𝑒 𝑁 𝑒 −𝑗2𝜋𝑛 .
𝑁 𝑁
Since 𝑒 −𝑗2𝜋𝑛 =cos 2𝜋𝑛 − 𝑗𝑠𝑖𝑛 2𝜋𝑛 = 1, it follows that ck+N = ck.

7 Prof. Dr. Ehab


Figure.2: Periodic digital signal.
2.1.1. Fourier Series Coefficients of Periodic Digital Signals
Therefore, the two-sided line amplitude spectrum |ck| is periodic, as shown
in Figure .3.

Figure .3: Amplitude spectrum of the periodic digital signal.


We note the following points:
a. As displayed in Figure .3, only the line spectral portion between the frequency -fs/2
and frequency fs/2 (folding frequency) represents the frequency information of the
periodic signal.
8 Prof. Dr. Ehab
2.1.1. Fourier Series Coefficients of Periodic Digital Signals
b. Notice that the spectral portion from fs/2 to fs is a copy of the spectrum in
the negative frequency range from –fs/2 to 0 Hz due to the spectrum being
periodic for every Nf0 Hz. Again, the amplitude spectral components
indexed from fs/2 to fs can be folded at the folding frequency fs/2 to match
the amplitude spectral components indexed from 0 to fs/2 in terms of (fs-f)
Hz, where f is in the range from fs/2 to fs. For convenience, we compute the
spectrum over the range from 0 to fs Hz with nonnegative indices, that is,
𝑁−1
1 −𝑗
2𝜋𝑘𝑛
𝑐𝑘 = 𝑥 𝑛 𝑒 𝑁 , 𝑘 = 0,1, … , 𝑁 − 1.
𝑁
𝑛=0
We can apply Equation above to find the negative indexed spectral values if
they are required.
c. For the kth harmonic, the frequency is
f = kf0 Hz.
The frequency spacing between the consecutive spectral lines, called the
frequency resolution, is f0 Hz.
9
Prof. Dr. Ehab
Example .1: The periodic signal
x(t) = sin (2pt).
is sampled using the rate fs = 4 Hz.
a. Compute the spectrum ck using the samples in one period.
b. Plot the two-sided amplitude spectrum|ck|over the range from (-2 to 2) Hz.
Solution:
a. From the analog signal, we can determine the fundamental frequency w0=2p radians per
w 2p
second and f0 = 0 = =1Hz, and the fundamental period T0=1 second. Since using the
2p 2p
sampling interval T=1/fs = 0.25 second, we get the sampled signal as:
x(n) = x(nT) = sin (2pnT) = sin (0.5pn).
and plot the first eight samples as shown in Figure .4.

10
Figure .4: Periodic digital signal. Prof. Dr. Ehab
Example .1:
Choosing the duration of one period, N = 4, we have the sample values as follows:
x(0) = 0; x(1) = 1; x(2) = 0; and x(3) = -1.
Using Equation above,
1 3 1 1
𝑐0 = 𝑛=0 𝑥 𝑛 = (𝑥 0 + 𝑥 1 + 𝑥 2 + 𝑥(3))= 0+1+0−1 =0
4 4 4
3
1 1 −
𝑗𝜋

𝑗3𝜋
𝑐1 = 𝑥 𝑛 𝑒 −𝑗2𝜋𝑛/4 = (𝑥 0 + 𝑥 1 𝑒 2 + 𝑥 2 𝑒 −𝑗𝜋 +𝑥 3 𝑒 2 )
4 4
𝑛=0
1
= 𝑥 0 − 𝑗𝑥 1 − 𝑥 2 + 𝑗𝑥(3) = 0 − 𝑗 1 − 0 + 𝑗 −1 = −𝑗0.5.
4
Similarly, we get
3 3
1 1
𝑐2 = 𝑥 𝑛 𝑒 −𝑗2𝜋2𝑛/4 = 0, 𝑎𝑛𝑑 𝑐3 = 𝑥 𝑛 𝑒 −𝑗2𝜋3𝑛/4 = 𝑗0.5.
4 4
𝑛=0 𝑛=0
Using periodicity, it follows that:
c-1 = c3 = j0.5, and c-2 = c2 = 0.
11
Prof. Dr. Ehab
Example .1:
b. The amplitude spectrum for the digital signal is sketched in Figure .5.
As we know, the spectrum in the range of -2 to 2 Hz presents the
information of the sinusoid with a frequency of 1 Hz and a peak value of
2|c1|=1, which is converted from two sides to one side by doubling the
spectral value. Note that we do not double the direct-current (DC)
component, that is, c0.

Figure. 5: Two-sided spectrum for the periodic


12 digital signal in Example .1. Prof. Dr. Ehab
2.1.2 Discrete Fourier Transform Formulas
Now, let us concentrate on development of the DFT. Figure .6 shows
one way to obtain the DFT formula.

13 Figure. 6: Development of DFT formula. Prof. Dr. Ehab


2.1.2 Discrete Fourier Transform Formulas
First, we assume that the process acquires data samples from digitizing the
interested continuous signal for a duration of T seconds. Next, we assume that a
periodic signal x(n) is obtained by copying the acquired N data samples with the
duration of T to itself repetitively. Note that we assume continuity between the N data
sample frames. This is not true in practice. We will tackle this problem in later section.
We determine the Fourier series coefficients using one-period N data samples and
Equation above. Then we multiply the Fourier series coefficients by a factor of N to
obtain:
𝑁−1
2𝜋𝑘𝑛
−𝑗
𝑋 𝑘 = 𝑁𝑐𝑘 = 𝑥(𝑛)𝑒 𝑁 , 𝑘 = 0, 1, … , 𝑁 − 1.
𝑛=0
where X(k) constitutes the DFT coefficients. Notice that the factor of N is a constant
and does not affect the relative magnitudes of the DFT coefficients X(k). As shown in
the last plot, applying DFT with N data samples of x(n) sampled at a rate of fs (sampling
period is T = 1/fs) produces N complex DFT coefficients X(k). The index n is the time
index representing the sample number of the digital sequence, whereas k is the
frequency index indicating each calculated DFT coefficient, and can be further
mapped to the corresponding signal frequency in terms of Hz.
14
Prof. Dr. Ehab
2.1.2 Discrete Fourier Transform Formulas
Now let us conclude the DFT definition. Given a sequence x(n), 0  n  N-1,
its DFT is defined as:
𝑁−1 𝑁−1
2𝜋𝑘𝑛
−𝑗
𝑋 𝑘 = 𝑥 𝑛 𝑒 𝑁 = 𝑥 𝑛 𝑊𝑁 𝑘𝑛 , 𝑓𝑜𝑟 𝑘 = 0, 1, … , 𝑁 − 1.
𝑛=0 𝑛=0
Equation above can be expanded as:
𝑋 𝑘 = 𝑥 0 𝑊𝑁 𝑘0 + 𝑥(1) 𝑊𝑁 𝑘1 + 𝑥(2)𝑊𝑁 𝑘2 + … + 𝑥(𝑁 − 1)𝑊𝑁 𝑘(𝑁−1) ,
𝑓𝑜𝑟 𝑘 = 0, 1, … , 𝑁 − 1.
where the factor WN (called the twiddle factor in some textbooks) is defined as
−𝑗2𝜋/𝑁
2𝜋 2𝜋
𝑊𝑁 = 𝑒 = cos − 𝑗𝑠𝑖𝑛 .
𝑁 𝑁
The inverse DFT is given by:
𝑁−1 𝑁−1
1 𝑗
2𝜋𝑘𝑛 1
𝑥(𝑛) = 𝑋 𝑘 𝑒 𝑁 = 𝑋 𝑘 𝑊𝑁 −𝑘𝑛 , 𝑛 = 0,1, … , 𝑁 − 1.
𝑁 𝑁
𝑘=0 𝑘=0
The expansion of Equation above leads to:
1
𝑥 𝑛 = (𝑋 0 𝑊𝑁 −0𝑛 + 𝑋(1) 𝑊𝑁 −1𝑛 + 𝑋(2)𝑊𝑁 −2𝑛 + … + 𝑋(𝑁 − 1)𝑊𝑁 − 𝑁−1 𝑛
),
𝑁
𝑓𝑜𝑟 𝑛 = 0, 1, … , 𝑁 − 1.
15
Prof. Dr. Ehab
2.1.2 Discrete Fourier Transform Formulas
As shown in Figure .6, in time domain we use the sample number or
time index n for indexing the digital sample sequence x(n). However, in
frequency domain, we use index k for indexing N calculated DFT coefficients
X(k). We also refer to k as the frequency bin number in Equations above.
We can use MATLAB functions fft() and ifft() to compute the DFT
coefficients and the inverse DFT with the following syntax in Table. 1:
Table .1: MATLAB FFT functions.

The following examples serve to illustrate the application of DFT and


the inverse of DFT.
16
Prof. Dr. Ehab
Example. 2: Given a sequence x(n) for 0  n  3, where x(0)=1, x(1)=2,
x(2)=3, and x(3)=4,
a. Evaluate its DFT X(k).
Solution:
a. Since N = 4 and W4 = e-jp/2 , and by using equation we have a simplified
formula,
𝜋𝑘𝑛
3 𝑘𝑛 3 −𝑗
𝑋 𝑘 = 𝑛=0 𝑥 𝑛 𝑊4 = 𝑛=0 𝑥 𝑛 𝑒 2 .
Thus, for k=0
3

𝑋 0 = 𝑥 𝑛 𝑒 −𝑗0 = 𝑥 0 𝑒 −𝑗0 + 𝑥 1 𝑒 −𝑗0 + 𝑥 2 𝑒 −𝑗0 + 𝑥(3)𝑒 −𝑗0


𝑛=0
= 𝑥 0 + 𝑥 1 + 𝑥 2 + 𝑥 3 = 1 + 2 + 3 + 4 = 10
In the similar way for k=1, X(1)=-2+j2 , and for k=2, X(2)= -2, and for k=3,
X(3)=-2-j2.
Let us verify the result using the MATLAB function fft():
X = fft([1 2 3 4])
X = 10.0000 -2.0000+2.0000i -2.0000 -2.0000-2.0000i
17
Prof. Dr. Ehab
Example. 3: Using the DFT coefficients X(k) for 0  k  3 computed in
Example .2,
a. Evaluate its inverse DFT to determine the time domain sequence x(n).
Solution:
a. Since N = 4 and W4-1 = ejp/2, and by using equation achieve a simplified
formula,
3 3
1 −𝑛𝑘 1 𝑗
𝜋𝑘𝑛
𝑥 𝑛 = 𝑋(𝑘)𝑊4 = 𝑋 𝑘 𝑒 2 .
4 4
𝑘=0 𝑘=0
Then for n = 0, we have:
3
1 1
𝑥 0 = 𝑋 𝑘 𝑒 𝑗0 = 𝑋 0 𝑒 𝑗0 + 𝑋 1 𝑒 𝑗0 + 𝑋 2 𝑒 𝑗0 + 𝑋 3 𝑒 𝑗0
4 4
𝑘=0
1
= 10 + −2 + 𝑗2 − 2 + (−2 − 𝑗2 = 1.
4
In the similar way for n=1, x(1)=2, and for n=2, x(2)= 3, and for n=3, x(3)=4.

18
Prof. Dr. Ehab
Example. 3:
This example actually verifies the inverse DFT. Applying the MATLAB function ifft() achieves:
≫ x =ifft([10 -2+2j -2 -2-2j])
x=1 2 3 4
Now we explore the relationship between the frequency bin k and its associated frequency.
Omitting the proof, the calculated N DFT coefficients X(k) represent the frequency
components ranging from 0 Hz (or radians/second) to fs Hz (or ws radians/second), hence we
can map the frequency bin k to its corresponding frequency as follows:
𝑘𝜔𝑠
𝜔= 𝑟𝑎𝑑𝑖𝑎𝑛𝑠 𝑝𝑒𝑟 𝑠𝑒𝑐𝑜𝑛𝑑 ,
𝑁
𝒌𝒇𝒔
or in terms of Hz, 𝒇= 𝑯𝒛 .
𝑵
where ws = 2pfs.
We can define the frequency resolution as the frequency step between two consecutive DFT
coefficients to measure how fine the frequency domain presentation is and achieve:
𝝎𝒔
∆𝝎 = 𝒓𝒂𝒅𝒊𝒂𝒏𝒔 𝒑𝒆𝒓 𝒔𝒆𝒄𝒐𝒏𝒅 ,
𝑵
𝒇𝒔
or in terms of Hz, it follows that: ∆𝒇 = 𝑯𝒛 .
𝑵
Let us study the following example.
19
Prof. Dr. Ehab
Example. 4:
In Example .2, given a sequence x(n) for 0  n  3, where x(0) = 1, x(1) = 2,
x(2) = 3, and x(3) = 4, we have computed four DFT coefficients X(k) for
0  k  3 as X(0) = 10, X(1) = -2+j2, X(2) = -2, and X(3) = -2-j2. If the
sampling rate is 10 Hz,
a. Determine the sampling period, time index, and sampling time instant for a
digital sample x(3) in time domain.
b. Determine the frequency resolution, frequency bin number, and mapped
frequency for each of the DFT coefficients X(1) and X(3) in frequency
domain.
Solution:
a. In time domain, we have the sampling period calculated as
T = 1/fs = 1/10 = 0.1 second.
For data x(3), the time index is n = 3 and the sampling time instant is
determined by:
t = nT = 30.1 = 0.3 second.
20
Prof. Dr. Ehab
Example. 4:
b. In frequency domain, since the total number of DFT coefficients is four, the
frequency resolution is determined by:
𝒇𝒔 𝟏𝟎
∆𝒇 = = = 𝟐. 𝟓 𝑯𝒛.
𝑵 𝟒
The frequency bin number for X(1) should be k = 1 and its corresponding
frequency is determined by:
𝑘𝑓𝑠 1×10
𝑓= = = 2.5 𝐻𝑧.
𝑁 4
𝑘𝑓𝑠 3×10
Similarly, for X(3) and k = 3, 𝑓= = = 7.5 𝐻𝑧.
𝑁 4

Note that k = 3 is equivalent to k-N = 3-4 = -1, and f = 7.5 Hz is also


equivalent to the frequency f = (-110)/4 = -2.5 Hz, which corresponds to the
negative side spectrum. The amplitude spectrum at 7.5 Hz after folding should
match the one at fs-f = 10-7.5=2.5 Hz. We will apply these developed notations
in the next section for amplitude and power spectral estimation.

21
Prof. Dr. Ehab
2.2 Amplitude Spectrum and Power Spectrum
One of the DFT applications is transformation of a finite-length digital
signal x(n) into the spectrum in frequency domain. Figure.7 demonstrates such
an application, where Ak and Pk are the computed amplitude spectrum and the
power spectrum, respectively, using the DFT coefficients X(k).
First, we achieve the digital sequence x(n) by sampling the analog signal
x(t) and truncating the sampled signal with a data window with a length T0=NT,
where T is the sampling period and N the number of data points. The time for
data window is: T0=NT.

22
Figure.7: Applications of DFT/FFT. Prof. Dr. Ehab
2.2 Amplitude Spectrum and Power Spectrum
For the truncated sequence x(n) with a range of n = 0, 1, 2, . . . , N-1, we get:
x(0), x(1), x(2), . . . , x(N-1).
Next, we apply the DFT to the obtained sequence, x(n), to get the N
DFT coefficients:
𝑁−1

𝑋 𝑘 = 𝑥 𝑛 𝑊4 −𝑛𝑘 , 𝑓𝑜𝑟 𝑘 = 0,1,2, … , 𝑁 − 1.


𝑛=0
Since each calculated DFT coefficient is a complex number, it is not
convenient to plot it versus its frequency index. Hence, after evaluating
Equation above, the magnitude and phase of each DFT coefficient (we refer to
them as the amplitude spectrum and phase spectrum, respectively) can be
determined and plotted versus its frequency index. We define the amplitude
spectrum as:
1 1 2
𝐴𝑘 = 𝑋(𝑘) = 𝑅𝑒𝑎𝑙,𝑋 𝑘 - + 𝐼𝑚𝑎𝑔,𝑋 𝑘 - 2 , k=0,1, … , N-1.
𝑁 𝑁

23
Prof. Dr. Ehab
2.2 Amplitude Spectrum and Power Spectrum
We can modify the amplitude spectrum to a one-sided amplitude
spectrum by doubling the amplitudes in Equation above, keeping the original
DC term at k = 0. Thus we have:
1
𝑋(0) , 𝑘 = 0.
𝐴𝑘 = 𝑁
2
𝑋(𝑘) , 𝑘 = 1, … , 𝑁/2.
𝑁
We can also map the frequency bin k to its corresponding frequency as:
𝑘𝑓𝑠
𝑓= .
𝑁
Correspondingly, the phase spectrum is given by:
−1
𝐼𝑚𝑎𝑔,𝑋(𝑘)-
𝜑𝑘 = tan , 𝑘 = 0,1,2, … , 𝑁 − 1.
𝑅𝑒𝑎𝑙,𝑋(𝑘)-
Besides the amplitude spectrum, the power spectrum is also used. The DFT
power spectrum is defined as:
1 2
1 2 2
𝑃𝑘 = 2 𝑋(𝑘) = 2 𝑅𝑒𝑎𝑙,𝑋 𝑘 - + 𝐼𝑚𝑎𝑔,𝑋 𝑘 - , 𝑘 = 0,1, … , 𝑁 − 1.
24
𝑁 𝑁
Prof. Dr. Ehab
2.2 Amplitude Spectrum and Power Spectrum
Similarly, for a one-sided power spectrum, we get:
1 2
2
𝑋(0) , 𝑘 = 0.
𝑃𝑘 = 𝑁
2 2
𝑋(𝑘) , 𝑘 = 1, … , 𝑁/2.
𝑁2
𝑘𝑓𝑠
and 𝑓= .
𝑁
Again, notice that the frequency resolution, which denotes the frequency
spacing between DFT coefficients in frequency domain, is defined as:
𝑓𝑠
∆𝑓 = (𝐻𝑧).
𝑁
It follows that better frequency resolution can be achieved by using a longer
data sequence.

25
Prof. Dr. Ehab
Example. 5: Consider the sequence shown in figure.8:

Figure.8: Sampled values in Example .5.

Assuming that fs = 100 Hz,


a. Compute the amplitude spectrum, phase spectrum, and power spectrum.
Solution:
a. Since N = 4, and using the DFT shown in Example .1, we find the DFT
coefficients to be:
X(0)=10, X(1)=-2+j2, X(2)= -2, X(3)= -2-j2.
26
Prof. Dr. Ehab
Example. 5:
The amplitude spectrum, phase spectrum, and power density spectrum are
computed as follows.
For k = 0, f = k .fs/N = 0100/4 = 0 Hz,
1 −1
𝐼𝑚𝑎𝑔,𝑋 0 -
𝐴0 = 𝑋(0) = 2.5, 𝜑0 = tan = 0𝑜 ,
4 𝑅𝑒𝑎𝑙,𝑋 0 -
1
𝑃0 = 2 𝑋(0) 2 = 6.25.
4
Similarly,
For k = 1, f = k .fs/N = 1100/4 = 25 Hz, A1=135o, P1=0.5.
For k = 2, f = k .fs/N = 2100/4 = 50 Hz, A1=180o, P1=0.25.
For k = 3, f = k .fs/N = 3100/4 = 75 Hz, A1=-135o, P1=0.5.
Thus, the sketches for the amplitude spectrum, phase spectrum, and
power spectrum are given in Figure .9.

27
Prof. Dr. Ehab
Example. 5:

Figure. 9: Exampl. 5
A) Amplitude spectrum and
phase spectrum.
B) Power density spectrum.

Note that the folding frequency in this example is 50 Hz and the amplitude and power
spectrum values at 75 Hz are each image counterparts (corresponding negative-indexed
frequency components). Thus values at 0, 25, and 50 Hz correspond to the positive-
28
indexed frequency components. Prof. Dr. Ehab
Example. 5:
We can easily find the one-sided amplitude spectrum and one-sided power
spectrum as:
𝐴0 = 2.5, 𝐴1 = 1.4141, 𝐴2 = 1, and
𝑃0 = 6.25, 𝑃1 = 2, 𝑃2 = 1.
We plot the one-sided amplitude spectrum for comparison as shown below:
Note that in the one-sided amplitude spectrum, the negative-indexed
frequency components are added back to the corresponding positive-indexed
frequency components; thus each amplitude value other than the DC term is
doubled. It represents the frequency components up to the folding frequency.

29
Figure. 10: One-sided amplitude spectrum in Example .5. Prof. Dr. Ehab
Homework . 1:
Consider a digital sequence sampled at the rate of 10 kHz. If we use a
size of 1,024 data points and apply the 1,024-point DFT to compute the
spectrum,
a. Determine the frequency resolution.
b. Determine the highest frequency in the spectrum.

Homework . 2:
We use the DFT to compute the amplitude spectrum of a sampled data
sequence with a sampling rate fs = 10 kHz. Given that it requires the
frequency resolution to be less than 0.5 Hz,
a. Determine the number of data points by using the FFT
algorithm, assuming that the data samples are available.

30
Prof. Dr. Ehab
3. Spectral Estimation Using Window Functions
When we apply DFT to the sampled data in the previous section, we
theoretically imply the following assumptions: first, that the sampled data are
periodic to themselves (repeat themselves), and second, that the sampled data
are continuous to themselves and band limited to the folding frequency. The
second assumption is often violated, thus the discontinuity produces undesired
harmonic frequencies. Consider the pure 1-Hz sine wave with 32 samples
shown in Figure .11.
As shown in the figure, if we use a window size of N = 16 samples,
which is a multiple of the two waveform cycles, the second window repeats
with continuity. However, when the window size is chosen to be 18 samples,
which is not a multiple of the waveform cycles (2.25 cycles), the second
window repeats the first window with discontinuity. It is this discontinuity that
produces harmonic frequencies that are not present in the original signal.
Figure .12 shows the spectral plots for both cases using the DFT/FFT directly.

31
Prof. Dr. Ehab
3. Spectral Estimation Using Window Functions

Figure. 11: Sampling a 1-Hz sine wave using (top) 16 samples per
32
cycle and (bottom) 18 samples per cycle. Prof. Dr. Ehab
3. Spectral Estimation Using Window Functions
The first spectral plot contains a single frequency, as we expected,
while the second spectrum has the expected frequency component plus many
harmonics, which do not exist in the original signal. We call such an effect
spectral leakage.

Figure. 12: Signal


samples and spectra
without spectral
leakage and with
spectral leakage.

33
Prof. Dr. Ehab
3. Spectral Estimation Using Window Functions
The first spectral plot contains a single frequency, as we expected,
while the second spectrum has the expected frequency component plus many
harmonics, which do not exist in the original signal. We call such an effect
spectral leakage.
The amount of spectral leakage shown in the second plot is due to
amplitude discontinuity in time domain. The bigger the discontinuity, the more
the leakage. To reduce the effect of spectral leakage, a window function can be
used whose amplitude tapers smoothly and gradually toward zero at both ends.
Applying the window function w(n) to a data sequence x(n) to obtain a
windowed sequence xw(n) is better illustrated in Figure .13 using Equation:
𝑥𝑤 (𝑛) = 𝑥 𝑛 𝑤 𝑛 , 𝑓𝑜𝑟 𝑛 = 0, 1, … , 𝑁 − 1.
The top plot is the data sequence x(n); and the middle plot is the
window function w(n): The bottom plot in Figure .13 shows that the windowed
sequence xw(n) is tapped down by a window function to zero at both ends such
that the discontinuity is dramatically reduced.
34
Prof. Dr. Ehab
3. Spectral Estimation Using Window Functions

Figure. 13: Illustration of the window operation.


35
Prof. Dr. Ehab
Example. 6:
In Figure.13 above, given:
 x(2) = 1 and w(2) = 0.2265;
 x(5) = - 0.7071 and w(5) = 0.7008,
a. Calculate the windowed sequence data points xw(2) and xw(5).
Solution:
a. Applying the window function operation leads to:
xw(2) = x(2)  w(2) = 1  0.2265 = 0.2265 and
xw(5) = x(5)  w(5) = - 0.7071  0.7008 = 0.4956,
which agree with the values shown in the bottom plot in the Figure .13. Using
the window function, the spectral plot is reproduced. As a result, spectral
leakage is greatly reduced, as shown in Figure .14.
The common window functions are listed as follows.
 The rectangular window (no window function):

36 wR(n) =1 0  n  N-1
Prof. Dr. Ehab
Example. 6:

Figure. 14: Comparison of spectra calculated without using a window


37
function and using a window function to reduce spectral leakage.
Prof. Dr. Ehab
Example. 6:
 The triangular window:
2𝑛 − 𝑁 + 1
𝑤𝑡𝑟𝑖 𝑛 = 1 − , 0 ≤ 𝑛 ≤ 𝑁 − 1.
𝑁−1
 The Hamming window:
2𝜋𝑛
𝑤ℎ𝑚 𝑛 = 0.54 − 0.46𝑐𝑜𝑠 , 0 ≤ 𝑛 ≤ 𝑁 − 1.
𝑁−1
 The Hanning window:
2𝜋𝑛
𝑤ℎ𝑛 𝑛 = 0.5 − 0.5𝑐𝑜𝑠 , 0 ≤ 𝑛 ≤ 𝑁 − 1.
𝑁−1
Plots for each window function for a size of 20 samples are shown in
Figure.15.
The following example details each step for computing the
spectral information using the window functions.
38
Prof. Dr. Ehab
Example. 6:

39
Figure. 15: Plots of window sequences.
Prof. Dr. Ehab
Example. 7:
Considering the sequence x(0)=1, x(1)=2, x(2)=3, and x(3)=4, and given
fs=100 Hz, T=0.01 seconds, compute the amplitude spectrum, phase spectrum, and
power spectrum
a. Using the triangular window function.
b. Using the Hamming window function.
Solution:
a. Since N = 4, from the triangular window function, we have:
2×0−4+1
𝑤𝑡𝑟𝑖 0 = 1 − = 0.
4−1
2×1−4+1
𝑤𝑡𝑟𝑖 1 =1− = 0.6667.
4−1
Similarly, wtri(2)=0.6667, wtri(3)=0. Next, the windowed sequence is computed as:
𝑥𝑤 0 = 𝑥 0 × 𝑤𝑡𝑟𝑖 0 = 1 × 0 = 0.
𝑥𝑤 1 = 𝑥 1 × 𝑤𝑡𝑟𝑖 1 = 2 × 0.6667 = 1.3334.
𝑥𝑤 2 = 𝑥 2 × 𝑤𝑡𝑟𝑖 2 = 3 × 0.6667 = 2.
40
𝑥𝑤 3 = 𝑥 3 × 𝑤𝑡𝑟𝑖 3 = 4 × 0 = 0.
Prof. Dr. Ehab
Example. 7:
Applying DFT Equation to xw(n) for k = 0, 1, 2, 3, respectively,
𝑋 𝑘 = 𝑥𝑤 0 𝑊4 𝑘×0 + 𝑥𝑤 1 𝑊4 𝑘×1 + 𝑥𝑤 2 𝑊4 𝑘×2 + 𝑥𝑤 3 𝑊4 𝑘×3 .
We have the following results:
X(0)=3.3334, X(1)=-2-j1.3334, X(2)=0.6666, X(3)= -2+j1.3334.
1 1
∆𝑓 = = = 25𝐻𝑧.
𝑁𝑇 4 × 0.01
Applying Equations of Ak, k, Pk, leads to:
1 −1
𝐼𝑚𝑎𝑔,𝑋 0 - −1
0
𝐴0 = 𝑋(0) = 0.8334, 𝜑0 = tan = tan = 00 ,
4 𝑅𝑒𝑎𝑙,𝑋 0 - 3.3334
1
𝑃0 = 2 𝑋(0) 2 = 0.6954.
4
Similarly,
A1= 0.6009, 1=-146.310, P1=0.3611, A2=0.1667, 2= 00, P2=0.0278,
A3=0.6009, 2= 146.310, P3=0.3611.
b. Since N = 4, from the Hamming window function, we have:
2𝜋 × 0
41 𝑤ℎ𝑚 0 = 0.54 − 0.46 cos = 0.08.
4−1 Prof. Dr. Ehab
Example. 7:
Similarly, whm(1)= 0.77, whm(2)= 0.77, whm(3)= 0.08. Next, the windowed
sequence is computed as:
𝑥𝑤 0 = 𝑥 0 × 𝑤ℎ𝑚 0 = 1 × 0.08 = 0.08.
𝑥𝑤 1 = 𝑥 1 × 𝑤ℎ𝑚 1 = 2 × 0.77 = 1.54.
𝑥𝑤 2 = 𝑥 2 × 𝑤ℎ𝑚 2 = 3 × 0.77 = 2.31.
𝑥𝑤 3 = 𝑥 3 × 𝑤ℎ𝑚 3 = 4 × 0.08 = 0.32.
Applying DFT Equation to xw(n) for k = 0, 1, 2, 3, respectively,
𝑋 𝑘 = 𝑥𝑤 0 𝑊4 𝑘×0 + 𝑥𝑤 1 𝑊4 𝑘×1 + 𝑥𝑤 2 𝑊4 𝑘×2 + 𝑥𝑤 3 𝑊4 𝑘×3 .
We yield the following:
X(0)=4.25, X(1)= -2.23-j1.22, X(2)=0.53, X(3)=-2.23+j1.22.
1 1
∆𝑓 = = = 25𝐻𝑧.
𝑁𝑇 4 × 0.01
Applying Equations of Ak, k, Pk, leads to:
A0= 1.0625, 0=00, P0=1.1289, A1= 0.6355, 1=-151.320, P1=0.4308,
A2=0.1325, 2= 00, P2=0.0176, A3=0.6335, 2= 151.320, P3=0.4308.
42
Prof. Dr. Ehab
Homework .3:
Given the sinusoid:
𝑛
𝑥 𝑛 = 2. sin 2000𝜋 .
8000
obtained by using a sampling rate of fs = 8,000 Hz, use the DFT to
compute the spectrum with the following specifications:
a. Compute the spectrum of a triangular window function with a window
size = 50.
b. Compute the spectrum of a Hamming window function with a window
size = 100.
c. Compute the spectrum of a Hanning window function with a window size
= 150 and one-sided spectrum.

43
Prof. Dr. Ehab
4. Application to Speech Spectral Estimation
The following plots show the comparisons of amplitude spectral
estimation for speech data (we.dat) with 2,001 samples and a sampling
rate of 8,000 Hz using the rectangular window (no window) function and
the Hamming window function. As demonstrated in Figure .15 (two-
sided spectrum) and Figure.16 (one-sided spectrum), there is little
difference between the amplitude spectrum using the Hamming window
function and the spectrum without using the window function. This is due
to the fact that when the data length of the sequence (e.g., 2,001 samples)
increases, the frequency resolution will be improved and spectral leakage
will become less significant. However, when data length is short,
reduction of spectral leakage using a window function will come to be
prominent.

44 Prof. Dr. Ehab


4. Application to Speech Spectral Estimation

Figure. 15: Comparison of a spectrum without using a window function and a


45 spectrum using the Hamming window for speech data. Prof. Dr. Ehab
4. Application to Speech Spectral Estimation

Figure.16: Comparison of a one-sided spectrum without using a window function


46 and a one-sided spectrum using the Hamming window for speech data.
Prof. Dr. Ehab
5. Fast Fourier Transform
Now we study FFT in detail. FFT is a very efficient algorithm in
computing DFT coefficients and can reduce a very large amount of
computational complexity (multiplications). Without loss of generality,
we consider the digital sequence x(n) consisting of 2m samples, where m is
a positive integer-the number of samples of the digital sequence x(n) is a
power of 2, N = 2, 4, 8, 16, etc. If x(n) does not contain 2m samples, then
we simply append it with zeros until the number of the appended
sequence is equal to an integer of a power of 2 data points.
In this section, we focus on two formats. One is called the
decimation-in- frequency algorithm, while the other is the decimation-in-
time algorithm. They are referred to as the radix-2 FFT algorithms. Other
types of FFT algorithms are the radix-4 and the split radix and their
advantages can be exploited.

47 Prof. Dr. Ehab


5.1 Method of Decimation-in-Frequency
We begin with the definition of DFT studied in the opening
section of this chapter as follows:
𝑁−1

𝑋 𝑘 = 𝑥 𝑛 𝑊𝑁 𝑘𝑛 , 𝑓𝑜𝑟 𝑘 = 0, 1, … , 𝑁 − 1.
𝑛=0
2𝜋
−𝑗
Where 𝑊𝑁 = 𝑒 is the twiddle factor, and N = 2, 4, 8, 16, … Equation
𝑁

above can be expanded as:


𝑋 𝑘 = 𝑥 0 + 𝑥(1) 𝑊𝑁 𝑘 + ⋯ + 𝑥 𝑁 − 1 𝑊𝑁 𝑘 𝑁−1
.
Again, if we split Equation above into:
𝑁
𝑘 𝑁 𝑘 −1
𝑋 𝑘 = 𝑥 0 + 𝑥(1) 𝑊𝑁 + ⋯ + 𝑥 − 1 𝑊𝑁 2
2
𝑁
+𝑥 𝑊𝑁 𝑘𝑁/2 + … + 𝑥 𝑁 − 1 𝑊𝑁 𝑘 𝑁−1 .
2
then we can rewrite as a sum of the following two parts:
𝑁/2 −1 𝑁−1

𝑋 𝑘 = 𝑥 𝑛 𝑊𝑁 𝑘𝑛 + 𝑥 𝑛 𝑊𝑁 𝑘𝑛 .
48 Prof. Dr. Ehab 𝑛=0 𝑛=𝑁/2
5.1 Method of Decimation-in-Frequency
Modifying the second term in Equation above yields:
𝑁/2 −1 𝑁/2 −1
𝑁
𝑋 𝑘 = 𝑥 𝑛 𝑊𝑁 𝑘𝑛 + 𝑊𝑁 (𝑁/2)𝑘 𝑥(𝑛 + ) 𝑊𝑁 𝑘𝑛 .
2
𝑛=0 𝑛=𝑁/2
2𝜋(𝑁/2)
(𝑁/2) −𝑗
Recall 𝑊𝑁 =𝑒 𝑁 = 𝑒 −𝑗𝜋 = −1; then we have:
𝑁/2 −1
𝑁
𝑋 𝑘 = 𝑘
𝑥 𝑛 + (−1) +𝑥 𝑛 + 𝑊𝑁 𝑘𝑛 .
2
𝑛=0
Now letting k=2m as an even number achieves:
𝑁/2 −1
𝑁
𝑋 2𝑚 = 𝑥 𝑛 +𝑥 𝑛+ 𝑊𝑁 2𝑛𝑚
2
𝑛=0
while substituting k = 2m+1 as an odd number yields:
𝑁/2 −1
𝑁
𝑋 2𝑚 + 1 = 𝑥 𝑛 −𝑥 𝑛+ 𝑊𝑁 𝑛 𝑊𝑁 2𝑛𝑚 .
2
49 Prof. Dr. Ehab 𝑛=0
5.1 Method of Decimation-in-Frequency
2𝜋×2 2𝜋
2 −𝑗 −𝑗
Using the fact that 𝑊𝑁 = 𝑒 𝑁 =𝑒 (𝑁/2) = 𝑊𝑁/2 , it follows that:
(𝑁/2)−1

𝑋 2𝑚 = 𝑎(𝑛) 𝑊𝑁/2 𝑚𝑛 = 𝐷𝐹𝑇*𝑎 𝑛 𝑤𝑖𝑡𝑕 𝑁/2 𝑝𝑜𝑖𝑛𝑡𝑠+


𝑛=0
(𝑁/2)−1
𝑛 𝑚𝑛 𝑛 𝑁
𝑋 2𝑚 + 1 = 𝑏(𝑛) 𝑊𝑁 𝑊𝑁/2 = 𝐷𝐹𝑇 𝑏 𝑛 𝑊𝑁 𝑤𝑖𝑡𝑕 𝑝𝑜𝑖𝑛𝑡𝑠 ,
2
𝑛=0
Where a(n) and b(n) are introduced and expressed as:
𝑁 𝑁
𝑎 𝑛 =𝑥 𝑛 +𝑥 𝑛+ , 𝑓𝑜𝑟 𝑛 = 0, 1, … , − 1.
2 2
𝑁 𝑁
𝑏 𝑛 =𝑥 𝑛 −𝑥 𝑛+ , 𝑓𝑜𝑟 𝑛 = 0, 1, … , − 1.
2 2
The last three equations can be summarized as:
𝐷𝐹𝑇*𝑎 𝑛 𝑤𝑖𝑡𝑕 𝑁/2 𝑝𝑜𝑖𝑛𝑡𝑠+
𝐷𝐹𝑇 𝑥 𝑛 𝑤𝑖𝑡𝑕 𝑁 𝑝𝑜𝑖𝑛𝑡𝑠 =
𝐷𝐹𝑇*𝑏 𝑛 𝑊𝑁 𝑛 𝑤𝑖𝑡𝑕 𝑁/2 𝑝𝑜𝑖𝑛𝑡𝑠+
50 Prof. Dr. Ehab
5.1 Method of Decimation-in-Frequency
The computation process can be illustrated in Figure .17. As shown in
this figure, there are three graphical operations, which are illustrated in Figure
.18. If we continue the process described by Figure.17, we obtain the block
diagrams shown in Figures .19 and 20.

Figure. 18: Definitions of


the graphical operations.
Figure.17: The first iteration of
the eight-point FFT.

51 Prof. Dr. Ehab


5.1 Method of Decimation-in-Frequency
Figure .20 illustrates the FFT computation for the eight-point DFT,
where there are 12 complex multiplications. This is a big saving as compared
with the eight-point DFT with 64 complex multiplications. For a data length of
N, the number of complex multiplications for DFT and FFT, respectively, are
determined by:
Complex multiplications of DFT=N2, and
Complex multiplications of FFT=N/2 log2(N).

Figure.19: The second iteration of the Figure.20: Block diagram for the eight-
eight-point FFT. point FFT (total twelve multiplications).
52 Prof. Dr. Ehab
5.1 Method of Decimation-in-Frequency
To see the effectiveness of FFT, let us consider a sequence with 1,024
data points. Applying DFT will require 1,0241,024 = 1,048,576 complex
multiplications; however, applying FFT will need only
(1,024/2)log2(1,024)=5,120 complex multiplications. Next, the index (bin
number) of the eight-point DFT coefficient X(k) becomes 0, 4, 2, 6, 1, 5, 3, and
7, respectively, which are not in the natural order. This can be fixed by index
matching. Index matching between the input sequence and the output frequency
bin number by applying reversal bits is described in Table .2.
Table .2: Index mapping for fast Fourier transform.

53 Prof. Dr. Ehab


5.1 Method of Decimation-in-Frequency
Figure .21 explains the bit reversal process. First, the input data with indices 0, 1, 2,
3, 4, 5, 6, 7 are split into two parts. The first half contains even indices—0,2, 4, 6—while the
second half contains odd indices. The first half with indices 0,2, 4, 6 at the first iteration
continues to be split into even indices 2, 4 and odd indices 4, 6, as shown in the second
iteration. The second half with indices 1, 3, 5, 7 at the first iteration is split into even indices 1,
5 and odd indices 3, 7 in the second iteration. The splitting process continues to the end at the
third iteration. The bit patterns of the output data indices are just the respective reversed bit
patterns of the input data indices. Although Figure .21 illustrates the case of an eight-point FFT,
this bit reversal process works as long as N is a power of 2.

54 Prof. Dr. Ehab


Figure.21: Bit reversal process in FFT.
5.1 Method of Decimation-in-Frequency
The inverse FFT is defined as:
𝑁−1 𝑁−1
1 1 𝑘𝑛
𝑥 𝑛 = 𝑋 𝑘 𝑊𝑁 −𝑘𝑛 = 𝑋(𝑘) 𝑊𝑁 , 𝑓𝑜𝑟 𝑘 = 0, 1, … , 𝑁 − 1.
𝑁 𝑁
𝑘=0 𝑘=0
Comparing the last equation with the DFT equation, we notice the difference as
−1
follows: The twiddle factor WN is changed to be 𝑊𝑁 = 𝑊𝑁 , and the sum is
multiplied by a factor of 1/N. Hence, by modifying the FFT block diagram as shown in
Figure .20, we achieve the inverse FFT block diagram shown in Figure .22.

55 Prof. Dr. Ehab


Figure.22: Block diagram for the inverse of eight-point FFT.
Example. 8:
Given a sequence x(n) for 0  n  3, where x(0)=1, x(1)=2, x(2)=3, and x(3)=4,
a. Evaluate its DFT X(k) using the decimation-in-frequency FFT method.
b. Determine the number of complex multiplications.
Solution:
a. Using the FFT block diagram in Figure.20, the result is shown in Figure.23.

Figure. 23: Four-point FFT block diagram in Example 8.

b. From Figure.23, the number of complex multiplications is four, which can


also be determined by:
𝑁 4
= 𝑙 𝑜𝑔2 𝑁 = 𝑙𝑜𝑔2 4 = 4.
2 2
56
Prof. Dr. Ehab
Example. 9:
Given the DFT sequence X(k) for 0  k  3 computed in Example .8,
a. Evaluate its inverse DFT x(n) using the decimation-in-frequency FFT
method.
Solution:
a. Using the inverse FFT block diagram in Figure 4.21, we have the results as
shown in figure. 24 below:

Figure. 24: Four-point inverse FFT block diagram in Example .9.

57
Prof. Dr. Ehab
5.2 Method of Decimation-in-Time
In this method, we split the input sequence x(n) into the even indexed
x(2m) and x(2m+1), each with N data points. Then the DFT equation becomes:
(𝑁/2)−1 (𝑁/2)−1

𝑋 𝑘 = 𝑥 2𝑚 𝑊𝑁 2𝑚𝑘 + 𝑥 2𝑚 + 1 𝑊𝑁 𝑘 𝑊𝑁 2𝑚𝑘 , 𝑓𝑜𝑟 𝑘 = 0, 1, … , 𝑁 − 1.


𝑚=0 𝑚=0

Using the relation 𝑊𝑁 2 = 𝑊𝑁/2 , it follows that:


(𝑁/2)−1 (𝑁/2)−1

𝑋 𝑘 = 𝑥 2𝑚 𝑊𝑁/2 𝑚𝑘 + 𝑊𝑁 𝑘 𝑥 2𝑚 + 1 𝑊𝑁/2 𝑚𝑘 , 𝑓𝑜𝑟 𝑘 = 0, 1, … , 𝑁 − 1.


𝑚=0 𝑚=0

Define new functions as:


(𝑁/2)−1

𝐺 𝑘 = 𝑥 2𝑚 𝑊𝑁/2 𝑚𝑘 = 𝐷𝐹𝑇*𝑥 2𝑚 𝑤𝑖𝑡𝑕 𝑁/2 𝑝𝑜𝑖𝑛𝑡𝑠+


𝑚=0
(𝑁/2)−1

𝐻 𝑘 = 𝑥 2𝑚 + 1 𝑊𝑁/2 𝑚𝑘 = 𝐷𝐹𝑇*𝑥 2𝑚 + 1 𝑤𝑖𝑡𝑕 𝑁/2 𝑝𝑜𝑖𝑛𝑡𝑠+


𝑚=0

58 Prof. Dr. Ehab


5.2 Method of Decimation-in-Time
Note that:
𝑁 𝑁
𝐺 𝑘 =𝐺 𝑘+ , 𝑓𝑜𝑟 𝑘 = 0, 1, … , − 1.
2 2
𝑁 𝑁
𝐻 𝑘 =𝐻 𝑘+ , 𝑓𝑜𝑟 𝑘 = 0, 1, … , − 1.
2 2
Substituting Equations above into main Equation yields the first half frequency bins:
𝑁
𝑋 𝑘 = 𝐺 𝑘 + 𝑊𝑁 𝑘 𝐻 𝑘 , 𝑓𝑜𝑟 𝑘 = 0, 1, … , − 1.
2
Considering the following fact and using equations above we have:
𝑊𝑁 (𝑁/2+𝑘) = −𝑊𝑁 𝑘 .
Then the second half of frequency bins can be computed as follows:
𝑁 𝑁
𝑋 + 𝑘 = 𝐺 𝑘 − 𝑊𝑁 𝑘 𝐻 𝑘 , 𝑓𝑜𝑟 𝑘 = 0, 1, … , − 1.
2 2
If we perform backward iterations, we can obtain the FFT algorithm. Procedure using
Equations above is illustrated in Figure .25, the block diagram for the eight-point FFT
algorithm.
From a further iteration, we obtain Figure .26. Finally, after three recursions,
we end up with the block diagram in Figure .27.

59 Prof. Dr. Ehab


5.2 Method of Decimation-in-Time

Figure.25: The first iteration. Figure.26: The Second iteration.

Prof. Dr. Ehab


Figure.27: The eight-point FFT algorithm using
60 decimation-in-time (twelve complex multiplications).
5.2 Method of Decimation-in-Time
The index for each input sequence element can be achieved by bit
reversal of the frequency index in a sequential order. Similar to the
method of decimation-in-frequency, after we change WN to 𝑊𝑁 in
Figure.27 and multiply the output sequence by a factor of 1/N, we derive
the inverse FFT block diagram for the eight-point inverse FFT in
Figure.28.

Figure.28: The eight-point IFFT using decimation-in-time.


61 Prof. Dr. Ehab
Example. 10:
Given a sequence x(n) for 0  n  3, where x(0)=1, x(1)=2, x(2)=3, and
x(3)=4,
a. Evaluate its DFT X(k) using the decimation-in-time FFT method.

Solution:
a. Using the block diagram in Figure.27 leads to:

Figure.29: The four-point FFT using decimation in time.

62
Prof. Dr. Ehab
Example. 11:
Given the DFT sequence X(k) for 0 ≤ k  3 computed in Example .10,
a. Evaluate its inverse DFT x(n) using the decimation-in-time FFT method.

Solution:
a. Using the block diagram in Figure .28 yields

Figure.30: The four-point IFFT using decimation in time.

63
Prof. Dr. Ehab
6. Summary
1. The Fourier series coefficients for a periodic digital signal can be used to
develop the DFT.
2. The DFT transforms a time sequence to the complex DFT coefficients,
while the inverse DFT transforms DFT coefficients back to the time
sequence.
3. The frequency bin number is the same as the frequency index. Frequency
resolution is the frequency spacing between two consecutive frequency
indices (two consecutive spectrum components).
4. The DFT coefficients for a given digital signal are applied for computing
the amplitude spectrum, power spectrum, or phase spectrum.
5. The spectrum calculated from all the DFT coefficients represents the signal
frequency range from 0 Hz to the sampling rate. The spectrum beyond the
folding frequency is equivalent to the negative-indexed spectrum from the
negative folding frequency to 0 Hz. This two-sided spectrum can be
converted into a one-sided spectrum by doubling alternating- current (AC)
components from 0 Hz to the folding frequency and retaining the DC
component as it is.

64 Prof. Dr. Ehab


6. Summary
6. To reduce the burden of computing DFT coefficients, the FFT
algorithm is used, which requires the data length to be a power of 2.
Sometimes zero padding is employed to make up the data length.
Zero padding actually does interpolation of the spectrum and does
not carry any new information about the signal; even the calculated
frequency resolution is smaller due to the zero padded longer length.
7. Applying the window function to the data sequence before DFT
reduces the spectral leakage due to abrupt truncation of the data
sequence when performing spectral calculation for a short sequence.
8. Two radix-2 FFT algorithms—decimation-in-frequency and
decimation in- time—are developed via the graphical illustrations.

65 Prof. Dr. Ehab

You might also like