import dascore as dc
= dc.get_example_patch()
patch
# Whiten along time dimension
= patch.whiten(time=None)
white_patch
# Band limited whitening
= patch.whiten(time=(20, 40))
white_patch
# Band limited with taper ends
= patch.whiten(time=(10, 20, 40, 60))
white_patch
# Whitening along distance with amplitude smoothing (0.1/m))
= patch.whiten(smooth_size=0.1, distance=None) white_patch
whiten
whiten(
patch: Patch ,
smooth_size: None | float[None, float] = None,
water_level: None | float[None, float] = None,
**kwargs ,
)-> ‘PatchType’
Spectral whitening of a signal.
The whitened signal is returned in the same domain (eq frequency or time domain) as the input signal. See also the Whiten Processing Section.
Parameters
Parameter | Description |
---|---|
patch | The patch to transform. |
smooth_size |
Size in transformed domain units (eg Hz) or samples of moving average window, used to compute the spectrum before whitening. If None, don’t smooth signal which results in a uniform amplitude. units. |
water_level |
If used, float between 0 and 1 to stabilize frequencies with near zero amplitude. Does nothing if smooth_size is None. Values between 0.01 and 0.05 usually work well. |
**kwargs |
Used to specify the dimension range in transformed units (e.g, Hz) of the smoothing. Can either be a sequence of two values or four values to specify a taper range. Simply uses Patch.taper_range under the hood. If kwargs are provided, try to smooth time or ft_time coords.
|
Note
The FFT result is divided by the smoothed spectrum before inverting back to time-domain signal. The phase is not changed.
Amplitude is NOT preserved