summaryrefslogtreecommitdiff
path: root/2048/CH3/EX3.1/energy.sce
diff options
context:
space:
mode:
Diffstat (limited to '2048/CH3/EX3.1/energy.sce')
-rwxr-xr-x2048/CH3/EX3.1/energy.sce8
1 files changed, 8 insertions, 0 deletions
diff --git a/2048/CH3/EX3.1/energy.sce b/2048/CH3/EX3.1/energy.sce
new file mode 100755
index 000000000..ca16729bd
--- /dev/null
+++ b/2048/CH3/EX3.1/energy.sce
@@ -0,0 +1,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));