decimate

function of dascore.proc.resample source

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

Decimate a patch along a dimension.

Parameters

Parameter Description
filter_type filter type to use to avoid aliasing. Options are:
iir - infinite impulse response
fir - finite impulse response
None - No pre-filtering, not recommended, may cause aliasing
copy If True, copy the decimated data array. This is needed if you want
the old array to get gc’ed to free memory otherwise a view is returned.
Only applies when filter_type == None.
**kwargs Used to pass dimension and factor. For example time=10 is 10x
decimation along the time axis.
Note
  • Simply uses scipy.signal.decimate if filter_type is specified. Otherwise,just slice data long specified dimension only including every n samples.

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

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')