import dascore as dc
= dc.get_example_patch()
patch = patch.decimate(time=10, filter_type='iir')
decimated_irr # Example using fir along distance dimension
= patch.decimate(distance=10, filter_type='fir') decimated_fir
decimate
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 10xdecimation 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.