pass_filter

function of dascore.proc.filter source

pass_filter(
    patch: Patch ,
    corners = 4,
    zerophase = True,
    **kwargs ,
)-> ‘PatchType’

Apply a Butterworth pass filter (bandpass, highpass, or lowpass).

Parameters

Parameter Description
corners The number of corners for the filter.
zerophase If True, apply the filter twice.
**kwargs Used to specify the dimension and frequency, wavelength, or equivalent
limits.

Examples

import dascore
pa = dascore.get_example_patch()
 # Apply bandpass filter along time axis from 1 to 100 Hz
bandpassed = pa.pass_filter(time=(1, 100))
 # Apply lowpass filter along distance axis for wavelengths less than 100m
lowpassed = pa.pass_filter(distance=(None, 1/100))
# Note that None and ... both indicate open intervals
assert pa.pass_filter(time=(None, 90)) == pa.pass_filter(time=(..., 90))
# Optionally, units can be specified for a more expressive API.
from dascore.units import m, ft, s, Hz
# Filter from 1 Hz to 10 Hz in time dimension
lp_units = pa.pass_filter(time=(1 * Hz, 10 * Hz))
# Filter wavelengths 50m to 100m
bp_m = pa.pass_filter(distance=(50 * m, 100 * m))
# filter wavelengths less than 200 ft
lp_ft = pa.pass_filter(distance=(200 * ft, ...))