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

Discrete Fourier Transform (DFT) : DFT Transforms The Time Domain Signal Samples To The Frequency Domain Components

The document discusses the discrete Fourier transform (DFT) and its applications. The key points are: 1) DFT transforms time domain signal samples into frequency domain components, representing the signal as a sum of sinusoids of different frequencies. 2) DFT is often used to perform frequency analysis of time domain signals. It decomposes signals into sinusoids, showing the frequencies present and their amplitudes. 3) MATLAB functions like FFT provide fast and efficient methods to compute the DFT and obtain the frequency spectrum of digital signals. Examples demonstrate how to apply DFT and FFT to analyze signals.

Uploaded by

Randy Sofyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
149 views

Discrete Fourier Transform (DFT) : DFT Transforms The Time Domain Signal Samples To The Frequency Domain Components

The document discusses the discrete Fourier transform (DFT) and its applications. The key points are: 1) DFT transforms time domain signal samples into frequency domain components, representing the signal as a sum of sinusoids of different frequencies. 2) DFT is often used to perform frequency analysis of time domain signals. It decomposes signals into sinusoids, showing the frequencies present and their amplitudes. 3) MATLAB functions like FFT provide fast and efficient methods to compute the DFT and obtain the frequency spectrum of digital signals. Examples demonstrate how to apply DFT and FFT to analyze signals.

Uploaded by

Randy Sofyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Discrete Fourier Transform (DFT)

DFT transforms the time domain signal samples to the


frequency domain components.
Amplitude

Amplitude
Signal
DFT Spectrum

Time Frequency

DFT is often used to do frequency analysis of a time domain signal.

CEN352, Dr. Ghulam Muhammad,


1
King Saud University
Four Types of Fourier Transform

CEN352, Dr. Ghulam Muhammad,


2
King Saud University
DFT: Graphical Example

1000 Hz sinusoid with


32 samples at 8000 Hz
sampling rate.

DFT
Sampling rate
8000 samples = 1 second
32 samples = 32/8000 sec
= 4 millisecond

Frequency
1 second = 1000 cycles
32/8000 sec =
(1000*32/8000=) 4 cycles
CEN352, Dr. Ghulam Muhammad,
3
King Saud University
DFT Coefficients of Periodic Signals

Periodic
Digital
Signal

Equation of DFT coefficients:

CEN352, Dr. Ghulam Muhammad,


4
King Saud University
DFT Coefficients of Periodic Signals

Fourier series coefficient ck is periodic of N

Copy

Amplitude
spectrum of the
periodic digital
signal

CEN352, Dr. Ghulam Muhammad,


5
King Saud University
Example 1
The periodic signal: is sampled at

Solution: Fundamental frequency


a. We match x(t )  sin(2t ) with x(t )  sin(2ft ) and get f = 1 Hz.

Therefore the signal has 1 cycle or 1 period in 1 second.

Sampling rate fs = 4 Hz 1 second has 4 samples.

Hence, there are 4 samples in 1 period for this particular signal.


Sampled signal

CEN352, Dr. Ghulam Muhammad,


6
King Saud University
Example 1 – contd. (1)

b.

CEN352, Dr. Ghulam Muhammad,


7
King Saud University
Example 1 – contd. (2)

CEN352, Dr. Ghulam Muhammad,


8
King Saud University
On the Way to DFT Formulas

Imagine periodicity of
N samples.

Take first N samples


(index 0 to N -1) as
the input to DFT.

CEN352, Dr. Ghulam Muhammad,


9
King Saud University
DFT Formulas

Where,

Inverse DFT:

CEN352, Dr. Ghulam Muhammad,


10
King Saud University
MATLAB Functions

FFT: Fast Fourier Transform

CEN352, Dr. Ghulam Muhammad,


11
King Saud University
Example 2

Solution:

CEN352, Dr. Ghulam Muhammad,


12
King Saud University
Example 2 – contd.

Using MATLAB,

CEN352, Dr. Ghulam Muhammad,


13
King Saud University
Example 3
Inverse DFT of the previous example.

CEN352, Dr. Ghulam Muhammad,


14
King Saud University
Example 3 – contd.

Using MATLAB,

CEN352, Dr. Ghulam Muhammad,


15
King Saud University
Relationship Between Frequency Bin k
and Its Associated Frequency in Hz

Frequency step or frequency resolution:

Example 4
In the previous example, if the sampling rate is 10 Hz,

CEN352, Dr. Ghulam Muhammad,


16
King Saud University
Example 4 – contd.
a.
Sampling period:

For x(3), time index is n = 3, and sampling time instant is

f

b.
Frequency resolution:        
k

Frequency bin number for X(1) is k = 1,


and its corresponding frequency is

Similarly, for X(3) is k = 3, and its


corresponding frequency is

CEN352, Dr. Ghulam Muhammad,


17
King Saud University
Amplitude and Power Spectrum

Since each calculated DFT coefficient is a complex number, it is not convenient


to plot it versus its frequency index

Amplitude Spectrum:

To find one-sided amplitude spectrum, we double the amplitude.

CEN352, Dr. Ghulam Muhammad,


18
King Saud University
Amplitude and Power Spectrum –contd.

Power Spectrum:

For, one-sided power spectrum:

Phase Spectrum:

CEN352, Dr. Ghulam Muhammad,


19
King Saud University
Example 5

Solution:

See Example 2.

CEN352, Dr. Ghulam Muhammad,


20
King Saud University
Example 5 – contd. (1)

CEN352, Dr. Ghulam Muhammad,


21
King Saud University
Example 5 – contd. (2)

Amplitude Spectrum Phase Spectrum

One sided Amplitude Spectrum


Power Spectrum CEN352, Dr. Ghulam Muhammad,
22
King Saud University
Example 6

Solution:

CEN352, Dr. Ghulam Muhammad,


23
King Saud University
Zero Padding for FFT
FFT: Fast Fourier Transform.
A fast version of DFT; It requires signal length to be power of 2.

Therefore, we
need to pad zero
at the end of the
signal.

However, it does
not add any new
information.

CEN352, Dr. Ghulam Muhammad,


24
King Saud University
Example 7
Consider a digital signal has sampling rate = 10 kHz. For amplitude spectrum we
need frequency resolution of less than 0.5 Hz. For FFT how many data points are
needed?

Solution:

For FFT, we need N to be power of 2.

214 = 16384 < 20000 And 215 = 32768 > 20000

Recalculated frequency resolution,

CEN352, Dr. Ghulam Muhammad,


25
King Saud University
MATLAB Example - 1

fs

xf = abs(fft(x))/N; %Compute the amplitude spectrum

CEN352, Dr. Ghulam Muhammad,


26
King Saud University
MATLAB Example – contd. (1)

CEN352, Dr. Ghulam Muhammad,


27
King Saud University
MATLAB Example – contd. (2)

CEN352, Dr. Ghulam Muhammad,


28
King Saud University
MATLAB Example – contd. (3)

………..
CEN352, Dr. Ghulam Muhammad,
29
King Saud University
Effect of Window Size

When applying DFT, we assume the following:

1. Sampled data are periodic to themselves (repeat).

2. Sampled data are continuous to themselves and band limited to


the folding frequency.

1 Hz sinusoid,
with 32
samples

CEN352, Dr. Ghulam Muhammad,


30
King Saud University
Effect of Window Size –contd. (1)

If the window size is not multiple of waveform cycles:

Discontinuous

CEN352, Dr. Ghulam Muhammad,


31
King Saud University
Effect of Window Size –contd. (2)
2- cycles Mirror Image

Produces
single
frequency

Produces many
harmonics as well.

Spectral
Leakage

The bigger the


CEN352, Dr. Ghulam Muhammad,
discontinuity, the more
32
King Saud University the leakage
Reducing Leakage Using Window

To reduce the effect of spectral leakage, a window function can be used


whose amplitude tapers smoothly and gradually toward zero at both ends.

Window function, w(n)


Data sequence, x(n)
Obtained windowed sequence, xw(n)
CEN352, Dr. Ghulam Muhammad,
33
King Saud University
Example 8
Given,

Calculate,

CEN352, Dr. Ghulam Muhammad,


34
King Saud University
Different Types of Windows

Rectangular Window (no window):

Triangular Window:

Hamming Window:

Hanning Window:

CEN352, Dr. Ghulam Muhammad,


35
King Saud University
Different Types of Windows –contd.
Window size of 20 samples

CEN352, Dr. Ghulam Muhammad,


36
King Saud University
Example 9
Problem:

Solution:
Since N = 4, Hamming window function can be found as:

CEN352, Dr. Ghulam Muhammad,


37
King Saud University
Example 9 – contd. (1)
Windowed sequence:

DFT Sequence:

CEN352, Dr. Ghulam Muhammad,


38
King Saud University
Example 9 – contd. (2)

CEN352, Dr. Ghulam Muhammad,


39
King Saud University
MATLAB Example - 2

CEN352, Dr. Ghulam Muhammad,


40
King Saud University
MATLAB Example – 2 contd.

CEN352, Dr. Ghulam Muhammad,


41
King Saud University
DFT Matrix

Frequency Spectrum Multiplication Matrix Time-Domain samples

CEN352, Dr. Ghulam Muhammad,


42
King Saud University
DFT Matrix
Let,

Then

DFT equation:

DFT requires N2 complex multiplications.

CEN352, Dr. Ghulam Muhammad,


43
King Saud University
FFT
FFT: Fast Fourier Transform

A very efficient algorithm to compute DFT; it requires less multiplication.

The length of input signal, x(n) must be 2m samples, where m is an integer.

Samples N = 2, 4, 8, 16 or so.

If the input length is not 2m, append (pad) zeros to make it 2m.

4 5 1 7 1 4 5 1 7 1 0 0 0
N=5 N = 8, power of 2

CEN352, Dr. Ghulam Muhammad,


44
King Saud University
DFT to FFT: Decimation in Frequency
DFT:

CEN352, Dr. Ghulam Muhammad,


45
King Saud University
DFT to FFT: Decimation in Frequency
Now decompose into even (k = 2m) and odd (k = 2m+1) sequences.

CEN352, Dr. Ghulam Muhammad,


46
King Saud University
DFT to FFT: Decimation in Frequency

CEN352, Dr. Ghulam Muhammad,


47
King Saud University
DFT to FFT: Decimation in Frequency

12 complex
multiplication

CEN352, Dr. Ghulam Muhammad,


48
King Saud University
DFT to FFT: Decimation in Frequency

For 1024 samples data sequence,


DFT requires 1024×1024 =
1048576 complex multiplications.
FFT requires (1024/2)log(1024) =
5120 complex multiplications.
CEN352, Dr. Ghulam Muhammad,
49
King Saud University
IFFT: Inverse FFT

CEN352, Dr. Ghulam Muhammad,


50
King Saud University
FFT and IFFT Examples

FFT

Number of complex multiplication =

IFFT

CEN352, Dr. Ghulam Muhammad,


51
King Saud University
DFT to FFT: Decimation in Time
Split the input sequence x(n) into the even indexed x(2m) and x(2m + 1),
each with N/2 data points.

Using

CEN352, Dr. Ghulam Muhammad,


52
King Saud University
DFT to FFT: Decimation in Time

As,

CEN352, Dr. Ghulam Muhammad,


53
King Saud University
DFT to FFT: Decimation in Time

First iteration:

Second iteration:

CEN352, Dr. Ghulam Muhammad,


54
King Saud University
DFT to FFT: Decimation in Time

Third iteration:

2
  2   2  
2 2


WN  e N
 cos   j sin  W e
2 8
e 2
 cos( / 2)  j sin( / 2)   j
 N   N  8

IFFT

CEN352, Dr. Ghulam Muhammad,


55
King Saud University
FFT and IFFT Examples

FFT

IFFT

CEN352, Dr. Ghulam Muhammad,


56
King Saud University
Fourier Transform Properties (1)
FT is linear:
• Homogeneity
• Additivity

Homogeneity:
DFT
x[] X[]
DFT
kx[] kX[]

Frequency is not
changed.

CEN352, Dr. Ghulam Muhammad,


57
King Saud University
Fourier Transform Properties (2)

Additivity

If : x1[n]  x2 [n]  x3 [n]


Then : Re X 1[ f ]  Re X 2 [ f ]  Re X 3 [ f ]
and Im X 1[ f ]  Im X 2 [ f ]  Im X 3 [ f ]

CEN352, Dr. Ghulam Muhammad,


58
King Saud University
Fourier Transform Pairs
Delta Function Pairs
in Polar Form

Delta Function

Shifted Delta Function

Same Magnitude,
Different Phase

Shifted Delta Function

CEN352, Dr. Ghulam Muhammad,


59
King Saud University

You might also like