

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

dataset/ETHPy150Open QuantEcon/QuantEcon.py/quantecon/estspec.py periodogram/VarMisuse@84/506 `n`->`I_w`