def test_hermitian_multitaper_csd():

    sig = np.random.randn(4,256)

    _, csd1 = tsa.multi_taper_csd(sig, adaptive=False)

    for i in range(4):
        for j in range(i+1):
            xc1 = csd1[i,j]
            xc2 = csd1[j,i]
            npt.assert_equal(
                xc1, xc2.conj(), err_msg='MTM CSD not Hermitian'
                )

    _, psd, _ = tsa.multi_taper_psd(sig, adaptive=False)
    for i in range(4):
        npt.assert_almost_equal(
            psd[i], csd1[i,i].real,
            err_msg='MTM CSD diagonal inconsistent with real PSD'
            )
The toElement method returns a form's DOM representation.
dataset/ETHPy150Open nipy/nitime/nitime/algorithms/tests/test_spectral.py/test_hermitian_multitaper_csd--crossover with--dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_data_form.py/FormTest.test_toElement