def periodogram(x, window=None, window_len=7):
    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
Computes the periodogram
dataset/ETHPy150Open QuantEcon/QuantEcon.py/quantecon/estspec.py/periodogram