code: def median_group_delay(y, sr, n_fft=2048, rolloff_value=-24):
      """Compute the average group delay for a signal
  
      Parameters
      ----------
      y : np.ndarray
          the signal
  
      sr : int > 0
          the sampling rate of `y`
  
      n_fft : int > 0
          the FFT window size
  
      rolloff_value : int > 0
          If provided, only estimate the groupd delay of the passband that
          above the threshold, which is the rolloff_value below the peak
          on frequency response.
  
      Returns
      -------
      mean_delay : float
          The mediant group delay of `y` (in seconds)
  
      """
      if rolloff_value > 0:
          # rolloff_value must be strictly negative
          rolloff_value = -rolloff_value
  
      # frequency response
      _, h_ir = scipy.signal.freqz(
          y, a=1, worN=n_fft, whole=False, plot=None
      )
  
      # convert to dB(clip function avoids the zero value in log computation)
      power_ir = 20 * np.log10(np.clip(np.abs(h_ir), 1e-8, 1e100))
  
      # set up threshold for valid range
      threshold = max(power_ir) + rolloff_value
  
      _, gd_ir = scipy.signal.group_delay((y, 1), n_fft)
  
      return np.median(gd_ir[power_ir > threshold]) / sr
  
file_path: muda/muda/deformers/ir.py
imports: import six
  import numpy
  import pandas
  import scipy
  import soundfile
  import librosa
  import jams
  from ..base import BaseTransformer
label_desc: Use image node_id 1 for calling a global function with example usage: median_group_delay(y, sr, n_fft, rolloff_value) and returns: unknown