summaryrefslogtreecommitdiff
path: root/2048/CH3/EX3.1/energy.sce
blob: ca16729bddf821233490d5ebc5bf0b7d7b786593 (plain)
1
2
3
4
5
6
7
8
// Energy of a signal
// 3.1

u = [4 5 6];
Eu = norm(u)^2;
ruu = xcorr(u);
Lu = length(ruu);
Eu = ruu(ceil(Lu/2));