code: def generate_th(audio, fs, window_size=2048):
      """
      returns the masking threshold theta_xs and the max psd of the audio
      """
      PSD, psd_max = compute_PSD_matrix(audio, window_size)
      freqs = librosa.core.fft_frequencies(fs, window_size)
      barks = Bark(freqs)
  
      # compute the quiet threshold
      ATH = np.zeros(len(barks)) - np.inf
      bark_ind = np.argmax(barks > 1)
      ATH[bark_ind:] = quiet(freqs[bark_ind:])
  
      # compute the global masking threshold theta_xs
      theta_xs = []
      # compute the global masking threshold in each window
      for i in range(PSD.shape[1]):
          theta_xs.append(compute_th(PSD[:, i], barks, ATH, freqs))
      theta_xs = np.array(theta_xs)
      return theta_xs, psd_max
  
file_path: cleverhans/cleverhans_v3.1.0/examples/adversarial_asr/generate_masking_threshold.py
imports: import scipy.io.wavfile
  import numpy
  from scipy.fftpack import fft
  from scipy.fftpack import ifft
  from scipy import signal
  import scipy
  import librosa
label_desc: Use image node_id 6 for calling a global function with example usage: generate_th(audio, fs, window_size) and returns: theta_xs,  psd_max