vocalpy.segment.MeanSquaredParams#
- class vocalpy.segment.MeanSquaredParams(threshold: int = 5000, min_dur: float = 0.02, min_silent_dur: float = 0.002, freq_cutoffs: ~typing.Iterable = (500, 10000), smooth_win: int = 2, scale: bool = True, scale_val: int | float = 32768, scale_dtype: type[~typing.Any] | ~numpy.dtype[~typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | tuple[~typing.Any, ~typing.Any] | list[~typing.Any] | ~numpy._typing._dtype_like._DTypeDict | str | None = <class 'numpy.int16'>)[source]#
Bases:
ParamsData class that represents parameters for
vocalpy.segment.ava.segment().- Attributes:
- thresholdint
Value above which mean squared signal is considered part of a segment. Default is 5000.
- min_durfloat
Minimum duration of a segment, in seconds. Default is 0.02, i.e. 20 ms.
- min_silent_durfloat
Minimum duration of silent gap between segments, in seconds. Default is 0.002, i.e. 2 ms.
- freq_cutoffsIterable
Cutoff frequencies for bandpass filter. List or tuple with two elements, default is
(500, 10000).- smooth_winint
Size of smoothing window in milliseconds. Default is 2.
- scalebool
If True, scale the
sound.data. Default is True. This is needed to replicate the behavior ofevsonganaly, which assumes the audio data is loaded as 16-bit integers. Since the default forvocalpy.Soundis to load sounds with a numpy dtype of float64, this function defaults to multiplying thesound.databy 2**15, and then casting to the int16 dtype. This replicates the behavior of theevsonganalyfunction, given data with dtype float64. If you have loaded a sound with a dtype of int16, then set this to False.- scale_val
Value to multiply the
sound.databy, to scale the data. Default is 2**15. Only used ifscaleisTrue. This is needed to replicate the behavior ofevsonganaly, which assumes the audio data is loaded as 16-bit integers.scale_dtypenumpy.dtypeSigned integer type, compatible with C
short.
Methods
alias of
int16keys
- __init__(threshold: int = 5000, min_dur: float = 0.02, min_silent_dur: float = 0.002, freq_cutoffs: ~typing.Iterable = (500, 10000), smooth_win: int = 2, scale: bool = True, scale_val: int | float = 32768, scale_dtype: type[~typing.Any] | ~numpy.dtype[~typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | tuple[~typing.Any, ~typing.Any] | list[~typing.Any] | ~numpy._typing._dtype_like._DTypeDict | str | None = <class 'numpy.int16'>) None#
Methods
__init__([threshold, min_dur, ...])keys()Attributes
freq_cutoffsmin_durmin_silent_durscalescale_valsmooth_winthreshold- scale_dtype#
alias of
int16