DSPRelated.com
Code

Function used to calculate average power

Senthilkumar December 28, 2011 Coded in Scilab

This function sholud be used along with funciton adapt_filt

function[y]= pow_1(x,N)
    xold = 0.0;
    for n =1:N
        sumx = xold+(x(n)^2);
        xold = sumx;
    end
    y = sumx/N;
endfunction