Qu

crest_factor

Builtin index · Core maths

result = crest_factor(x)

Input: x · Output: result

What it is

peak(x) / rms(x), a dimensionless ratio (a sine wave's is sqrt(2) ≈ 1.414) — the same quantity sinad_estimate(bits, crest_factor) takes as its second argument. x is a scalar, Vec, or Mat/Signal, flattened.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = crest_factor(x)
x scalar, Vec, Mat, or Signalnot documented yet
result scalar, Num, or vector
Returns a scalar Num. Errors on an empty vector or one whose RMS is zero (silence has no crest factor).

Examples

No documentation example calls this form yet. The Core maths chapter is where one belongs.

How it works

crest_factor(x) = peak(x) / rms(x), a dimensionless ratio (a sine's is sqrt(2)) -- the same quantity sinad_estimate(bits, crest_factor) already takes as its second argument.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.