super_auto_comb.deglitch ======================== .. py:module:: super_auto_comb.deglitch Functions --------- .. autoapisummary:: super_auto_comb.deglitch.prepare_bounds super_auto_comb.deglitch.deglitch_from_bounds super_auto_comb.deglitch.deglitch_from_double_counting super_auto_comb.deglitch.deglitch_from_f0 super_auto_comb.deglitch.deglitch_from_median_filter Module Contents --------------- .. py:function:: prepare_bounds(bounds, n) Resize bounds to match arrays dimensions. .. py:function:: deglitch_from_bounds(data, bounds=(-np.inf, np.inf)) Return a mask of data invalid because out of bounds. :param data: Input data :type data: array_like :param bounds: Lower and upper bounds for each column of the input array, by default (-np.inf, np.inf) :type bounds: 2-tuple of array-like, optional :returns: **mask1** -- Mask data out of bounds. :rtype: array .. py:function:: deglitch_from_double_counting(data, threshold=0.2, glitch_ext=3) Return a mask of data from double counting. Uses numpy ptp (peak-to-peak) function. :param data: Input data_ :type data: array_like :param threshold: double counting threshold, by default 0.2 :type threshold: float, optional :param glitch_ext: Extend glitch to neighbourg points, by default 3 :type glitch_ext: int, optional :returns: **mask2** -- Mask data for glitches detected by double counting. :rtype: array .. py:function:: deglitch_from_f0(f0, f0_nominal, threshold=0.25) Return a mask for invalid data because f0 is out of bounds. :param f0: array of f0 values in Hz :type f0: array_like, 1d :param f0_nominal: nominal f0 value in Hz :type f0_nominal: float or Decimal :param threshold: Threshold value in Hz, by default 0.25 :type threshold: float, optional :returns: **mask3** -- mask data for f0 out of bounds. :rtype: array .. py:function:: deglitch_from_median_filter(f_beat, premask, median_window=60, median_threshold=250.0, glitch_ext=3) Return a mask for data dissimila to neighbors. :param f_beat: Input data :type f_beat: array_like :param premask: Mask to apply to input data (from other deglitch functions) :type premask: array_like :param median_window: Number of point over calculating rolling median filter, by default 60 :type median_window: int, optional :param median_threshold: Threshold value in Hz, by default 250. :type median_threshold: float, optional :param glitch_ext: Extend glitch to neighbourg points, by default 3 :type glitch_ext: int, optional :returns: _description_ :rtype: _type_