Posted By

leonpalafox on 11/26/12


python Filtering Scipy

Versions (?)

Filter Signals using scipy

 / Published in: Python

This portion of code allows to do bandpass filtering over time series

  1. import scipy.signal as sp
  2. nyf= sampfr/2 #Sampling Frequency/2 (Nyquist Frequency)
  3. low=0.5/nyf #Lower cut of the filter
  4. high=50/fso2 #High Cut of the filter
  5. b,a = sp.butter(5,[low,high], btype='band') #Butter generates the coefficients for the filter
  6. dataF=sp.lfilter(b, a, data) #Does the convoultion, and the output is the filtered signal

Report this snippet  

You need to login to post a comment.