- After sending my post I just realized that you already got more answers than expected while I was still writing. Here is my version, please excuse if great parts are double, but as I had promised, in the Nyquist section of the forum your question will be found by more people than under “Adding new Features”…
To display the RMS value of an Audacity audio track in the same audio track, select the entire signal in the audio track, then in the Audacity “Effect” menu, open the “Nyquist Prompt” (German Audacity: Nyquist Eingabeaufforderung), and copy the following code into the text field of the “Nyquist Prompt” window, then click “OK”.
For a mono audio track use this code:
(force-srate *sound-srate* (rms s 20))
For a stereo audio track (like the signal in your WAV file), use this code:
(force-srate *sound-srate* (multichan-expand #'rms s 20))
The waveform in the audio track should be replaced by the RMS value afterwards.
If you want two audio tracks, one with the unprocessed original signal and one with the RMS value, then you must duplicate the original track with “Edit > Duplicate” (German Audacity: "Bearbeiten > In neue Tonspur kopieren) to get two identical audio tracks and then use the code from the “Nyquist Prompt” on only one of these tracks.
Explanation of the Nyquist code:
The RMS function is described under http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index532
The s after rms in (rms s 20) ist the audio signal of the Audacity track. The s variable contains a pointer to the first block of samples. The processing of the audio samples works automatically, you only need to care about the other parameters.
50 milliseconds = 0.05 seconds, where 1/0.05 seconds = 20 Hertz. That’s where the 20 in (rms s 20) come from.
(rms s 20) produces a 20Hz signal, containing the RMS values of blocks of samples contained in 50 milliseconds each. Because Nyquist can’t change the Audacity track sample frequency, the 20Hz RMS signal must be transformed back to the Audacity track sample frequency (usually 44100Hz), that is stored in the sound-srate variable. Using the sound-srate variable instead of a hardcoded frequency value will work with all track sample frequencies automatically, not only with 44100Hz.
(Only for stereo tracks: The MULTICHAN-EXPAND macro is not described in the Nyquist manual, but in the Audacity Wiki under “Nyquist Plug-ins Reference > Stereo Tracks” is explained how it works.)
The FORCE-SRATE function is described under http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index327
The force-srate function transforms the 20Hz RMS signal back into the Audacity track sample frequency, so it is displayed in the correct time units (seconds), according to the (visual) length of the original signal. The transformed signal then replaces the original signal in the Audacity audio track.
I will look-up now how to write these values into a CSV file for Excel…