summaryrefslogtreecommitdiff
path: root/pyspike/DiscreteFunc.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyspike/DiscreteFunc.py')
-rw-r--r--pyspike/DiscreteFunc.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pyspike/DiscreteFunc.py b/pyspike/DiscreteFunc.py
index 4fd496d..9cc7bd5 100644
--- a/pyspike/DiscreteFunc.py
+++ b/pyspike/DiscreteFunc.py
@@ -176,7 +176,7 @@ expected."
multiplicity = 1.0
return (value, multiplicity)
- def avrg(self, interval=None):
+ def avrg(self, interval=None, normalize=True):
""" Computes the average of the interval sequence:
:math:`a = 1/N \\sum f_n` where N is the number of intervals.
@@ -189,7 +189,10 @@ expected."
:rtype: float
"""
val, mp = self.integral(interval)
- return val/mp
+ if normalize:
+ return val/mp
+ else:
+ return val
def add(self, f):
""" Adds another `DiscreteFunc` function to this function.