function dft_data = dft(data, num_samples) 

   % loop over all frequency bins
   %
   for i = 1:num_samples

      k=i-1;
      % declare local accumulators
      %
      sumr = 0.0;
      sumi = 0.0;

      % loop over all time samples
      %
      for j = 1: num_samples
      
         n=j-1;
         % compute the argument
         %
         arg = 2*pi*n*k / num_samples;

         % compute the real part
         %
         sumr = sumr + data(j) * cos(arg);

         % compute the imaginary part
         %
         sumi = sumi - data(j) * sin(arg);
      end

      % store the frequency value in magnitude form
      %
      dft_data(i) = sqrt((sumr^2) + (sumi^2));
   end


