0% found this document useful (0 votes)
4 views6 pages

Exp 5

The document outlines an experiment on the Divide and Conquer approach for computing the Discrete Fourier Transform (DFT) using MATLAB, conducted by a student at Rajshahi University of Engineering & Technology. It details the objectives, theoretical background, algorithm steps, MATLAB code, and results, highlighting the efficiency of the divide and conquer method compared to direct DFT computation. The experiment demonstrates a significant reduction in computational complexity, saving 210 operations when using the divide and conquer approach.
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)
4 views6 pages

Exp 5

The document outlines an experiment on the Divide and Conquer approach for computing the Discrete Fourier Transform (DFT) using MATLAB, conducted by a student at Rajshahi University of Engineering & Technology. It details the objectives, theoretical background, algorithm steps, MATLAB code, and results, highlighting the efficiency of the divide and conquer method compared to direct DFT computation. The experiment demonstrates a significant reduction in computational complexity, saving 210 operations when using the divide and conquer approach.
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/ 6

“Heaven’s light is our Guide”

Rajshahi University of Engineering & Technology

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING

Course Title : Digital Signal Processing Sessional.


Course No : EEE 4108
Experiment No : 05
Name of the Experiment : Experimental Study of Divide and Conquer
Approach to Computation of the DFT using
MATLAB
Date of Experiment : 08 May, 2024.
Date of Submission : 05 June, 2024

Submitted by Submitted to

Name : Mostafezur Rahman Md. Nuhi-Alamin

Roll : 1901147 Assistant Professor

Section :C Department of EEE

Year : 4th year Odd sem Rajshahi University of Engineering &


Technology
Experiment No:05

Experiment name: Experimental Study of Divide and Conquer Approach to Computation


of the DFT using MATLAB

Objectives:

➢ To know about the DFT and IDFT.


➢ Analyze the computational complexity of direct DFT.
➢ Observation of a simpler algorithm called divide and conquer approach to
compute DFT.
➢ Analyze the computational complexity of the method.
➢ Comparison between the two methods.

Theory:

The DFT is one of the most powerful tools in digital signal processing which enables us to
find the spectrum of a finite-duration signal.

The standard equations which define how the Discrete Fourier Transform and the Inverse
convert a signal from the time domain to the frequency domain and vice versa are as
follows:
𝑗2𝜋𝑘𝑛

DFT: 𝑋(𝐾) = ∑𝑁−1
𝑛=0 𝑥 (𝑛)𝑒 𝑁 for k=0, 1, 2….., N-1
𝑗2𝜋𝑘𝑛
IDFT: 𝑥 (𝑛) = ∑𝑁−1
𝑘=0 𝑋 (𝐾 )𝑒 𝑁 for n=0, 1, 2….., N-1

If we want to compute 8 point DFT we need 64 complex multiplications and 56 complex


additions.

In divide and conquer approach the input sequence is mapped into two-dimensional array.
The main focus of this approach is to reduce computational complexity for this reason the
whole problem is divided into few subproblems and then solved the problems and then
recombined the result. If N input elements then number of row and column will be L, M.
where, N=LM

x(l, m)= l is row index and m is column index

0 1 ------------ M-1
0 x(0,0) x(0,1) ----------- x(0,M-1)
1 x(1,0) x(1,1) ------------ x(1,M-1)
----- --------- --------- ----------- ----------
L-1 x(L-1,0) x(L-1,1) ----------- x(L-1,M-1)

In case of row wise mapping,


n= Ml+m
In case of column wise mapping,
n=l+Lm
so X(k), 0 ≤ k ≤ N-1, one dimensional array represented as X(p,q), 0 ≤ p≤ L-1, 0 ≤ q ≤
M-1 as an two dimensional array indexed by p and q.

Here the symmetry and periodicity property of twiddle factor is used.


𝑁
𝑘+
Symmetry property: 𝑊𝑁 2
= −𝑊𝑁𝑘

Periodicity Property: 𝑊𝑁𝑘+𝑁 = 𝑊𝑁𝑘


The DFT equations can be expressed,
(𝑀𝑝+𝑞)(𝑙+𝑚𝐿)
𝑋 (𝑝, 𝑞) = ∑𝑀−1 𝐿−1
𝑚=0 ∑𝑛=0 𝑥 (𝑙, 𝑚 )𝑊𝑁

Using properties of twiddle factor, the equations can be simplified,


𝐿−1 𝑀−1
𝑙𝑞 𝑚𝑞 𝑝𝑙
𝑋 (𝑝, 𝑞) = ∑{𝑊𝑁 [ ∑ 𝑥(𝑙, 𝑚)𝑊𝑀 ]} 𝑊𝐿
𝑙=0 𝑚

Algorithm:

Step I: Compute M point DFTs for each row l=0, 1, 2....L-1


𝑚𝑞
𝐹 (𝑙, 𝑞) = ∑𝑀−1
𝑚 𝑥 (𝑙, 𝑚)𝑊𝑀 0 ≤ q ≤ M-1
Step II: Compute rectangular array G(l,q) defined as
𝑙𝑞
𝐺 (𝑙, 𝑞) = 𝑊𝑁 𝐹 (𝑙, 𝑞) 0 ≤ l ≤ L − 1 and 0 ≤ q ≤ M − 1
Step III: Compute L point DFTs for each column q=0, 1, 2,..... M-1 of the array G(l,q)
𝑝𝑙
𝑋 (𝑝, 𝑞) = ∑𝐿−1
𝑙=0 𝐺 (𝑙, 𝑞 )𝑊𝐿 0 ≤ p≤ L−1
Here total complex multiplication needed, LM2+LM+ML2=N(M+L+1)
Complex Additions needed, LM(M-1)+ML(L-1)=LM(M+L-2)
MATLAB code
clc
clear all
x=input('enter the sample values:');
for i=1:5
s=0;
for j=1:3
a(i,j)=x(i+s);
s=s+5;
end
end
w=complex(cos(2*pi/3),-sin(2*pi/3));
pl=complex(cos(2*pi/5),-sin(2*pi/5));
pp=complex(cos(2*pi/15),-sin(2*pi/15));
for i=1:5
s=0;
for j=1:3
for o=1:3 %m=o
s=s+a(i,o)*power(w,((o-1)*(j-1)));
end
f(i,j)=s;
s=0;
end
end

for i=1:5
for j=1:3
g(i,j)=f(i,j)*power(pp,(i-1)*(j-1));
end
end

for i=1:5
s=0;
for j=1:3
for o=1:5
s=s+g(o,j)*power(pl,(o-1)*(i-1));
end
X(i,j)=s;
s=0;
end
end
X
% Plot amplitude spectrum
n=0:14;
z=X(:);
amplitude_spectrum=abs(z);
Phase_spectrum=angle(z);

figure;
subplot(2, 1, 1); % Create a subplot with 2 rows and 1 column,
first plot
stem(n, amplitude_spectrum, 'filled'); % Discrete plot

title('Amplitude Spectrum');
xlabel('Frequency index');
ylabel('Amplitude');
grid on;
% Plot phase spectrum
subplot(2, 1, 2); % Second plot
stem(n, Phase_spectrum, 'filled'); % Discrete plot

title('Phase Spectrum');
xlabel('Frequency index');
ylabel('Phase (radians)');
grid on;

Input:

enter the sample values: [4 5 6 7 8 1 2 3 5 7 8 5 4 10 8]

Output:

X=

83.0000 + 0.0000i 9.0162 + 7.7730i -4.9993 - 6.5630i


-4.5000 +15.7517i -4.1621 + 5.4218i -5.5000 - 7.7942i
-4.5000 - 2.0939i 3.1452 + 2.7588i 3.1452 - 2.7588i
-4.5000 + 2.0939i -5.5000 + 7.7942i -4.1621 - 5.4218i
-4.5000 -15.7517i -4.9993 + 6.5630i 9.0162 - 7.7730i
MATLAB Plot:

Fig 4.1: Plot of the amplitude and phase spectrum

Discussion and conclusion: In this experiment, to compute the DFTs of a sequence divide
and conquer algorithm is used. It is a very efficient algorithm. 15 points DFT calculated in
this experiment where complex multiplication needed 135 and complex addition needed
90, so total computation is 225. But direct DFT used then complex multiplication need 225
and addition need 210 so total computation need 435. So in divide and conquer approach
computation saved (435-225)=210.

You might also like