summaryrefslogtreecommitdiff
path: root/692/CH3/EX3.15/P3_15.sce
blob: f9e52fd2888c53734e7f579c939e539c7f5cdd49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//EXAMPLE 3.15
//ENERGY OF A SIGNAL x[n]=a^n*u[n]
clc;
clear;
a=0.5;
n=0:0.1:9.9;
//x[n]=a^n*u[n]
for i = 0:length(n)
    x(i+1) = a^i;
    E=(abs(x))^2; 
end
Energy=sum(E);
disp(Energy,'Energy of the signal = ');