aboutsummaryrefslogtreecommitdiff
path: root/pyecsca/combine.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyecsca/combine.py')
-rw-r--r--pyecsca/combine.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/pyecsca/combine.py b/pyecsca/combine.py
index 4b29f8c..c484748 100644
--- a/pyecsca/combine.py
+++ b/pyecsca/combine.py
@@ -7,6 +7,12 @@ from .trace import Trace, CombinedTrace
@public
def average(*traces: Trace) -> Optional[CombinedTrace]:
+ """
+ Average `traces`, sample-wise.
+
+ :param traces:
+ :return:
+ """
if not traces:
return None
if len(traces) == 1:
@@ -18,11 +24,24 @@ def average(*traces: Trace) -> Optional[CombinedTrace]:
@public
def conditional_average(*traces: Trace, condition: Callable[[Trace], bool]) -> Optional[CombinedTrace]:
+ """
+ Average `traces` for which the `condition` is True, sample-wise.
+
+ :param traces:
+ :param condition:
+ :return:
+ """
return average(*filter(condition, traces))
@public
def standard_deviation(*traces: Trace) -> Optional[CombinedTrace]:
+ """
+ Compute the standard-deviation of the `traces`, sample-wise.
+
+ :param traces:
+ :return:
+ """
if not traces:
return None
dtype = traces[0].samples.dtype