function window = hamming_window(num_samples, data)

    % loop over all data
    %
    for samp_num = 1:num_samples

      % store the sample data
      %
      x_n = data(samp_num);

      % multiply by the window function
      %
      x_hamm_n = x_n * (.54 - (.46 * cos(2*pi * (samp_num-1) /(num_samples - 1))));

      % store the windowed data
      %
      window(samp_num) = x_hamm_n;
   
  end
