Documente Academic
Documente Profesional
Documente Cultură
ABSTRACT
This paper proposes the generation of the code for the X(n) = k=0 N-1 x(k)e-j2nk/N n=0, 1,…..N-1
algorithm of 1D and 2D FFT and the methods for the (1.1)
recognition of faces using various methods of Joint Transform
Correlation techniques. Various codes were written in Eq (1.1) describes the computation of N equations. For eg. If
MATLAB for the correlation and recognition of various N=4 and we let
images. Comparison between DFT and FFT Computation
Speeds is made in this paper From results it is evident that for W= e-j2n/N
a couple of samples of various lengths the time taken by normal (1.2)
DFT is higher than the time taken by FFT. Thus the speed of Then Eq (1.1) can be written as
FFT is beneficial when large calculations are required.
X (0) = x (0) W0 + x (1) W0 + x (2) W0 + x (3) W0
1. INTRODUCTION
FFT is simply an algorithm (i.e., a particular method of X (1) = x (0) W0 + x (1) W1 + x (2) W2 + x (3) W3
performing a series of computations) that can compute the
discrete Fourier transform much more rapidly than other X (2) = x (0) W0 + x (1) W2 + x (2) W4 + x (3) W6
available algorithms. For this reason, our discussion of the FFT (1.3)
addresses only the computational aspect of the algorithm. A
DFT decomposes a sequence of values into components of X (3) = x (0) W0 + x (1) W3 + x (2) W6 + x (3) W9
different frequencies. This operation is useful in many fields
(see discrete Fourier transform for properties and applications The above equations can be represented in the matrix form.
of the transform) but computing it directly from the definition
is often too slow to be practical. An FFT is a way to compute 3. PROPOSED ALGORITHM
the same result more quickly: computing a DFT of N points in By far the most common FFT is the Cooley-Tukey algorithm.
the obvious way, using the definition, takes O(N 2) arithmetical This is a divide and conquer algorithm that recursively breaks
operations, while an FFT can compute the same result in only down a DFT of any composite size N = N1N2 into many smaller
O(N log N) operations. DFTs of sizes N1 and N2, along with O(N) multiplications by
The difference in speed can be substantial, especially for long complex roots of unity traditionally called twiddle factors (after
data sets where N may be in the thousands or millions—in Gentleman and Sande, 1966). This method (and the general
practice, the computation time can be reduced by several orders idea of an FFT) was popularized by a publication of J. W.
of magnitude in such cases, and the improvement is roughly Cooley and J. W. Tukey in 1965, but it was later discovered
proportional to N/log(N). This huge improvement made many (Heideman & Burrus, 1984) that those two authors had
DFT-based algorithms practical; FFTs are of great importance independently re-invented an algorithm known to Carl
to a wide variety of applications, from digital signal processing Friedrich Gauss around 1805 (and subsequently rediscovered
and solving partial differential equations to algorithms for several times in limited forms).
quick multiplication of large integers. A simple matrix- The most well-known use of the Cooley-Tukey algorithm is to
factoring example is used to intuitively justify the FFT divide the transform into two pieces of size N / 2 at each step,
algorithm. The factored matrices are alternatively represented and is therefore limited to power-of-two sizes, but any
by signal flow graphs. From these graphs, we construct the factorization can be used in general (as was known to both
logic of an FFT computer program theoretical development of Gauss and Cooley/Tukey). These are called the radix-2 and
various forms of the FFT algorithm. mixed-radix cases, respectively (and other variants such as the
split-radix FFT have their own names as well). Although the
basic idea is recursive, most traditional implementations
2. MATRIX FORMULATION rearrange the algorithm to avoid explicit recursion. Also,
The discrete Fourier transform is given by: because the Cooley-Tukey algorithm breaks the DFT into
FFT Computation Flowchart: vector x(k) is assumed to be complex and is indexed as k=0,1,
Using the discussed properties of the FFT we can easily … N-1. if x(k) is real then the imaginary part should be set to
develop a flowchart for programming the algorithm on a digital zero. The number of sample points must satisfy the relationship
computer. N= 2 where is integer valued.
We know from the previous discussions that we first compute Initialization of the various program parameters is
array l=1 by starting at node k=0 and working down the array. accomplished in Box 2. Parameter l is the array number being
At each node k, we compute the pair of eq(1.4) where p is considered. We start with array l=1,N2= N/2 is initialized as
determined by the described procedure. We continue down the such. Parameter NU1 is the right shift required when
array computing the equation pair of eq(1.4) until we reach a determining the value of p in eq(1.4); NU1 is initialized to -1.
region of nodes that must be skipped over. We skip over the The index k of the array is initialized to k=0 ; thus we will
appropriate nodes and continue until the new have computed work from the top and progress down the array.
the entire array. We then proceed to compute the remaining
arrays using the same procedures. Finally, we unscramble the
final array to obtain the output.
Figure(c)
Box3 checks to see if the array l to be computed is greater than
. If yes, then the program branches to box23 to unscramble the
computed results by bit inversion. If all arrays have not been
computed, then we proceed to Box 4. Box 4 sets a counter I=1.
This counter monitors the number of dual node pairs that have
been considered. Since it is necessary to skip certain nodes in
order to ensure that previously considered nodes are not
encountered a second time, Counter I is the control for
determining the when the program must skip. Boxes 5 and 6
perform the computation of eq(1.4). Because k and I have been
initialized to 0 and 1, respectively, the initial node considered is
the first node of the first array. To determine the factor p for
this node, we must first scale the binary number k to the right
by -1 bits. To accomplish this, we compute the integer value
of k/ 2NU1 and set the result to M as shown in box 5. According
to the procedure for determining the p, we must bit reverse M,
where M is represented by = NU bits. The function IBR(M)
Figure (b1) denoted by box 5 is a special function routine for bit inversion.
Figure (c) represents the flowchart of the computer
programming. Box1 describes the necessary input data. Data
This gives us the output. Hence we can see that for the From table 1 we can see that for a couple of samples of various
computation of 2D- FFT we take the 1D-FFT twice. lengths the time taken by normal DFT is higher than the time
taken by FFT.
Code For 2D-FFT Function: Thus the speed of FFT is beneficial when large calculations are
required.
The code for a 2D FFT function is generated in MATLAB is
shown below. REFERENCES
[1] M.S. Alam, O. Perez and M. A. Karim ―Preprocessed
function x =FFT2_func(x) multiobject joint transform correlators,‖ Appl. Opt. 32(17),
a=size(x); 3102-3107(1993).
R=a(1); [2] S. Zhong, j. Jiang, S. Liu, and C. Li. ―Binary joint transform
C=a(2); correlators based in differential processing of the joint
for k=0:R-1 %%%%%Row wise FFT%%%%%