decimate

function of dascore.proc.resample source

decimate(
    patch: Patch ,
    filter_type: Literal[‘iir’, ‘fir’, None] = iir,
    copy: bool = True,
    **kwargs ,
)-> ‘PatchType’

Decimate a patch along a dimension.

Parameters

Parameter Description
patch The patch to decimate.
filter_type Anti-aliasing filter: "iir", "fir", or None. None disables
pre-filtering and may cause aliasing.
copy Copy the sliced data so it does not retain the original array. Applies
only when filter_type is None.
**kwargs Dimension and factor; time=10 decimates the time axis by 10.
Note
  • Uses scipy.signal.decimate when filter_type is specified; otherwise, takes every nth sample along the dimension.

  • If the decimation dimension is small, this can fail due to lack of padding values.

  • Coordinates measured on the decimated dimension are decimated with it: taking every nth value of a dimension takes every nth value of everything indexed by it.

See Also

resample Change sampling to a specified interval or number of samples, rather than by an integer decimation factor.

Examples

import dascore as dc
patch = dc.get_example_patch()
decimated_irr = patch.decimate(time=10, filter_type='iir')
# Example using fir along distance dimension
decimated_fir = patch.decimate(distance=10, filter_type='fir')