Files
matlab/common/statistic/rms.m
T
2022-06-30 13:32:40 +02:00

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;