git-svn-id: http://moon:8086/svn/matlab/trunk@153 801c6759-fa7c-4059-a304-17956f83a07c
13 lines
210 B
Matlab
Executable File
13 lines
210 B
Matlab
Executable File
% Power estimation on discrete signals
|
|
function y = rms(x,Nw)
|
|
|
|
N = length(x);
|
|
y = zeros(1,N);
|
|
|
|
y(1) = x(1)^2;
|
|
|
|
for k = 2:N-Nw,
|
|
for n = k:Nw+k,
|
|
y(n) = y(n-1)*(1-1/Nw) + 1/Nw*x(n)^2;
|
|
end;
|
|
end; |