function y = fft7(x,u)
% y = fft7(x,u)
% y : the 7 point DFT of x 
% where u is a vector of precomputed multiplicative constants

x = rp(7,3,x);                                    % Rader's permutation
x(2:7) = pfp([2,3],2,x(2:7));                     % prime factor permuation
x(2:7) = KRED([2,3],[1,1],2,x(2:7));              % reduction operations (14 Additions)
y = zeros(7,1);
y(1) = x(1)+x(2);                                 % DC term calculation (1 Addition)

% -------------------------- block : 1 --------------------------
y(2) = x(2)*u(1);                       % 1 Multiplication
% -------------------------- block : 2 --------------------------
y(3) = x(3)*u(2);                       % 1 Multiplication
% -------------------------- block : 3 --------------------------
v = ID2I(1,1,x(4:5));         % v = (I(1) kron D2 kron I(1)) * x(4:5)           a : 1=1*1
v = v.*u(3:5);                          % 3 Multiplications
y(4:5) = ID2tI(1,1,v);        % y(4:5) = (I(1) kron D2' kron I(1)) * v          a : 2=1*2
% -------------------------- block : 6 = 2 * 3 --------------------------
v = ID2I(1,1,x(6:7));         % v = (I(1) kron D2 kron I(1)) * x(6:7)           a : 1=1*1
v = v.*u(6:8);                          % 3 Multiplications
y(6:7) = ID2tI(1,1,v);        % y(6:7) = (I(1) kron D2' kron I(1)) * v          a : 2=1*2

y(2) = y(1)+y(2);                                 % DC term calculation (1 Addition)
y(2:7) = tKRED([2,3],[1,1],2,y(2:7));             % transpose reduction operations (14 Additions)
y(2:7) = pfpt([2,3],2,y(2:7));                    % prime factor permuation
y(2:7) = y(7:-1:2);                               % reversal permutation
y = rpt(7,5,y);                                   % Rader's permutation transpose

% For complex data - 
% Total Number of Real Multiplications : 16
% Total Number of Real Additions: 72

