@staticmethod<EOL><INDENT>def _filter_timeseries(data, highpass=None, lowpass=None, notch=None):<DEDENT>
<EOL>if all(x is None for x in (highpass, lowpass, notch)):<EOL><INDENT>return data<EOL><DEDENT>zpks = []<EOL>if highpass is not None and lowpass is not None:<EOL><INDENT>zpks.append(filter_design.bandpass(highpass, lowpass,<EOL>data.sample_rate))<EOL><DEDENT>elif highpass is not None:<EOL><INDENT>zpks.append(filter_design.highpass(highpass, data.sample_rate))<EOL><DEDENT>elif lowpass is not None:<EOL><INDENT>zpks.append(filter_design.lowpass(lowpass, data.sample_rate))<EOL><DEDENT>for freq in notch or []:<EOL><INDENT>zpks.append(filter_design.notch(freq, data.sample_rate))<EOL><DEDENT>zpk = filter_design.concatenate_zpks(*zpks)<EOL>return data.filter(*zpk, filtfilt=True)<EOL>
Apply highpass, lowpass, and notch filters to some data