Changeset 12953 for fact/tools/pyscripts
- Timestamp:
- 02/28/12 18:29:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/pyfact/fir_filter.py
r12948 r12953 23 23 def __call__(self, data): 24 24 length = max(len(self.a),len(self.b))-1 25 initial = np.ones(length) 26 initial *= data[0] 25 26 #print data 27 #print data.ndim 28 #print data.shape 29 if ( data.ndim == 1): 30 initial = np.ones(length) 31 initial *= data[0] 32 elif ( data.ndim == 2): 33 initial = np.ones( (data.shape[0], length) ) 34 for i in range(data.shape[0]): 35 initial[i,:] *= data[i,0] 36 else: 37 print 'HELP.' 38 pass 39 40 #print 'initial:\n' , initial 27 41 filtered, zf = signal.lfilter(self.b, self.a, data, zi=initial) 42 #filtered= signal.lfilter(self.b, self.a, data) 28 43 return filtered 29 44
Note:
See TracChangeset
for help on using the changeset viewer.