Index: fact/tools/pyscripts/pyfact/fir_filter.py
===================================================================
--- fact/tools/pyscripts/pyfact/fir_filter.py	(revision 12947)
+++ fact/tools/pyscripts/pyfact/fir_filter.py	(revision 12948)
@@ -17,5 +17,4 @@
         
         """
-        
         self.a = a
         self.b = b
@@ -23,8 +22,13 @@
         
     def __call__(self, data):
-        return signal.lfilter(self.b, self.a, data)
+        length = max(len(self.a),len(self.b))-1
+        initial = np.ones(length)
+        initial *= data[0]
+        filtered, zf = signal.lfilter(self.b, self.a, data, zi=initial)
+        return filtered
 
     def __str__(self):
         s = self.name + '\n'
+        s += 'initial condition for filter: signal@rest = 1st sample\n'
         s += 'filter, coefficients:\n'
         s += 'nominator ' + str(self.b) + '\n'
@@ -42,7 +46,7 @@
     
         """
-
         b = np.ones(length)
-        a = len(b)
+        a = np.zeros(length)
+        a[0] = len(b)
         FirFilter.__init__(self, b, a, 'sliding average')
             
@@ -70,5 +74,6 @@
         
         b = np.array((-0.5, 1., -0.5)) 
-        a = 1.
+        a = np.zeros(len(b))
+        a[0] = 1.0
         FirFilter.__init__(self, b, a, 'remove signal')       
 
