SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
1
IMPLEMENTATION OF FAST FOURIER
TRANSFORM
Self Study Course
By
Rohit Singh
Amit Kumar Singh
(M.Tech (VST))
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
2
Contents
1. Introduction to fast fourier transform ...………………… 03
2. Butterfly structures for FFT ...………………… 08
3. Implementation of 16-point FFT blocks …………………... 11
4. Matlab code for DFT …………………. 12
5. Matlab code for 8 point FFT …………………. 13
6. VHDL code for 16 point FFT Processor …………… 14
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
3
1. INTRODUCTION TO FAST FOURIER TRANSFORM
A Fast Fourier Transform (FFT) is an efficient algorithm to compute the Discrete
Fourier Transform (DFT) and its inverse. There are many distinct FFT algorithms
involving a wide range of mathematics, from simple complex-number arithmetic to group
theory and number theory. The fast Fourier Transform is a highly efficient procedure for
computing the DFT of a finite series and requires less number of computations than that
of direct evaluation of DFT. It reduces the computations by taking advantage of the fact
that the calculation of the coefficients of the DFT can be carried out iteratively. Due to
this, FFT computation technique is used in digital spectral analysis, filter simulation,
autocorrelation and pattern recognition.
The FFT is based on decomposition and breaking the transform into smaller
transforms and combining them to get the total transform. FFT reduces the computation
time required to compute a discrete Fourier transform and improves the performance by a
factor of 100 or more over direct evaluation of the DFT.
A DFT decomposes a sequence of values into components of different
frequencies. This operation is useful in many fields but computing it directly from the
definition is often too slow to be practical. An FFT is a way to compute the same result
more quickly: computing a DFT of N points in the obvious way, using the definition,
takes O( N2
) arithmetical operations, while an FFT can compute the same result in only
O(N log N) operations.
The difference in speed can be substantial, especially for long data sets where N
may be in the thousands or millions—in practice, the computation time can be reduced by
several orders of magnitude in such cases, and the improvement is roughly proportional
to N /log (N). This huge improvement made many DFT-based algorithms practical. FFT’s
are of great importance to a wide variety of applications, from digital signal processing
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
4
and solving partial differential equations to algorithms for quick multiplication of large
integers.
The most well known FFT algorithms depend upon the factorization of N, but
there are FFT with O (N log N) complexity for all N, even for prime N. Many FFT
algorithms only depend on the fact that is an N th primitive root of unity, and thus can be
applied to analogous transforms over any finite field, such as number-theoretic
transforms.
The Fast Fourier Transform algorithm exploit the two basic properties of the
twiddle factor - the symmetry property and periodicity property which reduces the
number of complex multiplications required to perform DFT.
FFT algorithms are based on the fundamental principle of decomposing the
computation of discrete Fourier Transform of a sequence of length N into successively
smaller discrete Fourier transforms. There are basically two classes of FFT algorithms.
A) Decimation In Time (DIT) algorithm
B) Decimation In Frequency (DIF) algorithm.
In decimation-in-time, the sequence for which we need the DFT is successively
divided into smaller sequences and the DFTs of these subsequences are combined in a
certain pattern to obtain the required DFT of the entire sequence. In the decimation-in-
frequency approach, the frequency samples of the DFT are decomposed into smaller and
smaller subsequences in a similar manner.
The number of complex multiplication and addition operations required by the
simple forms both the Discrete Fourier Transform (DFT) and Inverse Discrete Fourier
Transform (IDFT) is of order N2
as there are N data points to calculate, each of which
requires N complex arithmetic operations.
The discrete Fourier transform (DFT) is defined by the formula:
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
5
;
2
1
0
)()( N
nKj
N
n
enxKX





Where K is an integer ranging from 0 to N − 1.
The algorithmic complexity of DFT will O(N2
) and hence is not a very efficient
method. If we can't do any better than this then the DFT will not be very useful for the
majority of practical DSP application. However, there are a number of different 'Fast
Fourier Transform' (FFT) algorithms that enable the calculation the Fourier transform of
a signal much faster than a DFT. As the name suggests, FFTs are algorithms for quick
calculation of discrete Fourier transform of a data vector. The FFT is a DFT algorithm
which reduces the number of computations needed for N points from O(N2
) to O(N log N)
where log is the base-2 logarithm. If the function to be transformed is not harmonically
related to the sampling frequency, the response of an FFT looks like a ‘sinc’ function (sin
x) / x.
The Radix-2 DIT algorithm rearranges the DFT of the function xn into two parts:
a sum over the even-numbered indices n = 2m and a sum over the odd-numbered indices
n = 2m + 1:
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
6
One can factor a common multiplier out of the second sum in the
equation. It is the two sums are the DFT of the even-indexed part x2m and the DFT of
odd-indexed part x2m + 1 of the function xn. Denote the DFT of the Even-indexed inputs
x2m by Ek and the DFT of the Odd-indexed inputs x2m + 1 by Ok and we obtain:
However, these smaller DFTs have a length of N/2, so we need compute only N/2
outputs: thanks to the periodicity properties of the DFT, the outputs for N/2 < k < N from
a DFT of length N/2 are identical to the outputs for 0< k < N/2. That is, Ek + N / 2 = Ek
and Ok + N / 2 = Ok. The phase factor exp[ − 2πik / N] called a twiddle factor which
obeys the relation: exp[ − 2πi(k + N / 2) / N] = e − πiexp[ − 2πik / N] = − exp[ − 2πik / N],
flipping the sign of the Ok + N / 2 terms. Thus, the whole DFT can be calculated as
follows:
This result, expressing the DFT of length N recursively in terms of two DFTs of
size N/2, is the core of the radix-2 DIT fast Fourier transform. The algorithm gains its
speed by re-using the results of intermediate computations to compute multiple DFT
outputs. Note that final outputs are obtained by a +/− combination of Ek and Okexp( −
2πik / N), which is simply a size-2 DFT; when this is generalized to larger radices below,
the size-2 DFT is replaced by a larger DFT (which itself can be evaluated with an FFT).
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
7
This process is an example of the general technique of divide and conquers algorithms. In
many traditional implementations, however, the explicit recursion is avoided, and instead
one traverses the computational tree in breadth-first fashion.
Fig 1.1 Decimation In Time FFT
In the DIT algorithm, the twiddle multiplication is performed before the butterfly
stage whereas for the DIF algorithm, the twiddle multiplication comes after the Butterfly
stage. Fig 1.2 Decimation In Frequency FFT
The 'Radix 2' algorithms are useful if N is a regular power of 2 (N=2p). If we
assume that algorithmic complexity provides a direct measure of execution time and that
the relevant logarithm base is 2 then as shown in table 1.1, ratio of execution times for
the (DFT) vs. (Radix 2 FFT) increases tremendously with increase in N.
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
8
The term 'FFT' is actually slightly ambiguous, because there are several
commonly used 'FFT' algorithms. There are two different Radix 2 algorithms, the so-
called 'Decimation in Time' (DIT) and 'Decimation in Frequency' (DIF) algorithms. Both
of these rely on the recursive decomposition of an N point transform into 2 (N/2) point
transforms.
Number
of Points,
N
Complex Multiplications
in Direct computations,
N2
Complex Multiplication
in FFT Algorithm, (N/2)
log2 N
Speed
improvement
Factor
4 16 4 4.0
8 64 12 5.3
16 256 32 8.0
32 1024 80 12.8
64 4096 192 21.3
128 16384 448 36.6
Table 1.1: Comparison of Execution Times, DFT & Radix – 2 FFT
2. BUTTERFLY STRUCTURES FOR FFT
Basically FFT algorithms are developed by means of divide and conquer method,
the is depending on the decomposition of an N point DFT in to smaller DFT’s. If N is
factored as N = r1,r2,r3 ..rL where r1=r2=…=rL=r, then rL =N. where r is called as Radix of
FFT algorithm.
If r= 2, then it is called as radix-2 FFT algorithm,. The basic DFT is of size of 2.
The N point DFT is decimated into 2 point DFT by two ways such as Decimation In
Time (DIT) and Decimation In Frequency (DIF) algorithm. Both the algorithm take the
advantage of periodicity and symmetry property of the twiddle factor.
N
nKj
enK
N
W


2
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
9
The radix-2 decimation-in-frequency FFT is an important algorithm obtained by
the divide and conquers approach. The Fig. 1.3 below shows the first stage of the 8-point
DIF algorithm.
Fig. 1.3 First Stage of 8 point Decimation in Frequency Algorithm.
The decimation, however, causes shuffling in data. The entire process involves v
= log2 N stages of decimation, where each stage involves N/2 butterflies of the type
shown in the Fig. 1.3.
Fig. 1.4: Butterfly Scheme.
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
10
Here N
nkj
ek
nW


2
is the Twiddle factor.
Consequently, the computation of N-point DFT via this algorithm requires (N/2)
log2 N complex multiplications. For illustrative purposes, the eight-point decimation-in
frequency algorithm is shown in the Figure below. We observe, as previously stated, that
the output sequence occurs in bit-reversed order with respect to the input. Furthermore, if
we abandon the requirement that the computations occur in place, it is also possible to
have both the input and output in normal order. The 8 point Decimation In frequency
algorithm is shown in Fig 1.5.
Fig. 1.5 8 point Decimation in Frequency Algorithm
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
11
3. IMPLEMENTATION OF 16-POINT FFT BLOCKS
The FFT computation is accomplished in three stages. The x(0) until x(15)
variables are denoted as the input values for FFT computation and X(0) until X(15) are
denoted as the outputs. The pipeline architecture of the 16 point FFT is shown in Fig 2.1
consisting of butterfly schemes in it. There are two operations to complete the
computation in each stage.
Fig 2.1: Architecture of 16 point FFT.
The upward arrow will execute addition operation while downward arrow will
execute subtraction operation. The subtracted value is multiplied with twiddle factor
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
12
value before being processed into the next stage. This operation is done concurrently and
is known as butterfly process.
4. Matlab Code for DFT
% program to calculate DFT.
clear all;
clc;
x=input ('enter the sequence ');
tic
N=size(x,2);
w=zeros(N);
for a=1:N
for b=1:N
w(a,b)=exp((-1j*2*pi*(a-1)*(b-1))/N);
end
end
Xk = w*x';
Xk
Toc
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
13
5. Matlab Code for 8 point FFT
% program to calculate 8 point FFT
clear all;
clc;
x=input (' enter the sequence of length 8 ');
tic
s0=zeros(1,8);
s1=zeros(1,8);
s2=zeros(1,8);
s3=zeros(1,8);
N=size(x,2);
if (N < 8 || N > 8)
disp(' sequence is of not proper length ');
else
stage1=[1 1 1 0-1j 1 1 1 0-1j];
stage2=[1 1 1 1 1 0.707-0.707j 0-1j -0.707-0.707j];
p=[0:7]';
t=bitrevorder(p);
% calculation of stage zero
for i=1:N
s0(i)=x(t(i)+1);
end
% calculation of stage one
for i=1:2:N
s1(i)=s0(i)+s0(i+1);
s1(i+1)=s0(i)-s0(i+1);
end
for a=1:N
s1(a)=s1(a)*stage1(a);
end
% calculation of stage two
for i=1:4:N
s2(i)=s1(i)+s1(i+2);
s2(i+1)=s1(i+1)+s1(i+3);
s2(i+2)=s1(i)-s1(i+2);
s2(i+3)=s1(i+1)-s1(i+3);
end
for a=1:N
s2(a)=s2(a)*stage2(a);
end
% calculation of stage three
s3(1)=s2(1)+s2(5);
s3(2)=s2(2)+s2(6);
s3(3)=s2(3)+s2(7);
s3(4)=s2(4)+s2(8);
s3(5)=s2(1)-s2(5);
s3(6)=s2(2)-s2(6);
s3(7)=s2(3)-s2(7);
s3(8)=s2(4)-s2(8);
end
disp(' FFT result ');
s3
toc
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
14
6. VHDL CODE FOR 16 POINT FFT PROCESSOR
FFT MAIN PROGRAM
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_SIGNED.all;
use IEEE.STD_LOGIC_ARITH.all;
use work.fft_package.all;
entity Parallel_FFT is
Port ( x : in signed_vector;
y : out comp_array);
end Parallel_FFT;
architecture Behavioral of Parallel_FFT is
component real_input_to_complex is
Port ( input_real : in signed_vector;
input_comp : out comp_array);
end component;
component butterfly is
port(
c1,c2 : in complex; --inputs
w :in complex; -- phase factor
g1,g2 :out complex -- outputs
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
15
);
end component;
constant w : comp_array := (
("0100000000000000", "0000000000000000"),
("0011101100100001", "1110011110000010"),
("0010110101000001", "1101001010111111"),
("0001100001111110", "1100010011011111"),
("0000000000000000", "1100000000000000"),
("1110011110000010", "1100010011011111"),
("1101001010111111", "1101001010111111"),
("1100010011011111", "1110011110000010"),
("1100000000000000", "0000000000000000"),
("1100010011011111", "0001100001111110"),
("1101001010111111", "0010110101000001"),
("1110011110000010", "0011101100100001"),
("0000000000000000", "0100000000000000"),
("0001100001111110", "0011101100100001"),
("0010110101000001", "0010110101000001"),
("0011101100100001", "0001100001111110")
);
signal s, g1, g2, g3 : comp_array := (others =>
("0000000000000000","0000000000000000"));
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
16
begin
--Real Input value transformed in complex value
sixteen_bits_complex_transform : real_input_to_complex port
map(x, s);
--first stage of butterfly's.
bf11 : butterfly port map(s(0),s(8),w(0),g1(0),g1(8));
bf12 : butterfly port map(s(1),s(9),w(1),g1(1),g1(9));
bf13 : butterfly port map(s(2),s(10),w(2),g1(2),g1(10));
bf14 : butterfly port map(s(3),s(11),w(3),g1(3),g1(11));
bf15 : butterfly port map(s(4),s(12),w(4),g1(4),g1(12));
bf16 : butterfly port map(s(5),s(13),w(5),g1(5),g1(13));
bf17 : butterfly port map(s(6),s(14),w(6),g1(6),g1(14));
bf18 : butterfly port map(s(7),s(15),w(7),g1(7),g1(15));
--second stage of butterfly's.
bf21 : butterfly port map(g1(0),g1(4),w(0),g2(0),g2(4));
bf22 : butterfly port map(g1(1),g1(5),w(2),g2(1),g2(5));
bf23 : butterfly port map(g1(2),g1(6),w(4),g2(2),g2(6));
bf24 : butterfly port map(g1(3),g1(7),w(6),g2(3),g2(7));
bf25 : butterfly port map(g1(8),g1(12),w(0),g2(8),g2(12));
bf26 : butterfly port map(g1(9),g1(13),w(2),g2(9),g2(13));
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
17
bf27 : butterfly port
map(g1(10),g1(14),w(4),g2(10),g2(14));
bf28 : butterfly port
map(g1(11),g1(15),w(6),g2(11),g2(15));
--third stage of butterfly's.
bf31 : butterfly port map(g2(0),g2(2),w(0),g3(0),g3(2));
bf32 : butterfly port map(g2(1),g2(3),w(4),g3(1),g3(3));
bf33 : butterfly port map(g2(4),g2(6),w(0),g3(4),g3(6));
bf34 : butterfly port map(g2(5),g2(7),w(4),g3(5),g3(7));
bf35 : butterfly port map(g2(8),g2(10),w(0),g3(8),g3(10));
bf36 : butterfly port map(g2(9),g2(11),w(4),g3(9),g3(11));
bf37 : butterfly port
map(g2(12),g2(14),w(0),g3(12),g3(14));
bf38 : butterfly port
map(g2(13),g2(15),w(4),g3(13),g3(15));
--fourth stage of butterfly's.
bf41 : butterfly port map(g3(0),g3(1),w(0),y(0),y(8));
bf42 : butterfly port map(g3(2),g3(3),w(0),y(4),y(12));
bf43 : butterfly port map(g3(4),g3(5),w(0),y(2),y(10));
bf44 : butterfly port map(g3(6),g3(7),w(0),y(6),y(14));
bf45 : butterfly port map(g3(8),g3(9),w(0),y(1),y(9));
bf46 : butterfly port map(g3(10),g3(11),w(0),y(5),y(13));
bf47 : butterfly port map(g3(12),g3(13),w(0),y(3),y(11));
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
18
bf48 : butterfly port map(g3(14),g3(15),w(0),y(7),y(15));
end Behavioral;
BUTTERFLY.VHD
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use work.fft_package.all;
entity butterfly is
port(
c1,c2 : in complex; --inputs
w :in complex; -- phase factor
g1,g2 :out complex -- outputs
);
end butterfly;
architecture Behavioral of butterfly is
begin
--butterfly equations.
g1 <= add(c1,c2);
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
19
g2 <= mult(sub(c1,c2),w);
end Behavioral;
FFT PACKAGE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_SIGNED.all;
use IEEE.STD_LOGIC_ARITH.all;
package fft_package is
type complex is
record
r : signed(15 downto 0);
i : signed(15 downto 0);
end record;
type signed_vector is array (0 to 15) of signed(7 downto
0);
type comp_array is array (0 to 15) of complex;
function add (n1,n2 : complex) return complex;
function sub (n1,n2 : complex) return complex;
function mult (n1,n2 : complex) return complex;
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
20
end fft_package;
package body fft_package is
--addition of complex numbers
function add (n1,n2 : complex) return complex is
variable sum : complex;
begin
sum.r:=n1.r + n2.r;
sum.i:=n1.i + n2.i;
return sum;
end add;
--subtraction of complex numbers.
function sub (n1,n2 : complex) return complex is
variable diff : complex;
begin
diff.r:=n1.r - n2.r;
diff.i:=n1.i - n2.i;
return diff;
end sub;
--multiplication of complex numbers.
function mult (n1,n2 : complex) return complex is
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
21
variable prod : complex;
variable prod_aux_r : signed(31 downto 0);
variable prod_aux_i : signed(31 downto 0);
begin
prod_aux_r := (n1.r * n2.r) - (n1.i * n2.i);
prod.r:= prod_aux_r(29 downto 14);
prod_aux_i := (n1.r * n2.i) + (n1.i * n2.r);
prod.i:= prod_aux_i(29 downto 14);
return prod;
end mult;
end fft_package;
REAL TO COMPLEX
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_SIGNED.all;
use IEEE.STD_LOGIC_ARITH.all;
use work.fft_package.all;
entity real_input_to_complex is
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
22
Port ( input_real : in signed_vector;
input_comp : out comp_array);
end real_input_to_complex;
architecture Behavioral of real_input_to_complex is
component sig_ext_8_to_16_bits is
Port ( sig_in : in signed(7 downto 0);
sig_out : out complex);
end component;
begin
input0 : sig_ext_8_to_16_bits port map (input_real(0),
input_comp(0));
input1 : sig_ext_8_to_16_bits port map (input_real(1),
input_comp(1));
input2 : sig_ext_8_to_16_bits port map (input_real(2),
input_comp(2));
input3 : sig_ext_8_to_16_bits port map (input_real(3),
input_comp(3));
input4 : sig_ext_8_to_16_bits port map (input_real(4),
input_comp(4));
input5 : sig_ext_8_to_16_bits port map (input_real(5),
input_comp(5));
input6 : sig_ext_8_to_16_bits port map (input_real(6),
input_comp(6));
input7 : sig_ext_8_to_16_bits port map (input_real(7),
input_comp(7));
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
23
input8 : sig_ext_8_to_16_bits port map (input_real(8),
input_comp(8));
input9 : sig_ext_8_to_16_bits port map (input_real(9),
input_comp(9));
input10 : sig_ext_8_to_16_bits port map (input_real(10),
input_comp(10));
input11 : sig_ext_8_to_16_bits port map (input_real(11),
input_comp(11));
input12 : sig_ext_8_to_16_bits port map (input_real(12),
input_comp(12));
input13 : sig_ext_8_to_16_bits port map (input_real(13),
input_comp(13));
input14 : sig_ext_8_to_16_bits port map (input_real(14),
input_comp(14));
input15 : sig_ext_8_to_16_bits port map (input_real(15),
input_comp(15));
end Behavioral;
EIGHT TO SIXTEEN
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_SIGNED.all;
use IEEE.STD_LOGIC_ARITH.all;
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
24
use work.fft_package.all;
entity sig_ext_8_to_16_bits is
Port ( sig_in : in signed(7 downto 0);
sig_out : out complex);
end sig_ext_8_to_16_bits;
architecture Behavioral of sig_ext_8_to_16_bits is
signal sig_out_real : signed(15 downto 0);
begin
sig_out_real <= X"00" & sig_in when sig_in(7)='0' else
X"ff" & sig_in ;
sig_out <= (sig_out_real, "0000000000000000");
end Behavioral;
TEST BENCH
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_SIGNED.all;
use IEEE.STD_LOGIC_ARITH.all;
use work.fft_package.all;
ENTITY fft_cooley_tukey_tb IS
END fft_cooley_tukey_tb;
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
25
ARCHITECTURE behavior OF fft_cooley_tukey_tb IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT Parallel_FFT
Port ( x : in signed_vector;
y : out comp_array);
END COMPONENT;
--Inputs
signal x : signed_vector:= (others => "00000000");
--Outputs
signal y : comp_array;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: Parallel_FFT PORT MAP (
x => x,
y => y
);
-- Stimulus process
stim_proc: process
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
26
begin
-- hold reset state for 100 ns.
wait for 100 ns;
-- x<=("00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001"
-- );
-- x<=("00000000",
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
27
-- "00000000",
-- "00000000",
-- "00000000",
-- "00000000",
-- "00000000",
-- "00000000",
-- "00000000",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001",
-- "00000001"
-- );
x<=("00000101",
"00001010",
"00001111",
"00010100",
"00011001",
"00011110",
.. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST),
Deptt. Of EE,SOE, Shiv Nadar University
28
"00100011",
"00101000",
"00101101",
"00110010",
"00110111",
"00111100",
"01000001",
"01000110",
"01001011",
"01010000"
);
wait;
end process;
END;

Mais conteúdo relacionado

Mais procurados

Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidXavier Davias
 
DSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and Systems
DSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and SystemsDSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and Systems
DSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and SystemsAmr E. Mohamed
 
Fourier transforms
Fourier transformsFourier transforms
Fourier transformskalung0313
 
The Fast Fourier Transform (FFT)
The Fast Fourier Transform (FFT)The Fast Fourier Transform (FFT)
The Fast Fourier Transform (FFT)Oka Danil
 
Digital Signal Processing[ECEG-3171]-Ch1_L03
Digital Signal Processing[ECEG-3171]-Ch1_L03Digital Signal Processing[ECEG-3171]-Ch1_L03
Digital Signal Processing[ECEG-3171]-Ch1_L03Rediet Moges
 
Fast Fourier Transform Analysis
Fast Fourier Transform AnalysisFast Fourier Transform Analysis
Fast Fourier Transform Analysisdhikadixiana
 
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysisDigital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysisChandrashekhar Padole
 
Dsp U Lec10 DFT And FFT
Dsp U   Lec10  DFT And  FFTDsp U   Lec10  DFT And  FFT
Dsp U Lec10 DFT And FFTtaha25
 
Fft presentation
Fft presentationFft presentation
Fft presentationilker Şin
 
Digital Signal Processing[ECEG-3171]-Ch1_L07
Digital Signal Processing[ECEG-3171]-Ch1_L07Digital Signal Processing[ECEG-3171]-Ch1_L07
Digital Signal Processing[ECEG-3171]-Ch1_L07Rediet Moges
 
Solved numerical problems of fourier series
Solved numerical problems of fourier seriesSolved numerical problems of fourier series
Solved numerical problems of fourier seriesMohammad Imran
 
9.sequential+circuits part+1
9.sequential+circuits part+1 9.sequential+circuits part+1
9.sequential+circuits part+1 liran1018
 
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)Amr E. Mohamed
 
Chapter5 - The Discrete-Time Fourier Transform
Chapter5 - The Discrete-Time Fourier TransformChapter5 - The Discrete-Time Fourier Transform
Chapter5 - The Discrete-Time Fourier TransformAttaporn Ninsuwan
 
verilog coding of butterfly diagram
verilog coding of butterfly diagram verilog coding of butterfly diagram
verilog coding of butterfly diagram Venkat Malai Avichi
 
Basic simulation lab manual1
Basic simulation lab manual1Basic simulation lab manual1
Basic simulation lab manual1Janardhana Raju M
 

Mais procurados (20)

Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
 
DSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and Systems
DSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and SystemsDSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and Systems
DSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and Systems
 
Fourier transforms
Fourier transformsFourier transforms
Fourier transforms
 
The Fast Fourier Transform (FFT)
The Fast Fourier Transform (FFT)The Fast Fourier Transform (FFT)
The Fast Fourier Transform (FFT)
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
Properties of dft
Properties of dftProperties of dft
Properties of dft
 
Ft and FFT
Ft and FFTFt and FFT
Ft and FFT
 
Digital Signal Processing[ECEG-3171]-Ch1_L03
Digital Signal Processing[ECEG-3171]-Ch1_L03Digital Signal Processing[ECEG-3171]-Ch1_L03
Digital Signal Processing[ECEG-3171]-Ch1_L03
 
Fft
FftFft
Fft
 
Fast Fourier Transform Analysis
Fast Fourier Transform AnalysisFast Fourier Transform Analysis
Fast Fourier Transform Analysis
 
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysisDigital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
 
Dsp U Lec10 DFT And FFT
Dsp U   Lec10  DFT And  FFTDsp U   Lec10  DFT And  FFT
Dsp U Lec10 DFT And FFT
 
Fft presentation
Fft presentationFft presentation
Fft presentation
 
Digital Signal Processing[ECEG-3171]-Ch1_L07
Digital Signal Processing[ECEG-3171]-Ch1_L07Digital Signal Processing[ECEG-3171]-Ch1_L07
Digital Signal Processing[ECEG-3171]-Ch1_L07
 
Solved numerical problems of fourier series
Solved numerical problems of fourier seriesSolved numerical problems of fourier series
Solved numerical problems of fourier series
 
9.sequential+circuits part+1
9.sequential+circuits part+1 9.sequential+circuits part+1
9.sequential+circuits part+1
 
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
 
Chapter5 - The Discrete-Time Fourier Transform
Chapter5 - The Discrete-Time Fourier TransformChapter5 - The Discrete-Time Fourier Transform
Chapter5 - The Discrete-Time Fourier Transform
 
verilog coding of butterfly diagram
verilog coding of butterfly diagram verilog coding of butterfly diagram
verilog coding of butterfly diagram
 
Basic simulation lab manual1
Basic simulation lab manual1Basic simulation lab manual1
Basic simulation lab manual1
 

Destaque

Radix 2 code
Radix 2 codeRadix 2 code
Radix 2 codepradipakv
 
Radix 4 FFT algorithm and it time complexity computation
Radix 4 FFT algorithm and it time complexity computationRadix 4 FFT algorithm and it time complexity computation
Radix 4 FFT algorithm and it time complexity computationRaj Jaiswal
 
Decimation in time and frequency
Decimation in time and frequencyDecimation in time and frequency
Decimation in time and frequencySARITHA REDDY
 
Fast Fourier Transform
Fast Fourier TransformFast Fourier Transform
Fast Fourier Transformop205
 
Design of Efficient High Speed Vedic Multiplier
Design of Efficient High Speed Vedic MultiplierDesign of Efficient High Speed Vedic Multiplier
Design of Efficient High Speed Vedic Multiplierijsrd.com
 
IEEE PROJECTS 2012 FOR EEE-LATEST EEE PROJECTS TITLES&ABSTRACT
IEEE PROJECTS 2012 FOR EEE-LATEST EEE PROJECTS TITLES&ABSTRACTIEEE PROJECTS 2012 FOR EEE-LATEST EEE PROJECTS TITLES&ABSTRACT
IEEE PROJECTS 2012 FOR EEE-LATEST EEE PROJECTS TITLES&ABSTRACTASHOKKUMAR RAMAR
 
xử lý số tín hiệu -Chuong 4
xử lý số tín hiệu -Chuong 4xử lý số tín hiệu -Chuong 4
xử lý số tín hiệu -Chuong 4Ngai Hoang Van
 
The discrete fourier transform (dsp) 4
The discrete fourier transform  (dsp) 4The discrete fourier transform  (dsp) 4
The discrete fourier transform (dsp) 4HIMANSHU DIWAKAR
 
Dtmf Detection
Dtmf DetectionDtmf Detection
Dtmf Detectionbiometria
 
Qualitative and dft analysis of endiynes
Qualitative and  dft analysis of endiynes Qualitative and  dft analysis of endiynes
Qualitative and dft analysis of endiynes Dr Robert Craig PhD
 
Seminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLSeminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLNaseer LoneRider
 
Project ideas ece students
Project ideas ece studentsProject ideas ece students
Project ideas ece studentsVatsal N Shah
 
Discrete Fourier Transform
Discrete Fourier TransformDiscrete Fourier Transform
Discrete Fourier TransformAbhishek Choksi
 

Destaque (20)

Dif fft
Dif fftDif fft
Dif fft
 
Radix 2 code
Radix 2 codeRadix 2 code
Radix 2 code
 
Radix 4 FFT algorithm and it time complexity computation
Radix 4 FFT algorithm and it time complexity computationRadix 4 FFT algorithm and it time complexity computation
Radix 4 FFT algorithm and it time complexity computation
 
Decimation in time and frequency
Decimation in time and frequencyDecimation in time and frequency
Decimation in time and frequency
 
Fast Fourier Transform
Fast Fourier TransformFast Fourier Transform
Fast Fourier Transform
 
Design of Efficient High Speed Vedic Multiplier
Design of Efficient High Speed Vedic MultiplierDesign of Efficient High Speed Vedic Multiplier
Design of Efficient High Speed Vedic Multiplier
 
Fft
FftFft
Fft
 
Ppt on fft
Ppt on fftPpt on fft
Ppt on fft
 
IEEE PROJECTS 2012 FOR EEE-LATEST EEE PROJECTS TITLES&ABSTRACT
IEEE PROJECTS 2012 FOR EEE-LATEST EEE PROJECTS TITLES&ABSTRACTIEEE PROJECTS 2012 FOR EEE-LATEST EEE PROJECTS TITLES&ABSTRACT
IEEE PROJECTS 2012 FOR EEE-LATEST EEE PROJECTS TITLES&ABSTRACT
 
xử lý số tín hiệu -Chuong 4
xử lý số tín hiệu -Chuong 4xử lý số tín hiệu -Chuong 4
xử lý số tín hiệu -Chuong 4
 
The discrete fourier transform (dsp) 4
The discrete fourier transform  (dsp) 4The discrete fourier transform  (dsp) 4
The discrete fourier transform (dsp) 4
 
Dtmf Detection
Dtmf DetectionDtmf Detection
Dtmf Detection
 
Anilkumaer
AnilkumaerAnilkumaer
Anilkumaer
 
Qualitative and dft analysis of endiynes
Qualitative and  dft analysis of endiynes Qualitative and  dft analysis of endiynes
Qualitative and dft analysis of endiynes
 
Seminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLSeminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDL
 
Introduction to DFT Part 1
Introduction to DFT Part 1 Introduction to DFT Part 1
Introduction to DFT Part 1
 
Arduino uno-schematic
Arduino uno-schematicArduino uno-schematic
Arduino uno-schematic
 
Project ideas ece students
Project ideas ece studentsProject ideas ece students
Project ideas ece students
 
Dft,fft,windowing
Dft,fft,windowingDft,fft,windowing
Dft,fft,windowing
 
Discrete Fourier Transform
Discrete Fourier TransformDiscrete Fourier Transform
Discrete Fourier Transform
 

Semelhante a FFT Implementation and Analysis in VHDL

Resourceful fast dht algorithm for vlsi implementation by split radix algorithm
Resourceful fast dht algorithm for vlsi implementation by split radix algorithmResourceful fast dht algorithm for vlsi implementation by split radix algorithm
Resourceful fast dht algorithm for vlsi implementation by split radix algorithmeSAT Publishing House
 
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...cscpconf
 
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...csandit
 
Dft and its applications
Dft and its applicationsDft and its applications
Dft and its applicationsAgam Goel
 
Iaetsd computational performances of ofdm using
Iaetsd computational performances of ofdm usingIaetsd computational performances of ofdm using
Iaetsd computational performances of ofdm usingIaetsd Iaetsd
 
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...ijma
 
Design of Scalable FFT architecture for Advanced Wireless Communication Stand...
Design of Scalable FFT architecture for Advanced Wireless Communication Stand...Design of Scalable FFT architecture for Advanced Wireless Communication Stand...
Design of Scalable FFT architecture for Advanced Wireless Communication Stand...IOSRJECE
 
IRJET- Low Complexity Pipelined FFT Design for High Throughput and Low Densit...
IRJET- Low Complexity Pipelined FFT Design for High Throughput and Low Densit...IRJET- Low Complexity Pipelined FFT Design for High Throughput and Low Densit...
IRJET- Low Complexity Pipelined FFT Design for High Throughput and Low Densit...IRJET Journal
 
IRJET- A Study on Algorithms for FFT Computations
IRJET- A Study on Algorithms for FFT ComputationsIRJET- A Study on Algorithms for FFT Computations
IRJET- A Study on Algorithms for FFT ComputationsIRJET Journal
 
EC8562 DSP Viva Questions
EC8562 DSP Viva Questions EC8562 DSP Viva Questions
EC8562 DSP Viva Questions ssuser2797e4
 
IRJET - Design and Implementation of FFT using Compressor with XOR Gate Topology
IRJET - Design and Implementation of FFT using Compressor with XOR Gate TopologyIRJET - Design and Implementation of FFT using Compressor with XOR Gate Topology
IRJET - Design and Implementation of FFT using Compressor with XOR Gate TopologyIRJET Journal
 
Design and Power Measurement of 2 And 8 Point FFT Using Radix-2 Algorithm for...
Design and Power Measurement of 2 And 8 Point FFT Using Radix-2 Algorithm for...Design and Power Measurement of 2 And 8 Point FFT Using Radix-2 Algorithm for...
Design and Power Measurement of 2 And 8 Point FFT Using Radix-2 Algorithm for...IOSRJVSP
 
Performance Comparison of FFT, DHT and DCT Based OFDM Systems with BPSK as A ...
Performance Comparison of FFT, DHT and DCT Based OFDM Systems with BPSK as A ...Performance Comparison of FFT, DHT and DCT Based OFDM Systems with BPSK as A ...
Performance Comparison of FFT, DHT and DCT Based OFDM Systems with BPSK as A ...paperpublications3
 
Ecg signal compression for diverse transforms
Ecg signal compression for diverse transformsEcg signal compression for diverse transforms
Ecg signal compression for diverse transformsAlexander Decker
 
A combined sdc
A combined sdcA combined sdc
A combined sdcsakthi1986
 
s.Magesh kumar DECE,BTECH,ME (ASAN MEMORIAL COLLEGE OF ENGINEERING AND TECHNO...
s.Magesh kumar DECE,BTECH,ME (ASAN MEMORIAL COLLEGE OF ENGINEERING AND TECHNO...s.Magesh kumar DECE,BTECH,ME (ASAN MEMORIAL COLLEGE OF ENGINEERING AND TECHNO...
s.Magesh kumar DECE,BTECH,ME (ASAN MEMORIAL COLLEGE OF ENGINEERING AND TECHNO...sakthi1986
 
Fast Fourier Transform (FFT) Algorithms in DSP
Fast Fourier Transform (FFT) Algorithms in DSPFast Fourier Transform (FFT) Algorithms in DSP
Fast Fourier Transform (FFT) Algorithms in DSProykousik2020
 
Introduction_to_fast_fourier_transform ppt
Introduction_to_fast_fourier_transform pptIntroduction_to_fast_fourier_transform ppt
Introduction_to_fast_fourier_transform pptVikashKumar547263
 
Iaetsd fpga implementation of cordic algorithm for pipelined fft realization and
Iaetsd fpga implementation of cordic algorithm for pipelined fft realization andIaetsd fpga implementation of cordic algorithm for pipelined fft realization and
Iaetsd fpga implementation of cordic algorithm for pipelined fft realization andIaetsd Iaetsd
 

Semelhante a FFT Implementation and Analysis in VHDL (20)

Resourceful fast dht algorithm for vlsi implementation by split radix algorithm
Resourceful fast dht algorithm for vlsi implementation by split radix algorithmResourceful fast dht algorithm for vlsi implementation by split radix algorithm
Resourceful fast dht algorithm for vlsi implementation by split radix algorithm
 
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
 
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
 
Dft and its applications
Dft and its applicationsDft and its applications
Dft and its applications
 
Iaetsd computational performances of ofdm using
Iaetsd computational performances of ofdm usingIaetsd computational performances of ofdm using
Iaetsd computational performances of ofdm using
 
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
 
Design of Scalable FFT architecture for Advanced Wireless Communication Stand...
Design of Scalable FFT architecture for Advanced Wireless Communication Stand...Design of Scalable FFT architecture for Advanced Wireless Communication Stand...
Design of Scalable FFT architecture for Advanced Wireless Communication Stand...
 
IRJET- Low Complexity Pipelined FFT Design for High Throughput and Low Densit...
IRJET- Low Complexity Pipelined FFT Design for High Throughput and Low Densit...IRJET- Low Complexity Pipelined FFT Design for High Throughput and Low Densit...
IRJET- Low Complexity Pipelined FFT Design for High Throughput and Low Densit...
 
IRJET- A Study on Algorithms for FFT Computations
IRJET- A Study on Algorithms for FFT ComputationsIRJET- A Study on Algorithms for FFT Computations
IRJET- A Study on Algorithms for FFT Computations
 
EC8562 DSP Viva Questions
EC8562 DSP Viva Questions EC8562 DSP Viva Questions
EC8562 DSP Viva Questions
 
IRJET - Design and Implementation of FFT using Compressor with XOR Gate Topology
IRJET - Design and Implementation of FFT using Compressor with XOR Gate TopologyIRJET - Design and Implementation of FFT using Compressor with XOR Gate Topology
IRJET - Design and Implementation of FFT using Compressor with XOR Gate Topology
 
Design and Power Measurement of 2 And 8 Point FFT Using Radix-2 Algorithm for...
Design and Power Measurement of 2 And 8 Point FFT Using Radix-2 Algorithm for...Design and Power Measurement of 2 And 8 Point FFT Using Radix-2 Algorithm for...
Design and Power Measurement of 2 And 8 Point FFT Using Radix-2 Algorithm for...
 
Performance Comparison of FFT, DHT and DCT Based OFDM Systems with BPSK as A ...
Performance Comparison of FFT, DHT and DCT Based OFDM Systems with BPSK as A ...Performance Comparison of FFT, DHT and DCT Based OFDM Systems with BPSK as A ...
Performance Comparison of FFT, DHT and DCT Based OFDM Systems with BPSK as A ...
 
Ecg signal compression for diverse transforms
Ecg signal compression for diverse transformsEcg signal compression for diverse transforms
Ecg signal compression for diverse transforms
 
A combined sdc
A combined sdcA combined sdc
A combined sdc
 
s.Magesh kumar DECE,BTECH,ME (ASAN MEMORIAL COLLEGE OF ENGINEERING AND TECHNO...
s.Magesh kumar DECE,BTECH,ME (ASAN MEMORIAL COLLEGE OF ENGINEERING AND TECHNO...s.Magesh kumar DECE,BTECH,ME (ASAN MEMORIAL COLLEGE OF ENGINEERING AND TECHNO...
s.Magesh kumar DECE,BTECH,ME (ASAN MEMORIAL COLLEGE OF ENGINEERING AND TECHNO...
 
Fast Fourier Transform (FFT) Algorithms in DSP
Fast Fourier Transform (FFT) Algorithms in DSPFast Fourier Transform (FFT) Algorithms in DSP
Fast Fourier Transform (FFT) Algorithms in DSP
 
Aw4102359364
Aw4102359364Aw4102359364
Aw4102359364
 
Introduction_to_fast_fourier_transform ppt
Introduction_to_fast_fourier_transform pptIntroduction_to_fast_fourier_transform ppt
Introduction_to_fast_fourier_transform ppt
 
Iaetsd fpga implementation of cordic algorithm for pipelined fft realization and
Iaetsd fpga implementation of cordic algorithm for pipelined fft realization andIaetsd fpga implementation of cordic algorithm for pipelined fft realization and
Iaetsd fpga implementation of cordic algorithm for pipelined fft realization and
 

Mais de Rohit Singh

Personality Development Presentation
Personality Development PresentationPersonality Development Presentation
Personality Development PresentationRohit Singh
 
A Report on State MachinesTiming Behavior and Data storage in hard disk drive
A Report on State MachinesTiming Behavior and Data storage in hard disk driveA Report on State MachinesTiming Behavior and Data storage in hard disk drive
A Report on State MachinesTiming Behavior and Data storage in hard disk driveRohit Singh
 
Microprocessor-Compatible Quadrature Decoder/Counter Design
Microprocessor-Compatible Quadrature Decoder/Counter DesignMicroprocessor-Compatible Quadrature Decoder/Counter Design
Microprocessor-Compatible Quadrature Decoder/Counter DesignRohit Singh
 
LED & LASER sources of light
LED & LASER sources of lightLED & LASER sources of light
LED & LASER sources of lightRohit Singh
 
M.Tech Voltage Reference Thesis Presentation
M.Tech Voltage Reference Thesis PresentationM.Tech Voltage Reference Thesis Presentation
M.Tech Voltage Reference Thesis PresentationRohit Singh
 
B.Tech Project Report
B.Tech Project ReportB.Tech Project Report
B.Tech Project ReportRohit Singh
 
B.Tech Industrial Training Report
B.Tech Industrial Training ReportB.Tech Industrial Training Report
B.Tech Industrial Training ReportRohit Singh
 

Mais de Rohit Singh (7)

Personality Development Presentation
Personality Development PresentationPersonality Development Presentation
Personality Development Presentation
 
A Report on State MachinesTiming Behavior and Data storage in hard disk drive
A Report on State MachinesTiming Behavior and Data storage in hard disk driveA Report on State MachinesTiming Behavior and Data storage in hard disk drive
A Report on State MachinesTiming Behavior and Data storage in hard disk drive
 
Microprocessor-Compatible Quadrature Decoder/Counter Design
Microprocessor-Compatible Quadrature Decoder/Counter DesignMicroprocessor-Compatible Quadrature Decoder/Counter Design
Microprocessor-Compatible Quadrature Decoder/Counter Design
 
LED & LASER sources of light
LED & LASER sources of lightLED & LASER sources of light
LED & LASER sources of light
 
M.Tech Voltage Reference Thesis Presentation
M.Tech Voltage Reference Thesis PresentationM.Tech Voltage Reference Thesis Presentation
M.Tech Voltage Reference Thesis Presentation
 
B.Tech Project Report
B.Tech Project ReportB.Tech Project Report
B.Tech Project Report
 
B.Tech Industrial Training Report
B.Tech Industrial Training ReportB.Tech Industrial Training Report
B.Tech Industrial Training Report
 

Último

Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 

Último (20)

Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 

FFT Implementation and Analysis in VHDL

  • 1. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 1 IMPLEMENTATION OF FAST FOURIER TRANSFORM Self Study Course By Rohit Singh Amit Kumar Singh (M.Tech (VST))
  • 2. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 2 Contents 1. Introduction to fast fourier transform ...………………… 03 2. Butterfly structures for FFT ...………………… 08 3. Implementation of 16-point FFT blocks …………………... 11 4. Matlab code for DFT …………………. 12 5. Matlab code for 8 point FFT …………………. 13 6. VHDL code for 16 point FFT Processor …………… 14
  • 3. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 3 1. INTRODUCTION TO FAST FOURIER TRANSFORM A Fast Fourier Transform (FFT) is an efficient algorithm to compute the Discrete Fourier Transform (DFT) and its inverse. There are many distinct FFT algorithms involving a wide range of mathematics, from simple complex-number arithmetic to group theory and number theory. The fast Fourier Transform is a highly efficient procedure for computing the DFT of a finite series and requires less number of computations than that of direct evaluation of DFT. It reduces the computations by taking advantage of the fact that the calculation of the coefficients of the DFT can be carried out iteratively. Due to this, FFT computation technique is used in digital spectral analysis, filter simulation, autocorrelation and pattern recognition. The FFT is based on decomposition and breaking the transform into smaller transforms and combining them to get the total transform. FFT reduces the computation time required to compute a discrete Fourier transform and improves the performance by a factor of 100 or more over direct evaluation of the DFT. A DFT decomposes a sequence of values into components of different frequencies. This operation is useful in many fields but computing it directly from the definition is often too slow to be practical. An FFT is a way to compute the same result more quickly: computing a DFT of N points in the obvious way, using the definition, takes O( N2 ) arithmetical operations, while an FFT can compute the same result in only O(N log N) operations. The difference in speed can be substantial, especially for long data sets where N may be in the thousands or millions—in practice, the computation time can be reduced by several orders of magnitude in such cases, and the improvement is roughly proportional to N /log (N). This huge improvement made many DFT-based algorithms practical. FFT’s are of great importance to a wide variety of applications, from digital signal processing
  • 4. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 4 and solving partial differential equations to algorithms for quick multiplication of large integers. The most well known FFT algorithms depend upon the factorization of N, but there are FFT with O (N log N) complexity for all N, even for prime N. Many FFT algorithms only depend on the fact that is an N th primitive root of unity, and thus can be applied to analogous transforms over any finite field, such as number-theoretic transforms. The Fast Fourier Transform algorithm exploit the two basic properties of the twiddle factor - the symmetry property and periodicity property which reduces the number of complex multiplications required to perform DFT. FFT algorithms are based on the fundamental principle of decomposing the computation of discrete Fourier Transform of a sequence of length N into successively smaller discrete Fourier transforms. There are basically two classes of FFT algorithms. A) Decimation In Time (DIT) algorithm B) Decimation In Frequency (DIF) algorithm. In decimation-in-time, the sequence for which we need the DFT is successively divided into smaller sequences and the DFTs of these subsequences are combined in a certain pattern to obtain the required DFT of the entire sequence. In the decimation-in- frequency approach, the frequency samples of the DFT are decomposed into smaller and smaller subsequences in a similar manner. The number of complex multiplication and addition operations required by the simple forms both the Discrete Fourier Transform (DFT) and Inverse Discrete Fourier Transform (IDFT) is of order N2 as there are N data points to calculate, each of which requires N complex arithmetic operations. The discrete Fourier transform (DFT) is defined by the formula:
  • 5. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 5 ; 2 1 0 )()( N nKj N n enxKX      Where K is an integer ranging from 0 to N − 1. The algorithmic complexity of DFT will O(N2 ) and hence is not a very efficient method. If we can't do any better than this then the DFT will not be very useful for the majority of practical DSP application. However, there are a number of different 'Fast Fourier Transform' (FFT) algorithms that enable the calculation the Fourier transform of a signal much faster than a DFT. As the name suggests, FFTs are algorithms for quick calculation of discrete Fourier transform of a data vector. The FFT is a DFT algorithm which reduces the number of computations needed for N points from O(N2 ) to O(N log N) where log is the base-2 logarithm. If the function to be transformed is not harmonically related to the sampling frequency, the response of an FFT looks like a ‘sinc’ function (sin x) / x. The Radix-2 DIT algorithm rearranges the DFT of the function xn into two parts: a sum over the even-numbered indices n = 2m and a sum over the odd-numbered indices n = 2m + 1:
  • 6. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 6 One can factor a common multiplier out of the second sum in the equation. It is the two sums are the DFT of the even-indexed part x2m and the DFT of odd-indexed part x2m + 1 of the function xn. Denote the DFT of the Even-indexed inputs x2m by Ek and the DFT of the Odd-indexed inputs x2m + 1 by Ok and we obtain: However, these smaller DFTs have a length of N/2, so we need compute only N/2 outputs: thanks to the periodicity properties of the DFT, the outputs for N/2 < k < N from a DFT of length N/2 are identical to the outputs for 0< k < N/2. That is, Ek + N / 2 = Ek and Ok + N / 2 = Ok. The phase factor exp[ − 2πik / N] called a twiddle factor which obeys the relation: exp[ − 2πi(k + N / 2) / N] = e − πiexp[ − 2πik / N] = − exp[ − 2πik / N], flipping the sign of the Ok + N / 2 terms. Thus, the whole DFT can be calculated as follows: This result, expressing the DFT of length N recursively in terms of two DFTs of size N/2, is the core of the radix-2 DIT fast Fourier transform. The algorithm gains its speed by re-using the results of intermediate computations to compute multiple DFT outputs. Note that final outputs are obtained by a +/− combination of Ek and Okexp( − 2πik / N), which is simply a size-2 DFT; when this is generalized to larger radices below, the size-2 DFT is replaced by a larger DFT (which itself can be evaluated with an FFT).
  • 7. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 7 This process is an example of the general technique of divide and conquers algorithms. In many traditional implementations, however, the explicit recursion is avoided, and instead one traverses the computational tree in breadth-first fashion. Fig 1.1 Decimation In Time FFT In the DIT algorithm, the twiddle multiplication is performed before the butterfly stage whereas for the DIF algorithm, the twiddle multiplication comes after the Butterfly stage. Fig 1.2 Decimation In Frequency FFT The 'Radix 2' algorithms are useful if N is a regular power of 2 (N=2p). If we assume that algorithmic complexity provides a direct measure of execution time and that the relevant logarithm base is 2 then as shown in table 1.1, ratio of execution times for the (DFT) vs. (Radix 2 FFT) increases tremendously with increase in N.
  • 8. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 8 The term 'FFT' is actually slightly ambiguous, because there are several commonly used 'FFT' algorithms. There are two different Radix 2 algorithms, the so- called 'Decimation in Time' (DIT) and 'Decimation in Frequency' (DIF) algorithms. Both of these rely on the recursive decomposition of an N point transform into 2 (N/2) point transforms. Number of Points, N Complex Multiplications in Direct computations, N2 Complex Multiplication in FFT Algorithm, (N/2) log2 N Speed improvement Factor 4 16 4 4.0 8 64 12 5.3 16 256 32 8.0 32 1024 80 12.8 64 4096 192 21.3 128 16384 448 36.6 Table 1.1: Comparison of Execution Times, DFT & Radix – 2 FFT 2. BUTTERFLY STRUCTURES FOR FFT Basically FFT algorithms are developed by means of divide and conquer method, the is depending on the decomposition of an N point DFT in to smaller DFT’s. If N is factored as N = r1,r2,r3 ..rL where r1=r2=…=rL=r, then rL =N. where r is called as Radix of FFT algorithm. If r= 2, then it is called as radix-2 FFT algorithm,. The basic DFT is of size of 2. The N point DFT is decimated into 2 point DFT by two ways such as Decimation In Time (DIT) and Decimation In Frequency (DIF) algorithm. Both the algorithm take the advantage of periodicity and symmetry property of the twiddle factor. N nKj enK N W   2
  • 9. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 9 The radix-2 decimation-in-frequency FFT is an important algorithm obtained by the divide and conquers approach. The Fig. 1.3 below shows the first stage of the 8-point DIF algorithm. Fig. 1.3 First Stage of 8 point Decimation in Frequency Algorithm. The decimation, however, causes shuffling in data. The entire process involves v = log2 N stages of decimation, where each stage involves N/2 butterflies of the type shown in the Fig. 1.3. Fig. 1.4: Butterfly Scheme.
  • 10. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 10 Here N nkj ek nW   2 is the Twiddle factor. Consequently, the computation of N-point DFT via this algorithm requires (N/2) log2 N complex multiplications. For illustrative purposes, the eight-point decimation-in frequency algorithm is shown in the Figure below. We observe, as previously stated, that the output sequence occurs in bit-reversed order with respect to the input. Furthermore, if we abandon the requirement that the computations occur in place, it is also possible to have both the input and output in normal order. The 8 point Decimation In frequency algorithm is shown in Fig 1.5. Fig. 1.5 8 point Decimation in Frequency Algorithm
  • 11. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 11 3. IMPLEMENTATION OF 16-POINT FFT BLOCKS The FFT computation is accomplished in three stages. The x(0) until x(15) variables are denoted as the input values for FFT computation and X(0) until X(15) are denoted as the outputs. The pipeline architecture of the 16 point FFT is shown in Fig 2.1 consisting of butterfly schemes in it. There are two operations to complete the computation in each stage. Fig 2.1: Architecture of 16 point FFT. The upward arrow will execute addition operation while downward arrow will execute subtraction operation. The subtracted value is multiplied with twiddle factor
  • 12. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 12 value before being processed into the next stage. This operation is done concurrently and is known as butterfly process. 4. Matlab Code for DFT % program to calculate DFT. clear all; clc; x=input ('enter the sequence '); tic N=size(x,2); w=zeros(N); for a=1:N for b=1:N w(a,b)=exp((-1j*2*pi*(a-1)*(b-1))/N); end end Xk = w*x'; Xk Toc
  • 13. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 13 5. Matlab Code for 8 point FFT % program to calculate 8 point FFT clear all; clc; x=input (' enter the sequence of length 8 '); tic s0=zeros(1,8); s1=zeros(1,8); s2=zeros(1,8); s3=zeros(1,8); N=size(x,2); if (N < 8 || N > 8) disp(' sequence is of not proper length '); else stage1=[1 1 1 0-1j 1 1 1 0-1j]; stage2=[1 1 1 1 1 0.707-0.707j 0-1j -0.707-0.707j]; p=[0:7]'; t=bitrevorder(p); % calculation of stage zero for i=1:N s0(i)=x(t(i)+1); end % calculation of stage one for i=1:2:N s1(i)=s0(i)+s0(i+1); s1(i+1)=s0(i)-s0(i+1); end for a=1:N s1(a)=s1(a)*stage1(a); end % calculation of stage two for i=1:4:N s2(i)=s1(i)+s1(i+2); s2(i+1)=s1(i+1)+s1(i+3); s2(i+2)=s1(i)-s1(i+2); s2(i+3)=s1(i+1)-s1(i+3); end for a=1:N s2(a)=s2(a)*stage2(a); end % calculation of stage three s3(1)=s2(1)+s2(5); s3(2)=s2(2)+s2(6); s3(3)=s2(3)+s2(7); s3(4)=s2(4)+s2(8); s3(5)=s2(1)-s2(5); s3(6)=s2(2)-s2(6); s3(7)=s2(3)-s2(7); s3(8)=s2(4)-s2(8); end disp(' FFT result '); s3 toc
  • 14. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 14 6. VHDL CODE FOR 16 POINT FFT PROCESSOR FFT MAIN PROGRAM library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_SIGNED.all; use IEEE.STD_LOGIC_ARITH.all; use work.fft_package.all; entity Parallel_FFT is Port ( x : in signed_vector; y : out comp_array); end Parallel_FFT; architecture Behavioral of Parallel_FFT is component real_input_to_complex is Port ( input_real : in signed_vector; input_comp : out comp_array); end component; component butterfly is port( c1,c2 : in complex; --inputs w :in complex; -- phase factor g1,g2 :out complex -- outputs
  • 15. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 15 ); end component; constant w : comp_array := ( ("0100000000000000", "0000000000000000"), ("0011101100100001", "1110011110000010"), ("0010110101000001", "1101001010111111"), ("0001100001111110", "1100010011011111"), ("0000000000000000", "1100000000000000"), ("1110011110000010", "1100010011011111"), ("1101001010111111", "1101001010111111"), ("1100010011011111", "1110011110000010"), ("1100000000000000", "0000000000000000"), ("1100010011011111", "0001100001111110"), ("1101001010111111", "0010110101000001"), ("1110011110000010", "0011101100100001"), ("0000000000000000", "0100000000000000"), ("0001100001111110", "0011101100100001"), ("0010110101000001", "0010110101000001"), ("0011101100100001", "0001100001111110") ); signal s, g1, g2, g3 : comp_array := (others => ("0000000000000000","0000000000000000"));
  • 16. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 16 begin --Real Input value transformed in complex value sixteen_bits_complex_transform : real_input_to_complex port map(x, s); --first stage of butterfly's. bf11 : butterfly port map(s(0),s(8),w(0),g1(0),g1(8)); bf12 : butterfly port map(s(1),s(9),w(1),g1(1),g1(9)); bf13 : butterfly port map(s(2),s(10),w(2),g1(2),g1(10)); bf14 : butterfly port map(s(3),s(11),w(3),g1(3),g1(11)); bf15 : butterfly port map(s(4),s(12),w(4),g1(4),g1(12)); bf16 : butterfly port map(s(5),s(13),w(5),g1(5),g1(13)); bf17 : butterfly port map(s(6),s(14),w(6),g1(6),g1(14)); bf18 : butterfly port map(s(7),s(15),w(7),g1(7),g1(15)); --second stage of butterfly's. bf21 : butterfly port map(g1(0),g1(4),w(0),g2(0),g2(4)); bf22 : butterfly port map(g1(1),g1(5),w(2),g2(1),g2(5)); bf23 : butterfly port map(g1(2),g1(6),w(4),g2(2),g2(6)); bf24 : butterfly port map(g1(3),g1(7),w(6),g2(3),g2(7)); bf25 : butterfly port map(g1(8),g1(12),w(0),g2(8),g2(12)); bf26 : butterfly port map(g1(9),g1(13),w(2),g2(9),g2(13));
  • 17. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 17 bf27 : butterfly port map(g1(10),g1(14),w(4),g2(10),g2(14)); bf28 : butterfly port map(g1(11),g1(15),w(6),g2(11),g2(15)); --third stage of butterfly's. bf31 : butterfly port map(g2(0),g2(2),w(0),g3(0),g3(2)); bf32 : butterfly port map(g2(1),g2(3),w(4),g3(1),g3(3)); bf33 : butterfly port map(g2(4),g2(6),w(0),g3(4),g3(6)); bf34 : butterfly port map(g2(5),g2(7),w(4),g3(5),g3(7)); bf35 : butterfly port map(g2(8),g2(10),w(0),g3(8),g3(10)); bf36 : butterfly port map(g2(9),g2(11),w(4),g3(9),g3(11)); bf37 : butterfly port map(g2(12),g2(14),w(0),g3(12),g3(14)); bf38 : butterfly port map(g2(13),g2(15),w(4),g3(13),g3(15)); --fourth stage of butterfly's. bf41 : butterfly port map(g3(0),g3(1),w(0),y(0),y(8)); bf42 : butterfly port map(g3(2),g3(3),w(0),y(4),y(12)); bf43 : butterfly port map(g3(4),g3(5),w(0),y(2),y(10)); bf44 : butterfly port map(g3(6),g3(7),w(0),y(6),y(14)); bf45 : butterfly port map(g3(8),g3(9),w(0),y(1),y(9)); bf46 : butterfly port map(g3(10),g3(11),w(0),y(5),y(13)); bf47 : butterfly port map(g3(12),g3(13),w(0),y(3),y(11));
  • 18. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 18 bf48 : butterfly port map(g3(14),g3(15),w(0),y(7),y(15)); end Behavioral; BUTTERFLY.VHD library IEEE; use IEEE.STD_LOGIC_1164.ALL; use work.fft_package.all; entity butterfly is port( c1,c2 : in complex; --inputs w :in complex; -- phase factor g1,g2 :out complex -- outputs ); end butterfly; architecture Behavioral of butterfly is begin --butterfly equations. g1 <= add(c1,c2);
  • 19. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 19 g2 <= mult(sub(c1,c2),w); end Behavioral; FFT PACKAGE library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_SIGNED.all; use IEEE.STD_LOGIC_ARITH.all; package fft_package is type complex is record r : signed(15 downto 0); i : signed(15 downto 0); end record; type signed_vector is array (0 to 15) of signed(7 downto 0); type comp_array is array (0 to 15) of complex; function add (n1,n2 : complex) return complex; function sub (n1,n2 : complex) return complex; function mult (n1,n2 : complex) return complex;
  • 20. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 20 end fft_package; package body fft_package is --addition of complex numbers function add (n1,n2 : complex) return complex is variable sum : complex; begin sum.r:=n1.r + n2.r; sum.i:=n1.i + n2.i; return sum; end add; --subtraction of complex numbers. function sub (n1,n2 : complex) return complex is variable diff : complex; begin diff.r:=n1.r - n2.r; diff.i:=n1.i - n2.i; return diff; end sub; --multiplication of complex numbers. function mult (n1,n2 : complex) return complex is
  • 21. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 21 variable prod : complex; variable prod_aux_r : signed(31 downto 0); variable prod_aux_i : signed(31 downto 0); begin prod_aux_r := (n1.r * n2.r) - (n1.i * n2.i); prod.r:= prod_aux_r(29 downto 14); prod_aux_i := (n1.r * n2.i) + (n1.i * n2.r); prod.i:= prod_aux_i(29 downto 14); return prod; end mult; end fft_package; REAL TO COMPLEX library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_SIGNED.all; use IEEE.STD_LOGIC_ARITH.all; use work.fft_package.all; entity real_input_to_complex is
  • 22. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 22 Port ( input_real : in signed_vector; input_comp : out comp_array); end real_input_to_complex; architecture Behavioral of real_input_to_complex is component sig_ext_8_to_16_bits is Port ( sig_in : in signed(7 downto 0); sig_out : out complex); end component; begin input0 : sig_ext_8_to_16_bits port map (input_real(0), input_comp(0)); input1 : sig_ext_8_to_16_bits port map (input_real(1), input_comp(1)); input2 : sig_ext_8_to_16_bits port map (input_real(2), input_comp(2)); input3 : sig_ext_8_to_16_bits port map (input_real(3), input_comp(3)); input4 : sig_ext_8_to_16_bits port map (input_real(4), input_comp(4)); input5 : sig_ext_8_to_16_bits port map (input_real(5), input_comp(5)); input6 : sig_ext_8_to_16_bits port map (input_real(6), input_comp(6)); input7 : sig_ext_8_to_16_bits port map (input_real(7), input_comp(7));
  • 23. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 23 input8 : sig_ext_8_to_16_bits port map (input_real(8), input_comp(8)); input9 : sig_ext_8_to_16_bits port map (input_real(9), input_comp(9)); input10 : sig_ext_8_to_16_bits port map (input_real(10), input_comp(10)); input11 : sig_ext_8_to_16_bits port map (input_real(11), input_comp(11)); input12 : sig_ext_8_to_16_bits port map (input_real(12), input_comp(12)); input13 : sig_ext_8_to_16_bits port map (input_real(13), input_comp(13)); input14 : sig_ext_8_to_16_bits port map (input_real(14), input_comp(14)); input15 : sig_ext_8_to_16_bits port map (input_real(15), input_comp(15)); end Behavioral; EIGHT TO SIXTEEN library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_SIGNED.all; use IEEE.STD_LOGIC_ARITH.all;
  • 24. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 24 use work.fft_package.all; entity sig_ext_8_to_16_bits is Port ( sig_in : in signed(7 downto 0); sig_out : out complex); end sig_ext_8_to_16_bits; architecture Behavioral of sig_ext_8_to_16_bits is signal sig_out_real : signed(15 downto 0); begin sig_out_real <= X"00" & sig_in when sig_in(7)='0' else X"ff" & sig_in ; sig_out <= (sig_out_real, "0000000000000000"); end Behavioral; TEST BENCH library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_SIGNED.all; use IEEE.STD_LOGIC_ARITH.all; use work.fft_package.all; ENTITY fft_cooley_tukey_tb IS END fft_cooley_tukey_tb;
  • 25. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 25 ARCHITECTURE behavior OF fft_cooley_tukey_tb IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT Parallel_FFT Port ( x : in signed_vector; y : out comp_array); END COMPONENT; --Inputs signal x : signed_vector:= (others => "00000000"); --Outputs signal y : comp_array; BEGIN -- Instantiate the Unit Under Test (UUT) uut: Parallel_FFT PORT MAP ( x => x, y => y ); -- Stimulus process stim_proc: process
  • 26. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 26 begin -- hold reset state for 100 ns. wait for 100 ns; -- x<=("00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001" -- ); -- x<=("00000000",
  • 27. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 27 -- "00000000", -- "00000000", -- "00000000", -- "00000000", -- "00000000", -- "00000000", -- "00000000", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001", -- "00000001" -- ); x<=("00000101", "00001010", "00001111", "00010100", "00011001", "00011110",
  • 28. .. Report by Rohit Singh and Amit Kumar Singh for Self –Study-Course, M.Tech. (VST), Deptt. Of EE,SOE, Shiv Nadar University 28 "00100011", "00101000", "00101101", "00110010", "00110111", "00111100", "01000001", "01000110", "01001011", "01010000" ); wait; end process; END;