code: def noise_generator(y, sr, color, rng):
      """generating noise given the type of color, length of
         the degrading audio clip and its sampling rate.
  
      Parameters
      ----------
      y : int > 0
          compute frame length of y, as the length of noise fragment
          to be generated.
  
      sr : int > 0
          The target sampling rate
  
      color : str
          keywords of desired noise color
  
      rng : np.random.RandomState
          The random state object
  
      Returns
      -------
      y : np.ndarray [shape=(n_samples,)]
          A fragment of noise clip that generated given the type of color
          and length.
  
      """
      n_frames = len(y)
  
      noise_white = rng.randn(n_frames)
  
      noise_fft = np.fft.rfft(noise_white)
  
      values = np.linspace(1, n_frames * 0.5 + 1, n_frames // 2 + 1)
  
      if color == "pink":
          colored_filter = values ** (-0.5)
  
      elif color == "brownian":
          colored_filter = values ** (-1)
  
      else:
          # default white
          colored_filter = (
              np.linspace(1, n_frames / 2 + 1, n_frames // 2 + 1) ** 0
          )
  
      noise_filtered = noise_fft * colored_filter
  
      return np.fft.irfft(noise_filtered)
  
file_path: muda/muda/deformers/colorednoise.py
imports: import numpy
  import librosa
  from ..base import BaseTransformer, _get_rng
label_desc: Use image node_id 1 for calling a global function with example usage: noise_generator(y, sr, color, rng) and returns: np