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

y = zeros(5,1);
x = x(ip);                                        % input permutation
x(2:5) = KRED([2],[2],1,x(2:5));                  % 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 : 4 -------------------------------------------------
v = ID2I(1,1,x(4:5));              % v = (I(1) kron D2 kron I(1)) * x(4:5)
v = v.*u(3:5);                          
y(4:5) = ID2tI(1,1,v);             % y(4:5) = (I(1) kron D2' kron I(1)) * v
% --------------------------------------------------------------------------------
y(2) = y(1)+y(2);                                 % DC term calculation
y(2:5) = tKRED([2],[2],1,y(2:5));                 % transpose reduction operations
y = y(op);                                        % output permutation

% For complex data - 
% Total Number of Real Multiplications : 10
% Total Number of Real Additions: 34

