code: def transfer_function(ir, sample_rate=DEFAULT_SAMPLE_RATE):
      """Get true transfer function from an impulse_response."""
      n_fft = core.get_fft_size(0, ir.shape.as_list()[-1])
      frequencies = np.abs(
          np.fft.fftfreq(n_fft, 1 / sample_rate)[: int(n_fft / 2) + 1]
      )
      magnitudes = tf.abs(tf.signal.rfft(ir, [n_fft]))
      return frequencies, magnitudes
  
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 2 for calling a global function with example usage: transfer_function(ir, sample_rate) and returns: frequencies,  magnitudes