code: def get_stft_mag_phase(
      input_shape,
      n_fft=2048,
      win_length=None,
      hop_length=None,
      window_name=None,
      pad_begin=False,
      pad_end=False,
      return_decibel=False,
      db_amin=1e-5,
      db_ref_value=1.0,
      db_dynamic_range=80.0,
      input_data_format="default",
      output_data_format="default",
      name="stft_mag_phase",
  ):
      """A function that returns magnitude and phase of input audio.
  
      Args:
          input_shape (None or tuple of integers): input shape of the stft layer.
              Because this mag_phase is based on keras.Functional model, it is required to specify the input shape.
              E.g., (44100, 2) for 44100-sample stereo audio with `input_data_format=='channels_last'`.
          n_fft (int): number of FFT points in `STFT`
          win_length (int): window length of `STFT`
          hop_length (int): hop length of `STFT`
          window_name (str or None): *Name* of `tf.signal` function that returns a 1D tensor window that is used in analysis.
              Defaults to `hann_window` which uses `tf.signal.hann_window`.
              Window availability depends on Tensorflow version. More details are at `kapre.backend.get_window()`
          .pad_begin(bool): Whether to pad with zeros along time axis (length: win_length - hop_length). Defaults to `False`.
          pad_end (bool): whether to pad the input signal at the end in `STFT`.
          return_decibel (bool): whether to apply decibel scaling at the end
          db_amin (float): noise floor of decibel scaling input. See `MagnitudeToDecibel` for more details.
          db_ref_value (float): reference value of decibel scaling. See `MagnitudeToDecibel` for more details.
          db_dynamic_range (float): dynamic range of the decibel scaling result.
          input_data_format (str): the audio data format of input waveform batch.
              `'channels_last'` if it's `(batch, time, channels)`
              `'channels_first'` if it's `(batch, channels, time)`
              Defaults to the setting of your Keras configuration. (tf.keras.backend.image_data_format())
          output_data_format (str): the data format of output mel spectrogram.
              `'channels_last'` if you want `(batch, time, frequency, channels)`
              `'channels_first'` if you want `(batch, channels, time, frequency)`
              Defaults to the setting of your Keras configuration. (tf.keras.backend.image_data_format())
          name (str): name of the returned layer
  
      Example:
          ::
  
              input_shape = (2048, 3)  # stereo and channels_last
              model = Sequential()
              model.add(
                  get_stft_mag_phase(input_shape=input_shape, return_decibel=True, n_fft=1024)
              )
              # now output shape is (batch, n_frame=3, freq=513, ch=6). 6 channels = [3 mag ch; 3 phase ch]
  
      """
      backend.validate_data_format_str(input_data_format)
      backend.validate_data_format_str(output_data_format)
  
      waveform_to_stft = STFT(
          n_fft=n_fft,
          win_length=win_length,
          hop_length=hop_length,
          window_name=window_name,
          pad_begin=pad_begin,
          pad_end=pad_end,
          input_data_format=input_data_format,
          output_data_format=output_data_format,
      )
  
      stft_to_stftm = Magnitude()
      stft_to_stftp = Phase()
  
      waveforms = keras.Input(shape=input_shape)
  
      stfts = waveform_to_stft(waveforms)
      mag_stfts = stft_to_stftm(stfts)  # magnitude
      phase_stfts = stft_to_stftp(stfts)  # phase
  
      if return_decibel:
          mag_to_decibel = MagnitudeToDecibel(
              ref_value=db_ref_value,
              amin=db_amin,
              dynamic_range=db_dynamic_range,
          )
          mag_stfts = mag_to_decibel(mag_stfts)
  
      ch_axis = 1 if output_data_format == _CH_FIRST_STR else 3
  
      concat_layer = keras.layers.Concatenate(axis=ch_axis)
  
      stfts_mag_phase = concat_layer([mag_stfts, phase_stfts])
  
      model = Model(
          inputs=waveforms, outputs=stfts_mag_phase, name=name
      )
      return model
  
file_path: kapre/kapre/composed.py
imports: from tensorflow import keras
  from tensorflow.keras import Sequential, Model
  from .time_frequency import STFT, InverseSTFT, Magnitude, Phase, MagnitudeToDecibel, ApplyFilterbank, ConcatenateFrequencyMap
  from .None import backend
  from .backend import _CH_FIRST_STR, _CH_LAST_STR, _CH_DEFAULT_STR
label_desc: Use image node_id 5 for calling a global function with example usage: get_stft_mag_phase(input_shape, n_fft, win_length, hop_length, window_name, pad_begin, pad_end, return_decibel, db_amin, db_ref_value, db_dynamic_range, input_data_format, output_data_format, name) and returns: model