final case class Crest(rate: Rate, in: GE, length: GE = 400, gate: GE = 1.0f) extends SingleOut with Product with Serializable
A UGen that measures the "crest factor" of a time-domain signal. The "crest factor" is the ratio of the absolute peak to the absolute mean over a certain time period. In pseudocode:
crest = (samples.abs.max) / (samples.abs.mean)
For Pulse
waves the value will be 1, because the mean and the maximum are the
same. For SinOsc
, the theoretical value is 2.sqrt
. For Saw
it is
3.sqrt
. These exact values might not occur in practice, because of
anti-aliasing and other sampling factors.
This is not to be confused with FFTCrest
which does the same thing for
spectral data.
This is a third-party UGen (MCLDUGens).
- in
signal to analyze, can be audio rate or control rate
- length
number of samples over which to take the measurement. A buffer of this size is created internally (so be careful about specifying a massive number here). (init-time only)
- gate
normally the statistic is calculated on every control block cycle. If one wants it less often (e.g. to reduce CPU usage), one can modulate this – calculation only occurs if gate is greater than zero.
- Alphabetic
- By Inheritance
- Crest
- Serializable
- SingleOut
- SomeOut
- Lazy
- GE
- UGenSource
- Expander
- Lazy
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Crest(rate: Rate, in: GE, length: GE = 400, gate: GE = 1.0f)
- in
signal to analyze, can be audio rate or control rate
- length
number of samples over which to take the measurement. A buffer of this size is created internally (so be careful about specifying a massive number here). (init-time only)
- gate
normally the statistic is calculated on every control block cycle. If one wants it less often (e.g. to reduce CPU usage), one can modulate this – calculation only occurs if gate is greater than zero.