code: def _naive_rdft(signal_tensor, fft_length):
      """Implement real-input Fourier Transform by matmul."""
      # We are right-multiplying by the DFT matrix, and we are keeping
      # only the first half ("positive frequencies").
      # So discard the second half of rows, but transpose the array for
      # right-multiplication.
      # The DFT matrix is symmetric, so we could have done it more
      # directly, but this reflects our intention better.
      complex_dft_matrix_kept_values = _dft_matrix(fft_length)[
          : (fft_length // 2 + 1), :
      ].transpose()
      real_dft_tensor = tf.constant(
          np.real(complex_dft_matrix_kept_values).astype(np.float32),
          name="real_dft_matrix",
      )
      imag_dft_tensor = tf.constant(
          np.imag(complex_dft_matrix_kept_values).astype(np.float32),
          name="imaginary_dft_matrix",
      )
      signal_frame_length = int(signal_tensor.shape[-1])
      half_pad = (fft_length - signal_frame_length) // 2
      pad_values = tf.concat(
          [
              tf.zeros([tf.rank(signal_tensor) - 1, 2], tf.int32),
              [[half_pad, fft_length - signal_frame_length - half_pad]],
          ],
          axis=0,
      )
      padded_signal = tf.pad(signal_tensor, pad_values)
      result_real_part = tf.matmul(padded_signal, real_dft_tensor)
      result_imag_part = tf.matmul(padded_signal, imag_dft_tensor)
      return result_real_part, result_imag_part
  
file_path: magenta/magenta/models/onsets_frames_transcription/melspec_input.py
imports: import math
  from magenta.models.onsets_frames_transcription import mfcc_mel
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: _naive_rdft(signal_tensor, fft_length) and returns: result_real_part,  result_imag_part