Qu

peak

Builtin index · Core maths

result = peak(x)

Input: x · Output: result

What it is

max(abs(x)) over every element of x — a scalar, Vec, or Mat/Signal, flattened.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = peak(x)
x scalar, Vec, Mat, or Signalnot documented yet
result scalar, Num, vector, or Signal
Returns a scalar Num. Errors on an empty vector. With three arguments, peak(f0, q, fs) designs a resonator filter instead: see notch in Signal Processing.

Examples

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

How it works

peak(x) -- max(abs(x)), named separately from rms because crest_factor below is defined as their ratio and reads better spelled out than as two nested calls.

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