(waveform_input, window_length_samples,
                           hop_length_samples, fft_length)
return stft_magnitude
Calculate spectrogram avoiding tflite incompatible ops.
Calculate spectrogram avoiding tflite incompatible ops.
Calculate spectrogram avoiding tflite incompatible ops .
def _stft_magnitude_tflite(waveform_input, window_length_samples,
                           hop_length_samples, fft_length):
  """Calculate spectrogram avoiding tflite incompatible ops."""
  real_stft, imag_stft = _stft_tflite(
      waveform_input,
      frame_length=window_length_samples,
      frame_step=hop_length_samples,
      fft_length=fft_length)
  stft_magnitude = tf.sqrt(
      tf.add(real_stft * real_stft, imag_stft * imag_stft),
      name='magnitude_spectrogram')
  return stft_magnitude
def _stft_magnitude_tflite ( waveform_input , window_length_samples , hop_length_samples , fft_length ) : real_stft , imag_stft = _stft_tflite ( waveform_input , frame_length = window_length_samples , frame_step = hop_length_samples , fft_length = fft_length ) stft_magnitude = tf . sqrt ( tf . add ( real_stft * real_stft , imag_stft * imag_stft ) , name = 'magnitude_spectrogram' ) return stft_magnitude