function [ F_Array ] = HW7_dft( Array )
%   The input is a one dimensional array.
%   This function calculates the DFT of a 1D array.

   M = max(size(Array)); %finding the number of components
   u = (0:M-1); %discrete frequencies
   m = (0:M-1); %components indices
   F_Array = zeros(1,M); 
   %finding DFT
   for ii = 1:M
       F_Array(ii) = sum(Array.*exp(-2*pi*i*m*u(ii)/M));
   end
   
end

