can any one explain sum(sa1.^2) and unit energy

b=randint(1,n);
f1=1;f2=2;
t=0:1/30:1-1/30;
%ASK
sa1=sin(2*pi*f1*t);
E1=sum(sa1.^2);
sa1=sa1/sqrt(E1); %unit energy
sa0=0*sin(2*pi*f1*t);

Answers (1)

break it down into components:
sa1 %variable or function with no inputs and at least one output
sa1.^2 %sa1 squared element by element
sum(sa1.^2) %the sum of the above

Asked:

on 9 Sep 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!