Energy
The energy of a signal is defined as the integral of its squared values over time. For discrete signals, this is expressed as:
where:
is the sampling interval, is the sampling rate.
References
- German Institute for Standardization. (2016). Non-destructive testing - Terminology - Part 9: Terms used in acoustic emission testing (DIN EN 1330-9:2016). Beuth Verlag.
- American Society for Testing and Materials. (2017). Standard terminology for nondestructive examinations (ASTM E1316-17). ASTM International. https://doi.org/10.1520/E1316-17
- https://en.wikipedia.org/wiki/Energy_(signal_processing)
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 energy(signal: np.ndarray, samplerate: float) -> float:
return 1 / samplerate * np.sum(signal**2)