code: def _fast_fourier_transform(
      X, norm, dft_length, inverse_sqrt_win_size
  ):
      """Perform a discrete fourier transform using the fast fourier transform.
  
      if self.norm is True, then the first term of the DFT is ignored
  
      Input
      -------
      X : The training input samples.  array-like or sparse matrix of
      shape = [n_samps, num_atts]
  
      Returns
      -------
      1D array of fourier term, real_0,imag_0, real_1, imag_1 etc, length
      num_atts or
      num_atts-2 if if self.norm is True
      """
      # first two are real and imaginary parts
      start = 2 if norm else 0
      length = start + dft_length
      dft = np.zeros((len(X), length))  # , dtype=np.float64
  
      stds = np.zeros(len(X))
      for i in range(len(stds)):
          stds[i] = np.std(X[i])
      # stds = np.std(X, axis=1)  # not available in numba
      stds = np.where(stds < 1e-8, 1e-8, stds)
  
      with objmode(X_ffts="complex128[:,:]"):
          X_ffts = np.fft.rfft(X, axis=1)  # complex128
      reals = np.real(X_ffts)  # float64[]
      imags = np.imag(X_ffts)  # float64[]
      dft[:, 0::2] = reals[:, 0 : length // 2]
      dft[:, 1::2] = imags[:, 0 : length // 2]
      dft /= stds.reshape(-1, 1)
      dft *= inverse_sqrt_win_size
  
      return dft[:, start:]
  
file_path: sktime/sktime/transformations/panel/dictionary_based/_sfa_fast_numba.py
imports: import math
  from warnings import simplefilter
  import numpy
  from sktime.utils.numba.njit import njit
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 2 for calling a global function with example usage: _fast_fourier_transform(X, norm, dft_length, inverse_sqrt_win_size) and returns: dft