docs: def filter_butter_coeffs(filtertype, freq, samplerate, order=5):
      # type: (str, Union[float, Tuple[float, float]], int, int) -> Tuple[np.ndarray, np.ndarray]
      """
      calculates the coefficients for a digital butterworth filter
  
      filtertype: 'low', 'high', 'band'
      freq      : cutoff freq.
                  in the case of 'band': (low, high)
  
      Returns --> (b, a)
      """
      assert filtertype in ('low', 'high', 'band')
      nyq = 0.5 * samplerate
      if isinstance(freq, tuple):
          assert filtertype == 'band'
          low, high = freq
          low  /= nyq
          high /= nyq
          b, a = signal.butter(order, [low, high], btype='band')
      else:
          freq = freq / nyq
          b, a = signal.butter(order, freq, btype=filtertype)
      return b, a