Question

I am trying to calculate the rms of some 2D matices, but am unsure if my approach is correct:

Rrms = sqrt( sum(sum((Z1 - mean(mean(Z1))).^2 )) /(wk*wl) )

(where Z1 is a matrix with size wk * wl)

Is this correct, and if not, what should I use?

Was it helpful?

Solution

According to Root Mean Square definition it's just square root of sum of squared values. In terms of Matlab code it will be.

R = sqrt(sum(sum(Z.^2))/prod(size(Z)))

Another way is to use rms function from signal processing toolbox.

OTHER TIPS

I'm not sure if this request is obsolete. However, try

Rrms = rms(Z1(:))

In any case, the (:)-operator helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top