Trace.filter(type, **options)[source]

Filter the data of the current trace.

  • type (str) String that specifies which filter is applied (e.g. "bandpass"). See the Supported Filter section below for further details.
  • options Necessary keyword arguments for the respective filter that will be passed on. (e.g. freqmin=1.0, freqmax=20.0 for "bandpass")


This operation is performed in place on the actual data arrays. The raw data is not accessible anymore afterwards. To keep your original data, use copy() to create a copy of your trace object. This also makes an entry with information on the applied processing in stats.processing of this trace.

Supported Filter

Butterworth-Bandpass (uses obspy.signal.filter.bandpass()).
Butterworth-Bandstop (uses obspy.signal.filter.bandstop()).
Butterworth-Lowpass (uses obspy.signal.filter.lowpass()).
Butterworth-Highpass (uses obspy.signal.filter.highpass()).
Cheby2-Lowpass (uses obspy.signal.filter.lowpass_cheby_2()).
'lowpass_fir' (experimental)
FIR-Lowpass (uses obspy.signal.filter.lowpass_fir()).
'remez_fir' (experimental)
Minimax optimal bandpass using Remez algorithm (uses obspy.signal.filter.remez_fir()).


>>> from obspy import read
>>> st = read()
>>> tr = st[0]
>>> tr.filter("highpass", freq=1.0)  
<...Trace object at 0x...>
>>> tr.plot()  

(Source code, png, hires.png)