[LAD] Calculate R M S

From: Alfs Kurmis <kallipygos@email-addr-hidden>
Date: Wed Feb 16 2011 - 19:51:09 EET

 Hi Experts.
 I wanna normalize my sound stream by loudness (energy / pressure /
 intensity) , not by peaks.
 How i do it ?
 Is available Jack plugin for so what ?
 What is (we hear as) "loudness" ?
 RMS or +(average) or something else ?
 Is somewhere available examples how to calculate RMS ?
 Is it done simlpe by :
 &#160;int i, n;&#160; double sums, rms;
 &#160;sums=0.0;&#160; n=10;&#160; rms=0;
 &#160;for(i=0; i<n;i++)
 &#160;{&#160;&#160; sums = sums + ( (double)i * (double)i );&#160; }
 &#160;rms = sqrt(sums / n);
 &#160;printf("&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
 rms = %12.12fnn", rms );
 Is so sipmple algo good enough for frequencies > 10 kHz ?
 How to calculate RMS with hi-precision for frequencies > 10 kHz ?
 With inerpolation or so ?
 What is reference ( 0dB ) RMS for example for 16bit PCM signal 1024
 samples ?
 &#160; sqrt( 1024*(0x7FFF ^ 2) / 1024 )&#160; ==&#160; sqrt( (0x7FFF
 ^ 2)&#160; ) == 0x7FFF&#160;
 Is it simple&#160; 0x7FFF (32000 dec) ?
 How to calc RMS for stereo signal ?
 So , or somehow else ?
 for(i=0; i<n;i++)
 &#160;{&#160; ....
 &#160;&#160; sums = sampleL/2 + sampleR/2;
 &#160;}
 In case operating with float point, what should be a bit
 faster,&#160; / 2&#160; or * 0.5 ?
 How to gotta RMS value in dB ?
 &#160;&#160; 20 x log10(Measured/Reference0_dB)&#160;
 or 10 x log10(Measured/Reference0_dB)&#160; ??
 Im just physics student and im new in DSP,
 so pleaz no angree about simple or stuppid questions.
 Any examples and hints welcomed.
 Many Tnx in advance.
 Alf
  ----

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Wed Feb 16 20:15:08 2011

This archive was generated by hypermail 2.1.8 : Wed Feb 16 2011 - 20:15:08 EET