Beirut Arab University
Computer Engineering Program
Spring 2015
Digital Signal Processing (COME 384)
Instructor: Prof. Dr. Hamed Nassar
Fast Fourier Transforms FFT
 Textbook:
◦ V. Ingle and J. Proakis, Digital Signal Processing
Using MATLAB 3rd Ed, Cengage Learning, 2012
1
Dr. Hamed Nassar, Beirut Arab Univ
DSP Windows
 .
Prof. H. Nassar, BAU
DSP Windows
 .
Prof. H. Nassar, BAU
DSP Windows MATLAB code
 n=0:9 %stem ten samples
 RectWin=ones(1,10)
 sub1=subplot(4,1,1); stem(n, RectWin);grid
 title('Rectangular Window');
 TriWin=1-abs(length(n)-1-2*n)/(length(n)-1)
 sub2=subplot(4,1,2); stem(n, TriWin);grid
 title('Triangular Window');
 HannWin=0.5-0.5*cos(2*pi*n/(length(n)-1)))
 sub3=subplot(4,1,3); stem(n, HannWin);grid
 title('Hanning Window');
 HammWin=0.54-0.46*cos(2*pi*n/(length(n)-1))
 sub4=subplot(4,1,4); stem(n, HammWin);grid
 title('Hamming Window');
 linkaxes([sub1,sub2,sub3,sub4], 'y')%Use same y scale for
all subs Prof. H. Nassar, BAU
Constructing an infinite, periodic sequence from a finite
one, and vv
 .
Prof. H. Nassar, BAU
Circular Shift Example: 4 left
 .
Prof. H. Nassar, BAU
Circular convolution
 A linear convolution between two N-point sequences
results in a longer sequence (length=N+N-1, with indices:
0, 1, …, 2N-2).
 But we have to restrict our interval to 0 ≤ n ≤ N − 1,
therefore instead of linear shift, we should consider the
circular shift.
 A convolution operation that contains a circular shift, as
shown below, is called the circular convolution and is
given by
Prof. H. Nassar, BAU
Circular Convolution Example: Time domain approach (watch for circular
folding)
 .
Prof. H. Nassar, BAU
Circular Convolution Example: Frequency domain approach
 .
Prof. H. Nassar, BAU
FFT
 The DFT introduced earlier is the only transform that is
discrete in both the time and the frequency domains, and
is defined for finite-duration sequences.
 Although it is a computable transform, its straightforward
computation is very inefficient, especially when the
sequence length N is large.
 In 1965 Cooley and Tukey showed a procedure to
substantially reduce the amount of computations involved
in the DFT.
 This led to the explosion of other efficient algorithms
collectively known as fast Fourier transform (FFT)
algorithms.
 We will study one such algorithms in detail.
 One concept used that the book does not speak about
explicitly, but it is there (seen the previous example on
circular convolution) is circular folding.
Prof. H. Nassar, BAU
FFT
 .
Prof. H. Nassar, BAU
Example
 .
Prof. H. Nassar, BAU
)
 .
Prof. H. Nassar, BAU
Divide and Conquer Algorithm
 .
Prof. H. Nassar, BAU
Implementation
 .
Prof. H. Nassar, BAU
Implementation
 .
Prof. H. Nassar, BAU
EXAMPLE 5.21 N = 15, L = 3, M =5
 .
Prof. H. Nassar, BAU
EXAMPLE 5.21 N = 15, L = 3, M =5
 .
Prof. H. Nassar, BAU
EXAMPLE 5.21 N = 15, L = 3, M =5
 .
Prof. H. Nassar, BAU
Reminder: Classical DFT MATLAB
script
 % This is a DFT program without loops
 clear all; %Write input sequence below
 nx=0:5; x=[0 1 7 3 1 2] %index vector nx, then input signal
x
 N=length(x);
 wN=exp(-2j*pi/N) %Base
 E=[0:N-1]' *[0:N-1] %Prepare structure of matrix W
 W=wN.^E %Matrix W=Base^Matrix (note the dot .)
 Y=x*W %DFT = input sequence * Matrix
 %To test, we'll obtain x(n=2)=1/N sum_k=0^N-1 Y
e^(j*2*pi*n*k)
 n=2
 k=nx;
 g=exp(2j*pi*n*k/N)
 G=1/N*(Y*g.') Prof. H. Nassar, BAU
FFT Example: N = 6, M=4, L=2
 x = {3, 1, 0, 2, 4, 1,3, 2} => x = {3, 1, 0, 2, 4, 1, 3, 2}
 This has DFT: 10.0, 0.5-2.6i, 2.5+2.6i, 2.0, 2.5-2.6i,
0.5+2.6i
 Always remember that:
◦ the 1D input vector x is first converted (reshaped) into a
row-major matrix xm of size LxM
◦ the corresponding output DFT vector X is obtained as a
column-major matrix X of size LxM, and thus has to be
converted (reshaped) back into a 1D vector.
◦ The best summary of the Divide and Conquer FFT algo:
Prof. H. Nassar, BAU
 clear all; % FFT using Divide & Conquer without loops
 x =[3 1 0 2 4 1 3 2];L=2;M=4; %%Write input sequence and your choice for L and M
 N=length(x)%N can be obtained auto, but M,L u should spec
 x=reshape(x, [L,M]) %Create an LxM matrix (col maj) from x
 wM=exp(-2j*pi/M) %Base M
 EM=[0:M-1]' *[0:M-1]%Prepare structure of matrix W: MxM
 WM=wM.^EM %Raise elements (note .) of Matrix to Base
 WLMF=x*WM %Obtain F matrix
 wN=exp(-2j*pi/N) %Base N
 ELM=[0:L-1]'*[0:M-1] %Prepare structure of twiddle matrix:LxM
 WLMT=wN.^ELM %Twiddle: Raise elements (.) of Matrix to Base
 WLMG=WLMF.*WLMT %Modify elements (note .) of F by Twiddle
 wL=exp(-2j*pi/L) %Base L
 EL=[0:L-1]'*[0:L-1] %Prepare structure of matrix W:LxL
 WL=wL.^EL %Raise elements (note .) of Matrix to Base
 X=WL*WLMG %Final DFT
 %To test, obtain x(n)=1/N sum_k=0^N-1 Y e^(j*2*pi*n*k) for some n
 n=6; k=0:N-1; %MATLAB: u involve vec in an op, u get vec
 XX=[X(1,:) X(2,:)] %Unfold matrix into a vector
 g=exp(2j*pi*n*k/N) %Note in IDFT sign of e is +ve
 G=1/N*(XX*g.') %IDFT for the given n. We could obtain whole x
Prof. H. Nassar, BAU
5
 )
Prof. H. Nassar, BAU

More Related Content

PPTX
DSP_DiscSignals_LinearS_150417.pptx
PDF
A novel architecture of rns based
PPTX
DSP_Fourier_160301.pptx
PDF
Numerical differentation with c
PPTX
DSP_Filters_150505.pptx
PPTX
Dsp GA (1).pptx
PDF
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
PDF
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
DSP_DiscSignals_LinearS_150417.pptx
A novel architecture of rns based
DSP_Fourier_160301.pptx
Numerical differentation with c
DSP_Filters_150505.pptx
Dsp GA (1).pptx
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE

Similar to DSP_FFT_150525.pptx (20)

PDF
Dycops2019
PDF
c5.pdf
PDF
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
PDF
c5.pdf
PPT
Multi-Layer Perceptrons
DOCX
EBDSS Max Research Report - Final
PDF
TENSOR DECOMPOSITION WITH PYTHON
PDF
A numerical method to solve fractional Fredholm-Volterra integro-differential...
PDF
Text file encryption using fft technique in lab view 8.6
PDF
Text file encryption using fft technique in lab view 8.6
PPT
Basics of edge detection and forier transform
PDF
Incremental and Multi-feature Tensor Subspace Learning applied for Background...
PPTX
Digital signal processing parti cularly filter design ppt
PPTX
IV-05 Polyphase FIlters Revised.pptdfgdb cbx
PPTX
Introduction to TreeNet (2004)
PDF
SURF 2012 Final Report(1)
PDF
Master Thesis on Rotating Cryostats and FFT, DRAFT VERSION
PDF
ENGINEERING SYSTEM DYNAMICS-TAKE HOME ASSIGNMENT 2018
PDF
RES701 Research Methodology_FFT
Dycops2019
c5.pdf
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
c5.pdf
Multi-Layer Perceptrons
EBDSS Max Research Report - Final
TENSOR DECOMPOSITION WITH PYTHON
A numerical method to solve fractional Fredholm-Volterra integro-differential...
Text file encryption using fft technique in lab view 8.6
Text file encryption using fft technique in lab view 8.6
Basics of edge detection and forier transform
Incremental and Multi-feature Tensor Subspace Learning applied for Background...
Digital signal processing parti cularly filter design ppt
IV-05 Polyphase FIlters Revised.pptdfgdb cbx
Introduction to TreeNet (2004)
SURF 2012 Final Report(1)
Master Thesis on Rotating Cryostats and FFT, DRAFT VERSION
ENGINEERING SYSTEM DYNAMICS-TAKE HOME ASSIGNMENT 2018
RES701 Research Methodology_FFT
Ad

Recently uploaded (20)

PPTX
ai_satellite_crop_management_20250815030350.pptx
PDF
Design Guidelines and solutions for Plastics parts
PPTX
Petroleum Refining & Petrochemicals.pptx
PDF
20250617 - IR - Global Guide for HR - 51 pages.pdf
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PPTX
Module 8- Technological and Communication Skills.pptx
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
First part_B-Image Processing - 1 of 2).pdf
PDF
Computer System Architecture 3rd Edition-M Morris Mano.pdf
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PPTX
wireless networks, mobile computing.pptx
PPTX
Measurement Uncertainty and Measurement System analysis
PPTX
Amdahl’s law is explained in the above power point presentations
PDF
Soil Improvement Techniques Note - Rabbi
PDF
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
PPTX
Feature types and data preprocessing steps
PDF
August -2025_Top10 Read_Articles_ijait.pdf
PDF
Computer organization and architecuture Digital Notes....pdf
PPTX
Principal presentation for NAAC (1).pptx
PDF
Applications of Equal_Area_Criterion.pdf
ai_satellite_crop_management_20250815030350.pptx
Design Guidelines and solutions for Plastics parts
Petroleum Refining & Petrochemicals.pptx
20250617 - IR - Global Guide for HR - 51 pages.pdf
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
Module 8- Technological and Communication Skills.pptx
Exploratory_Data_Analysis_Fundamentals.pdf
First part_B-Image Processing - 1 of 2).pdf
Computer System Architecture 3rd Edition-M Morris Mano.pdf
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
wireless networks, mobile computing.pptx
Measurement Uncertainty and Measurement System analysis
Amdahl’s law is explained in the above power point presentations
Soil Improvement Techniques Note - Rabbi
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
Feature types and data preprocessing steps
August -2025_Top10 Read_Articles_ijait.pdf
Computer organization and architecuture Digital Notes....pdf
Principal presentation for NAAC (1).pptx
Applications of Equal_Area_Criterion.pdf
Ad

DSP_FFT_150525.pptx

  • 1. Beirut Arab University Computer Engineering Program Spring 2015 Digital Signal Processing (COME 384) Instructor: Prof. Dr. Hamed Nassar Fast Fourier Transforms FFT  Textbook: ◦ V. Ingle and J. Proakis, Digital Signal Processing Using MATLAB 3rd Ed, Cengage Learning, 2012 1 Dr. Hamed Nassar, Beirut Arab Univ
  • 2. DSP Windows  . Prof. H. Nassar, BAU
  • 3. DSP Windows  . Prof. H. Nassar, BAU
  • 4. DSP Windows MATLAB code  n=0:9 %stem ten samples  RectWin=ones(1,10)  sub1=subplot(4,1,1); stem(n, RectWin);grid  title('Rectangular Window');  TriWin=1-abs(length(n)-1-2*n)/(length(n)-1)  sub2=subplot(4,1,2); stem(n, TriWin);grid  title('Triangular Window');  HannWin=0.5-0.5*cos(2*pi*n/(length(n)-1)))  sub3=subplot(4,1,3); stem(n, HannWin);grid  title('Hanning Window');  HammWin=0.54-0.46*cos(2*pi*n/(length(n)-1))  sub4=subplot(4,1,4); stem(n, HammWin);grid  title('Hamming Window');  linkaxes([sub1,sub2,sub3,sub4], 'y')%Use same y scale for all subs Prof. H. Nassar, BAU
  • 5. Constructing an infinite, periodic sequence from a finite one, and vv  . Prof. H. Nassar, BAU
  • 6. Circular Shift Example: 4 left  . Prof. H. Nassar, BAU
  • 7. Circular convolution  A linear convolution between two N-point sequences results in a longer sequence (length=N+N-1, with indices: 0, 1, …, 2N-2).  But we have to restrict our interval to 0 ≤ n ≤ N − 1, therefore instead of linear shift, we should consider the circular shift.  A convolution operation that contains a circular shift, as shown below, is called the circular convolution and is given by Prof. H. Nassar, BAU
  • 8. Circular Convolution Example: Time domain approach (watch for circular folding)  . Prof. H. Nassar, BAU
  • 9. Circular Convolution Example: Frequency domain approach  . Prof. H. Nassar, BAU
  • 10. FFT  The DFT introduced earlier is the only transform that is discrete in both the time and the frequency domains, and is defined for finite-duration sequences.  Although it is a computable transform, its straightforward computation is very inefficient, especially when the sequence length N is large.  In 1965 Cooley and Tukey showed a procedure to substantially reduce the amount of computations involved in the DFT.  This led to the explosion of other efficient algorithms collectively known as fast Fourier transform (FFT) algorithms.  We will study one such algorithms in detail.  One concept used that the book does not speak about explicitly, but it is there (seen the previous example on circular convolution) is circular folding. Prof. H. Nassar, BAU
  • 11. FFT  . Prof. H. Nassar, BAU
  • 12. Example  . Prof. H. Nassar, BAU
  • 13. )  . Prof. H. Nassar, BAU
  • 14. Divide and Conquer Algorithm  . Prof. H. Nassar, BAU
  • 17. EXAMPLE 5.21 N = 15, L = 3, M =5  . Prof. H. Nassar, BAU
  • 18. EXAMPLE 5.21 N = 15, L = 3, M =5  . Prof. H. Nassar, BAU
  • 19. EXAMPLE 5.21 N = 15, L = 3, M =5  . Prof. H. Nassar, BAU
  • 20. Reminder: Classical DFT MATLAB script  % This is a DFT program without loops  clear all; %Write input sequence below  nx=0:5; x=[0 1 7 3 1 2] %index vector nx, then input signal x  N=length(x);  wN=exp(-2j*pi/N) %Base  E=[0:N-1]' *[0:N-1] %Prepare structure of matrix W  W=wN.^E %Matrix W=Base^Matrix (note the dot .)  Y=x*W %DFT = input sequence * Matrix  %To test, we'll obtain x(n=2)=1/N sum_k=0^N-1 Y e^(j*2*pi*n*k)  n=2  k=nx;  g=exp(2j*pi*n*k/N)  G=1/N*(Y*g.') Prof. H. Nassar, BAU
  • 21. FFT Example: N = 6, M=4, L=2  x = {3, 1, 0, 2, 4, 1,3, 2} => x = {3, 1, 0, 2, 4, 1, 3, 2}  This has DFT: 10.0, 0.5-2.6i, 2.5+2.6i, 2.0, 2.5-2.6i, 0.5+2.6i  Always remember that: ◦ the 1D input vector x is first converted (reshaped) into a row-major matrix xm of size LxM ◦ the corresponding output DFT vector X is obtained as a column-major matrix X of size LxM, and thus has to be converted (reshaped) back into a 1D vector. ◦ The best summary of the Divide and Conquer FFT algo: Prof. H. Nassar, BAU
  • 22.  clear all; % FFT using Divide & Conquer without loops  x =[3 1 0 2 4 1 3 2];L=2;M=4; %%Write input sequence and your choice for L and M  N=length(x)%N can be obtained auto, but M,L u should spec  x=reshape(x, [L,M]) %Create an LxM matrix (col maj) from x  wM=exp(-2j*pi/M) %Base M  EM=[0:M-1]' *[0:M-1]%Prepare structure of matrix W: MxM  WM=wM.^EM %Raise elements (note .) of Matrix to Base  WLMF=x*WM %Obtain F matrix  wN=exp(-2j*pi/N) %Base N  ELM=[0:L-1]'*[0:M-1] %Prepare structure of twiddle matrix:LxM  WLMT=wN.^ELM %Twiddle: Raise elements (.) of Matrix to Base  WLMG=WLMF.*WLMT %Modify elements (note .) of F by Twiddle  wL=exp(-2j*pi/L) %Base L  EL=[0:L-1]'*[0:L-1] %Prepare structure of matrix W:LxL  WL=wL.^EL %Raise elements (note .) of Matrix to Base  X=WL*WLMG %Final DFT  %To test, obtain x(n)=1/N sum_k=0^N-1 Y e^(j*2*pi*n*k) for some n  n=6; k=0:N-1; %MATLAB: u involve vec in an op, u get vec  XX=[X(1,:) X(2,:)] %Unfold matrix into a vector  g=exp(2j*pi*n*k/N) %Note in IDFT sign of e is +ve  G=1/N*(XX*g.') %IDFT for the given n. We could obtain whole x Prof. H. Nassar, BAU
  • 23. 5  ) Prof. H. Nassar, BAU