Csound Csound-dev Csound-tekno Search About

Re: Operation of the rms opcode

Date2005-11-05 18:55
FromVictor Lazzarini
SubjectRe: Operation of the rms opcode
The rms operation is well explained in Dodge & Jerse.
Perhaps we can add references to such books in the manual.

Victor

>
> The internal operation is NOT different from how the
> majority of RMS   meters work. For a finite-length signal
> you can get the single value   of the RMS by taking the
> square root of the average of the square of   the values
> in the signal. Once you ask the question, "How is the RMS
> changing with time?" you can no longer answer the question
> with the   usual definition, but have to take into account
> the time scale   (frequency components) of the changes you
> want to see and the time   scale (frequency components) of
> the original signal. You then have to   take a portion of
> the signal, window it, and take the RMS of the   windowed
> section, or you can lowpass filter the square of the
> signal   and take the square root of the output of the
> lowpass filter, which   is what CSound (like most
> commercial instruments) does.
>
> It would be nice if the CSound manual could teach signal
> processing   as well as explain how to use the opcodes,
> but that might be a bit   much for the maintainers.
> Perhaps references to other sites that   explain the
> theory would be a good compromise.
>
> On Nov 5, 2005, at 7:47 AM, Tetsuya Miwa wrote:
>
> > I did not understand what "special internal low-pass
> > filter" in the   manual meant, but now it's clear !
> >
> > These internal operation is different from mathematical
> > definition   of RMS.
> >
> > Please put these infomation in the manual.
> >
> >
> > Thanks,
> > tetsuya
> >
> >
> > On 2005/11/04, at 9:50, Richard M. Otero wrote:
> >
> >> Just trying to organize my thoughts a little bit.  Is
> this correct: >>
> >> RMS = sqrt(y[n])
> >>
> >> where:
> >> y[n] = c1*x[n]^2 - c2*y[n-1]
> >> c1 = 1 + c2
> >> c2 = sqrt(a^2 - 1) - a
> >> a = 2 - cos(2pi*ihp/sr)
> >>
> >> -Rich
> >>
> >> On Oct 28, 2005, at 4:13 AM, Istvan Varga wrote:
> >>
> >>> jpff@codemist.co.uk wrote:
> >>>
> >>>> It does not just look at the current cycle for rms.
> It is >>>> calculating
> >>>>         r = (1-c) * sig^2 + c * r
> >>>> and returns sqrt(r)
> >>>> The filter coefficients are     b = 2 -
> cos(2pi*ihp/sr) >>>>     c = b-sqrt(b^2-1)
> >>>> The value ihp is user selectable, and defaults to 10.
> >>>
> >>> So, in short, the rms opcode applies the "tone" filter
> to asig^2, >>> and returns the square root of the filter
> output. >>> --
> >>> Send bugs reports to this list.
> >>> To unsubscribe, send email to
> csound-unsubscribe@lists.bath.ac.uk >>>
> >>
> >> --
> >> Send bugs reports to this list.
> >> To unsubscribe, send email to
> csound-unsubscribe@lists.bath.ac.uk >>
> >
> > --
> > Send bugs reports to this list.
> > To unsubscribe, send email to
> csound-unsubscribe@lists.bath.ac.uk
>
> ----
> Prof. R. Erik Spjut (spyoot rhymes with cute)
> Engineering Department, Harvey Mudd College, Claremont, CA
> 91711 erik_spjut@hmc.edu   Ph. (909) 607-3890  Fax (909)
> 621-8967
>
>
> --
> Send bugs reports to this list.
> To unsubscribe, send email to
> csound-unsubscribe@lists.bath.ac.uk