class_docstr: Add a random signal-to-noise ratio noise or impulse response to clean speech.
docstr: Caculate power spectrum or log power spectrum of audio data.
  :param audio_data: the audio signal from which to compute spectrum.
                    Should be an (1, N) tensor.
  :param sample_rate: [option]the samplerate of the signal we working with,
                     default is 16kHz.
  :return: A float tensor of size N containing add-noise audio.
docstr_tok: ["Caculate","power","spectrum","or","log","power","spectrum","of","audio","data",".",":","param","audio_data",":","the","audio","signal","from","which","to","compute","spectrum",".","Should","be","an","(","1",",","N",")","tensor",".",":","param","sample_rate",":","[","option","]","the","samplerate","of","the","signal","we","working","with",",","default","is","16kHz",".",":","return",":","A","float","tensor","of","size","N","containing","add-noise","audio","."]
code: def call(self, audio_data, sample_rate=None):
      """
      Caculate power spectrum or log power spectrum of audio data.
      :param audio_data: the audio signal from which to compute spectrum.
                        Should be an (1, N) tensor.
      :param sample_rate: [option]the samplerate of the signal we working with,
                         default is 16kHz.
      :return: A float tensor of size N containing add-noise audio.
      """
  
      p = self.config
      with tf.name_scope("add_rir_noise_aecres"):
          if sample_rate == None:
              sample_rate = tf.constant(p.sample_rate, dtype=tf.int32)
  
          assert_op = tf.assert_equal(
              tf.constant(p.sample_rate),
              tf.cast(sample_rate, dtype=tf.int32),
          )
          with tf.control_dependencies([assert_op]):
              sample_rate = tf.cast(sample_rate, dtype=float)
              add_rir_noise_aecres_out = py_x_ops.add_rir_noise_aecres(
                  audio_data,
                  sample_rate,
                  if_add_rir=p.if_add_rir,
                  rir_filelist=p.rir_filelist,
                  if_add_noise=p.if_add_noise,
                  snr_min=p.snr_min,
                  snr_max=p.snr_max,
                  noise_filelist=p.noise_filelist,
                  if_add_aecres=p.if_add_aecres,
                  aecres_filelist=p.aecres_filelist,
              )
  
              return tf.squeeze(add_rir_noise_aecres_out)
  
file_path: delta/delta/data/frontend/add_rir_noise_aecres.py
imports: import delta.compat
  from delta.utils.hparam import HParams
  from core.ops import py_x_ops
  from delta.data.frontend.base_frontend import BaseFrontend
label_desc: Use image node_id 3 for calling the Add_rir_noise_aecres obj's underlying member method code with example usage: obj.call(audio_data, sample_rate) and returns: tf