(self, audio_data, sample_rate=None)
Caculate power spectrum and phase 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: Two returns:
        power spectrum —— A float tensor of size (num_frames, num_frequencies)
                          containing power spectrum and of every frame in speech.
        phase spectrum —— A float tensor of size (num_frames, num_frequencies)
                          containing phase spectrum and of every frame in speech.
Caculate power spectrum and phase 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: Two returns:
        power spectrum —— A float tensor of size (num_frames, num_frequencies)
                          containing power spectrum and of every frame in speech.
        phase spectrum —— A float tensor of size (num_frames, num_frequencies)
                          containing phase spectrum and of every frame in speech.
Caculate power spectrum and phase 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 : Two returns : power spectrum —— A float tensor of size ( num_frames num_frequencies ) containing power spectrum and of every frame in speech . phase spectrum —— A float tensor of size ( num_frames num_frequencies ) containing phase spectrum and of every frame in speech .
def call(self, audio_data, sample_rate=None):
    """
    Caculate power spectrum and phase 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: Two returns:
        power spectrum —— A float tensor of size (num_frames, num_frequencies)
                          containing power spectrum and of every frame in speech.
        phase spectrum —— A float tensor of size (num_frames, num_frequencies)
                          containing phase spectrum and of every frame in speech.
    """

    p = self.config
    with tf.name_scope('analyfiltbank'):

      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)
        power_spectrum, phase_spectrum = py_x_ops.analyfiltbank(
            audio_data,
            sample_rate,
            window_length=p.window_length,
            frame_length=p.frame_length)

        return power_spectrum, phase_spectrum
def call ( self , audio_data , sample_rate = None ) : p = self . config with tf . name_scope ( 'analyfiltbank' ) : 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 ) power_spectrum , phase_spectrum = py_x_ops . analyfiltbank ( audio_data , sample_rate , window_length = p . window_length , frame_length = p . frame_length ) return power_spectrum , phase_spectrum