Filter grammar¶
SeisComP supports stringbased filter definitions. This section covers available filters and their parameters.
The filter definition supports SeisComP filters and building filter chains (operator >> or >) as well as combining them with basic mathematical operators like
+ : addition
 : subtraction
* : multiplitation
/ : division
^ : power / exponentiation
.  : absolute value.
Use brackets () to apply the operations within before the one outside.
Note
Filters in SeisComP are recursive allowing realtime application. Therefore, filter artefacts, e.g. ringing, are always visible at the beginning of the traces or after data gaps.
Example¶
A(1,2)>>(B(3,4)*2+C(5,6,7))>>D(8)
where A, B, C and D are different filters configured with different parameters. In this example a sample s is filtered to get the final sample sf passing the following stages:
filter sample s with A: sa = A(1,2)(s)
filter sa with B: sb = B(3,4)(sa)
sb = sb * 2
filter sa with C: sc = C(5,6,7)(sa)
add sb and sc: sbc = sb + sc
filter sbc with D: sf = D(8)(sbc)
sf = final sample.
The default filter applied by scautopick for making detections is
RMHP(10)
>> ITAPER(30)
>> BW(4,0.7,2)
>> STALTA(2,80)
It first removes the offset. Then an ITAPER of 30 seconds is applied before the data is filtered with a fourth order Butterworth bandpass with corner frequencies of 0.7 Hz and 2 Hz. Finally an STA/LTA filter with a shorttime time window of 2 seconds and a longterm time window of 80 seconds is applied.
To apply mathematical operations on original waveforms use self()
, e.g.:
self()*1>>A(1,2)
Test filter strings¶
Filters can be conveniently tested without much configuration. To perform such tests
Open a simple graphical text editor, e.g. gedit, pluma or kwrite and write down the filter string.
Mark / highlight the filter string and use the mouse to drag the filter string onto the waveforms.
Observe the differences between filtered and unfiltered waveforms.
List of filters¶
Multiple filter functions are available. If a filter function has no
parameter, it can be given either with parentheses, e.g. DIFF()
,
or without, e.g. DIFF
.
Warning
All frequencies given as parameters to filters must be below the Nyquist frequency of the original signal. Otherwise, filtering may result in undesired behavior of modules, e.g. stopping or showing of empty traces.

AVG
(timespan)¶ Calculates the average of preceding samples.
 Parameters
timespan – Time span in seconds

BW
(order, lofreq, hifreq)¶ Alias for the
Butterworth bandpass filter, BW_BP
.

BW_BP
(order, lofreq, hifreq)¶ Butterworth bandpass filter (BW) realized as a causal recursive IIR (infinite impulse response) filter. An arbitrary bandpass filter can be created for given order and corner frequencies.
 Parameters
order – The filter order
lofreq – The lower corner frequency
hifreq – The upper corner frequency

BW_BS
(order, lofreq, hifreq)¶ Butterworth band stop filter realized as a causal recursive IIR (infinite impulse response) filter suppressing amplitudes at frequencies between lofreq and hifreq.
 Parameters
order – The filter order
lofreq – The lower corner frequency
hifreq – The upper corner frequency

BW_HP
(order, lofreq)¶ Butterworth highpass filter realized as a causal recursive IIR (infinite impulse response) filter.
 Parameters
order – The filter order
lofreq – The corner frequency

BW_HLP
(order, lofreq, hifreq)¶ Butterworth highlowpass filter realized as a combination of
BW_HP()
andBW_LP()
. Parameters
order – The filter order
lofreq – The lower corner frequency
hifreq – The upper corner frequency

BW_LP
(order, hifreq)¶ Butterworth lowpass filter realized as a causal recursive IIR (infinite impulse response) filter.
 Parameters
order – The filter order
hifreq – The corner frequency

DIFF
()¶ Differentiation filter realized as a recursive IIR (infinite impulse response) differentiation filter.
The differentiation loop calculates for each input sample s the output sample s':
s' = (sv1) / dt v1 = s;

INT
([a = 0])¶ Integration filter realized as a recursive IIR (infinite impulse response) integration filter. The weights are calculated according to parameter a in the following way:
a0 = ((3a)/6) * dt a1 = (2*(3+a)/6) * dt a2 = ((3a)/6) * dt b0 = 1 b1 = 0 b2 = 1
The integration loop calculates for each input sample s the integrated output sample s':
v0 = b0*s  b1*v1  b2*v2 s' = a0*v0 + a1*v1 + a2*v2 v2 = v1 v1 = v0
 Parameters
a – Coefficient a.

ITAPER
(timespan)¶ A onesided cosine taper.
 Parameters
timespan – The timespan in seconds.

MAX
(timespan)¶ Computes the maximum within the timespan preceeding the sample.
 Parameters
timespan – The timespan in seconds

MEDIAN
(timespan)¶ Computes the median within the timespan preceeding the sample. Useful, e.g. for despiking. The delay due to the filter may be up to its timespan.
 Parameters
timespan – The timespan in seconds

MIN
(timespan)¶ Computes the minimum within the timespan preceeding the sample.
 Parameters
timespan – The timespan in seconds

RM
(timespan)¶ A running mean filter computing the mean value within timespan. For a given time window in seconds the running mean is computed from the single amplitude values and set as output. This computation is equal to
RHMP
with the exception that the mean is not subtracted from single amplitudes but replaces them.RMHP = selfRM
 Parameters
timespan – The timespan in seconds

RMHP
(timespan)¶ A highpass filter realized as running mean highpass filter. For a given time window in seconds the running mean is subtracted from the single amplitude values. This is equivalent to highpass filtering the data.
Running mean highpass of e.g. 10 seconds calculates the difference to the running mean of 10 seconds.
 Parameters
timespan – The timespan in seconds

self
()¶ The original data itself.

SM5
([type = 1])¶ A simulation of a 5second seismometer.
 Parameters
type – The data type: either 0 (displacement), 1 (velocity) or 2 (acceleration)

STALTA
(sta, lta)¶ A STA/LTA filter is the ratio of a shorttime average to a longtime average calculated continuously in two consecutive time windows. This method is the basis for many trigger algorithm. The shorttime window is for detection of transient signal onsets whereas the longtime window provides information about the actual seismic noise at the station.
 Parameters
sta – Shortterm time window
lta – Longterm time window

WA
([type = 1[, gain=2800[, T0=0.8[, h=0.8]]]])¶ The simulation filter of a WoodAnderson seismometer. The data format of the waveforms has to be given for applying the simulation filter (displacement = 0, velocity = 1, acceleration = 2), e.g. WA(1) is the simulation on velocity data.
 Parameters
type – The data type: 0 (displacement), 1 (velocity) or 2 (acceleration)
gain – The gain of the WoodAnderson response
T0 – The eigenperiod in seconds
h – The damping constant

WWSSN_LP
([type = 1])¶ The instrument simulation filter of a WorldWide Standard Seismograph Network (WWSSN) longperiod seismometer.
 Parameters
type – The data type: 0 (displacement), 1 (velocity) or 2 (acceleration)

WWSSN_SP
([type = 1])¶ Analog to the WWSSN_LP, the simulation filter of the shortperiod seismometer of the WWSSN.
 Parameters
type – The data type: 0 (displacement), 1 (velocity) or 2 (acceleration)