import dascore as dc
= dc.get_example_patch() # generate example patch
patch
# Apply an Hanning taper to 5% of each end for time dimension.
= patch.taper(time=0.05, window_type="hann")
patch_taper1
# Apply a triangular taper to 10% of the start of the distance dimension.
= patch.taper(distance=(0.10, None), window_type='triang')
patch_taper2
# Apply taper on first and last 15 m along distance axis.
from dascore.units import m
= patch.taper(distance=15 * m) patch_taper3
taper
taper(
patch: Patch ,
window_type: str = hann,
**kwargs ,
)-> ‘PatchType’
Taper the ends of the signal.
Parameters
Parameter | Description |
---|---|
patch | The patch instance. |
window_type |
The type of window to use For tapering. Supported Options are: barthann bartlett blackman blackmanharris bohman cos hamming hann nuttall parzen ramp triang |
**kwargs |
Used to specify the dimension along which to taper and the percentage of total length of the dimension or absolute units. If a single value is passed, the taper will be applied to both ends. A length two tuple can specify different values for each end, or no taper on one end. |
Returns
The tapered patch.