Skip to content

Algorithms | latest | peak-amplitude

Peak amplitude

The peak amplitude is the maximum absolute amplitude of a signal.

PeakAmplitude=max|x|

Code

INFO

The following snippet is written in a generic and unoptimized manner. The code aims to be comprehensible to programmers familiar with various programming languages and may not represent the most efficient or idiomatic Python practices. Please refer to implementations for optimized implementations in different programming languages.

py
import numpy as np


def peak_amplitude(signal: np.ndarray) -> float:
    return np.max(np.abs(signal))
Run in playground