[music-dsp] how to compute rms value?

Alex Nagel mcnail at gmx.net
Wed Dec 4 20:48:01 EST 2002


hi everyone!

i've been reading this list for quite a long time, but haven't had too much
time for actual developping or programming. but now i've finally got started
again and have to bother you with some newbie stuff. please forgive me :-)

my question: :in theory, it's quite understandable to me how to compute the
rms value. in matlab code this would be something like:

rmsvalue=sqrt(sum(vector.^2)/(number_of_samples))

but how to implement this? let's assume i have a buffer of 100 samples.
do i now...

a) execute this operation for sample #1 to  #10, then for sample #11 to #20,
for #21 to #30 and so on

or

b) execute this operation for sample #1 to  #10, then #2 to #11, then #3 to
#12 etc.

version b) seems more correct and "scienticifically based" (can you say
that?), but a) executes much faster, and its output -depending on the
incoming signal- doesn't differ too much from that which b) produces.

maybe someone has some hints for me on this matter. i've already had a look
at the musicdsp.org archieves, but found nothing helpful.

regards, alex




More information about the music-dsp mailing list