function y = fft71(x,u,ip,op)
% y = fft71(x,u,ip,op)
% y  : the 71 point DFT of x 
% u  : a vector of precomputed multiplicative constants
% ip : input permutation
% op : ouput permutation

y = zeros(71,1);
x = x(ip);                                        % input permutation
x(2:71) = KRED([2,5,7],[1,1,1],3,x(2:71));        % reduction operations
y(1) = x(1)+x(2);                                 % DC term calculation
% -------------------- block : 1 -------------------------------------------------
y(2) = x(2)*u(1);                       
% -------------------- block : 2 -------------------------------------------------
y(3) = x(3)*u(2);                       
% -------------------- block : 5 -------------------------------------------------
v = ID2I(1,2,x(4:7));              % v = (I(1) kron D2 kron I(2)) * x(4:7)
v = ID2I(3,1,v);                   % v = (I(3) kron D2 kron I(1)) * v
v = v.*u(3:11);                         
v = ID2tI(1,3,v);                  % v = (I(1) kron D2' kron I(3)) * v
y(4:7) = ID2tI(2,1,v);             % y(4:7) = (I(2) kron D2' kron I(1)) * v
% -------------------- block : 10 = 2 * 5 ----------------------------------------
v = ID2I(1,2,x(8:11));             % v = (I(1) kron D2 kron I(2)) * x(8:11)
v = ID2I(3,1,v);                   % v = (I(3) kron D2 kron I(1)) * v
v = v.*u(12:20);                        
v = ID2tI(1,3,v);                  % v = (I(1) kron D2' kron I(3)) * v
y(8:11) = ID2tI(2,1,v);            % y(8:11) = (I(2) kron D2' kron I(1)) * v
% -------------------- block : 7 -------------------------------------------------
v = ID3I(2,1,x(12:17));            % v = (I(2) kron D3 kron I(1)) * x(12:17)
v = ID2I(1,5,v);                   % v = (I(1) kron D2 kron I(5)) * v
v = v.*u(21:35);                        
v = ID2tI(1,5,v);                  % v = (I(1) kron D2' kron I(5)) * v
y(12:17) = ID3tI(2,1,v);           % y(12:17) = (I(2) kron D3' kron I(1)) * v
% -------------------- block : 14 = 2 * 7 ----------------------------------------
v = ID3I(2,1,x(18:23));            % v = (I(2) kron D3 kron I(1)) * x(18:23)
v = ID2I(1,5,v);                   % v = (I(1) kron D2 kron I(5)) * v
v = v.*u(36:50);                        
v = ID2tI(1,5,v);                  % v = (I(1) kron D2' kron I(5)) * v
y(18:23) = ID3tI(2,1,v);           % y(18:23) = (I(2) kron D3' kron I(1)) * v
% -------------------- block : 35 = 5 * 7 ----------------------------------------
v = ID3I(8,1,x(24:47));            % v = (I(8) kron D3 kron I(1)) * x(24:47)
v = ID2I(1,20,v);                  % v = (I(1) kron D2 kron I(20)) * v
v = ID2I(3,10,v);                  % v = (I(3) kron D2 kron I(10)) * v
v = ID2I(9,5,v);                   % v = (I(9) kron D2 kron I(5)) * v
v = v.*u(51:185);                       
v = ID2tI(1,45,v);                 % v = (I(1) kron D2' kron I(45)) * v
v = ID2tI(2,15,v);                 % v = (I(2) kron D2' kron I(15)) * v
v = ID2tI(4,5,v);                  % v = (I(4) kron D2' kron I(5)) * v
y(24:47) = ID3tI(8,1,v);           % y(24:47) = (I(8) kron D3' kron I(1)) * v
% -------------------- block : 70 = 2 * 5 * 7 ------------------------------------
v = ID3I(8,1,x(48:71));            % v = (I(8) kron D3 kron I(1)) * x(48:71)
v = ID2I(1,20,v);                  % v = (I(1) kron D2 kron I(20)) * v
v = ID2I(3,10,v);                  % v = (I(3) kron D2 kron I(10)) * v
v = ID2I(9,5,v);                   % v = (I(9) kron D2 kron I(5)) * v
v = v.*u(186:320);                      
v = ID2tI(1,45,v);                 % v = (I(1) kron D2' kron I(45)) * v
v = ID2tI(2,15,v);                 % v = (I(2) kron D2' kron I(15)) * v
v = ID2tI(4,5,v);                  % v = (I(4) kron D2' kron I(5)) * v
y(48:71) = ID3tI(8,1,v);           % y(48:71) = (I(8) kron D3' kron I(1)) * v
% --------------------------------------------------------------------------------
y(2) = y(1)+y(2);                                 % DC term calculation
y(2:71) = tKRED([2,5,7],[1,1,1],3,y(2:71));       % transpose reduction operations
y = y(op);                                        % output permutation

% For complex data - 
% Total Number of Real Multiplications : 640
% Total Number of Real Additions: 3112

