def test_periodogram():

    arsig, _, _ = utils.ar_generator(N=1024)
    Sk = fftpack.fft(arsig)

    f1, c1 = tsa.periodogram(arsig)
    f2, c2 = tsa.periodogram(arsig, Sk=Sk)

    npt.assert_equal(c1, c2)

    # Check that providing a complex signal does the right thing
    # (i.e. two-sided spectrum):
    N = 1024
    r, _, _ = utils.ar_generator(N=N)
    c, _, _ = utils.ar_generator(N=N)
    arsig = r + c * scipy.sqrt(-1)

    f, c = tsa.periodogram(arsig)
    npt.assert_equal(f.shape[0], N)  # Should be N, not the one-sided N/2 + 1
Show Siblings of the current page and all children
dataset/ETHPy150Open nipy/nitime/nitime/algorithms/tests/test_spectral.py/test_periodogram--crossover with--dataset/ETHPy150Open davemerwin/blue-channel/bluechannel/page/templatetags/page_tags.py/get_submenu