Created
October 12, 2017 20:32
-
-
Save daguiam/52e53b49ff5c9c1bbce43efc31feef21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filtfilt_lowpass(sig,cutoff,Fs=1,order=5): | |
""" Low pass butterworth filt filter | |
""" | |
nyq = np.float(Fs)/2 | |
cutoffnorm = cutoff/nyq; | |
b, a = signal.butter(order,cutoffnorm,btype='low'); | |
sig = signal.filtfilt(b,a,sig) | |
return sig | |
def filtfilt_highpass(sig,cutoff,Fs=1,order=5): | |
""" high pass butterworth filt filter | |
""" | |
nyq = np.float(Fs)/2 | |
cutoffnorm = cutoff/nyq; | |
b, a = signal.butter(order,cutoffnorm,btype='high'); | |
sig = signal.filtfilt(b,a,sig) | |
return sig | |
def filtfilt_bandpass(sig,lowcut,highcut,Fs=1,order=5): | |
""" Band pass butterworth filt filter | |
""" | |
nyq = np.float(Fs)/2 | |
lowcut = lowcut/nyq | |
highcut = highcut/nyq | |
b, a = signal.butter(order,[lowcut,highcut],btype='band') | |
sig = signal.filtfilt(b,a,sig) | |
return sig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment