Last active
October 17, 2020 01:42
-
-
Save andrewgiessel/4514186 to your computer and use it in GitHub Desktop.
butterworth bandpass filter in python
This file contains 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
from scipy.signal import butter, lfilter | |
def butter_bandpass_filter(data, lowcut, highcut, fs, order=5): | |
nyq = 0.5 * fs | |
low = lowcut / nyq | |
high = highcut / nyq | |
b, a = butter(order, [low, high], btype='band') | |
y = lfilter(b, a, data) | |
return y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment