code: def _mt_spectra(x, dpss, sfreq, n_fft=None, remove_dc=True):
      """Compute tapered spectra.
  
      Parameters
      ----------
      x : array, shape=(..., n_times)
          Input signal
      dpss : array, shape=(n_tapers, n_times)
          The tapers
      sfreq : float
          The sampling frequency
      n_fft : int | None
          Length of the FFT. If None, the number of samples in the input signal
          will be used.
      %(remove_dc)s
  
      Returns
      -------
      x_mt : array, shape=(..., n_tapers, n_freqs)
          The tapered spectra
      freqs : array, shape=(n_freqs,)
          The frequency points in Hz of the spectra
      """
      if n_fft is None:
          n_fft = x.shape[-1]
  
      # remove mean (do not use in-place subtraction as it may modify input x)
      if remove_dc:
          x = x - np.mean(x, axis=-1, keepdims=True)
  
      # only keep positive frequencies
      freqs = rfftfreq(n_fft, 1.0 / sfreq)
  
      # The following is equivalent to this, but uses less memory:
      # x_mt = fftpack.fft(x[:, np.newaxis, :] * dpss, n=n_fft)
      n_tapers = dpss.shape[0] if dpss.ndim > 1 else 1
      x_mt = np.zeros(
          x.shape[:-1] + (n_tapers, len(freqs)), dtype=np.complex128
      )
      for idx, sig in enumerate(x):
          x_mt[idx] = rfft(sig[..., np.newaxis, :] * dpss, n=n_fft)
      # Adjust DC and maybe Nyquist, depending on one-sided transform
      x_mt[..., 0] /= np.sqrt(2.0)
      if n_fft % 2 == 0:
          x_mt[..., -1] /= np.sqrt(2.0)
      return x_mt, freqs
  
file_path: mne-python/mne/time_frequency/multitaper.py
imports: import numpy
  from scipy.fft import rfft, rfftfreq
  from scipy.integrate import trapezoid
  from scipy.signal import get_window
  from scipy.signal.windows import dpss
  from ..parallel import parallel_func
  from ..utils import _check_option, logger, verbose, warn
label_desc: Use image node_id 5 for calling a global function with example usage: _mt_spectra(x, dpss, sfreq, n_fft, remove_dc) and returns: x_mt,  freqs