%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% file: sigEnergy.m
% author: Jakob Möderl
% date: 03.11.2023
% description:
%   function SIGENERGY
%   Es = sigEnergy(sample) calculates the signal energy of the provided
%   sample as Es = sum(abs(sample).^2) over the first two dimensions of the
%   sample.

function Es = sigEnergy(sample)
    Es = squeeze(sum(abs(sample).^2, [1,2]));
end