docs: def lowpass_cheby_2(data, freq, df, maxorder=12, ba=False,
                      freq_passband=False):
      """
      Cheby2-Lowpass Filter
  
      Filter data by passing data only below a certain frequency.
      The main purpose of this cheby2 filter is downsampling.
      #318 shows some plots of this filter design itself.
  
      This method will iteratively design a filter, whose pass
      band frequency is determined dynamically, such that the
      values above the stop band frequency are lower than -96dB.
  
      :type data: numpy.ndarray
      :param data: Data to filter.
      :param freq: The frequency above which signals are attenuated
          with 95 dB
      :param df: Sampling rate in Hz.
      :param maxorder: Maximal order of the designed cheby2 filter
      :param ba: If True return only the filter coefficients (b, a) instead
          of filtering
      :param freq_passband: If True return additionally to the filtered data,
          the iteratively determined pass band frequency
      :return: Filtered data.
      """
      nyquist = df * 0.5
      # rp - maximum ripple of passband, rs - attenuation of stopband
      rp, rs, order = 1, 96, 1e99
      ws = freq / nyquist  # stop band frequency
      wp = ws  # pass band frequency
      # raise for some bad scenarios
      if ws > 1:
          ws = 1.0
          msg = "Selected corner frequency is above Nyquist. " + \
                "Setting Nyquist as high corner."
          warnings.warn(msg)
      while True:
          if order <= maxorder:
              break
          wp = wp * 0.99
          order, wn = cheb2ord(wp, ws, rp, rs, analog=0)
      if ba:
          return cheby2(order, rs, wn, btype='low', analog=0, output='ba')
      z, p, k = cheby2(order, rs, wn, btype='low', analog=0, output='zpk')
      sos = zpk2sos(z, p, k)
      if freq_passband:
          return sosfilt(sos, data), wp * nyquist
      return sosfilt(sos, data)