diff python/utils.py @ 547:97c5fef5b2d6

corrected bugs
author MohamedGomaa
date Tue, 08 Jul 2014 13:43:56 -0400
parents 3707eeb20f25
children 3622a5653ee9
line wrap: on
line diff
--- a/python/utils.py	Thu Jul 03 14:30:20 2014 -0400
+++ b/python/utils.py	Tue Jul 08 13:43:56 2014 -0400
@@ -246,9 +246,10 @@
 def crossProduct(l1, l2):
     return l1[0]*l2[1]-l1[1]*l2[0]
 
-def filterMovingWindow(input, halfWidth):
+def filterMovingWindow(inputSignal, halfWidth):
     '''Returns an array obtained after the smoothing of the input by a moving average
     The first and last points are copied from the original.'''
+    from numpy import ones,convolve,array
     width = float(halfWidth*2+1)
     win = ones(width,'d')
     result = convolve(win/width,array(inputSignal),'same')