docs: def periodogram(x, window=None, window_len=7):
      r"""
      Computes the periodogram
  
      .. math::
  
          I(w) = \frac{1}{n} \Big[ \sum_{t=0}^{n-1} x_t e^{itw} \Big] ^2
  
      at the Fourier frequences :math:`w_j := \frac{2 \pi j}{n}`,
      :math:`j = 0, \dots, n - 1`, using the fast Fourier transform. Only the
      frequences :math:`w_j` in :math:`[0, \pi]` and corresponding values
      :math:`I(w_j)` are returned. If a window type is given then smoothing
      is performed.
  
      Parameters
      ----------
      x : array_like(float)
          A flat NumPy array containing the data to smooth
      window_len : scalar(int), optional(default=7)
          An odd integer giving the length of the window.  Defaults to 7.
      window : string
          A string giving the window type. Possible values are 'flat',
          'hanning', 'hamming', 'bartlett' or 'blackman'
  
      Returns
      -------
      w : array_like(float)
          Fourier frequences at which periodogram is evaluated
      I_w : array_like(float)
          Values of periodogram at the Fourier frequences
  
      """
      n = len(x)
      I_w = np.abs(fft(x))**2 / n
      w = 2 * np.pi * np.arange(n) / n  # Fourier frequencies
      w, I_w = w[:int(n/2)+1], I_w[:int(n/2)+1]  # Take only values on [0, pi]
      if window:
          I_w = smooth(I_w, window_len=window_len, window=window)
      return w, I_w