code: def plot_impulse_responses(
      impulse_response,
      desired_magnitudes,
      sample_rate=DEFAULT_SAMPLE_RATE,
  ):
      """Plot a target frequency response, and that of an impulse response."""
      n_fft = desired_magnitudes.shape[-1] * 2
      frequencies = np.fft.fftfreq(n_fft, 1 / sample_rate)[: n_fft // 2]
      true_frequencies, true_magnitudes = transfer_function(
          impulse_response
      )
  
      # Plot it.
      plt.figure(figsize=(12, 6))
      plt.subplot(121)
      # Desired transfer function.
      plt.semilogy(frequencies, desired_magnitudes, label="Desired")
      # True transfer function.
      plt.semilogy(
          true_frequencies, true_magnitudes[0, 0, :], label="True"
      )
      plt.title("Transfer Function")
      plt.legend()
  
      plt.subplot(122)
      plt.plot(impulse_response[0, 0, :])
      plt.title("Impulse Response")
  
file_path: ddsp/ddsp/training/plotting.py
imports: from ddsp import core
  from ddsp import spectral_ops
  from matplotlib import gridspec
  import matplotlib.pyplot
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 3 for calling a global function with example usage: plot_impulse_responses(impulse_response, desired_magnitudes, sample_rate) without return types