% file: compute_energy.m
%
% this function computes the energy of the data passed in
%
% argument:
%  data		array of data
%
% return:
%  the energy of the data passed in
%

function energy = compute_energy(data)

% determine how many samples are in the data array
%
len = length(data);

% initialize energy to zero
%
energy = 0;

% compute the energy (sum of the squares)
%
for i = 1:len
   energy = energy + (data(i))^2;
end

