/ Published in: Python
This portion of code allows to do bandpass filtering over time series
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import scipy.signal as sp nyf= sampfr/2 #Sampling Frequency/2 (Nyquist Frequency) low=0.5/nyf #Lower cut of the filter high=50/fso2 #High Cut of the filter b,a = sp.butter(5,[low,high], btype='band') #Butter generates the coefficients for the filter dataF=sp.lfilter(b, a, data) #Does the convoultion, and the output is the filtered signal