#NEWLINE# def test_hermitian_multitaper_csd( ) : #NEWLINE# #INDENT# '\n    Make sure CSD matrices returned by various methods have\n    Hermitian symmetry.\n    ' #NEWLINE# sig = np . random . randn ( 4 , 256 ) #NEWLINE# ( _ , csd1 ) = tsa . multi_taper_csd ( sig , adaptive = False ) #NEWLINE# for i in range ( 4 ) : #NEWLINE# #INDENT# for j in range ( ( i + 1 ) ) : #NEWLINE# #INDENT# xc1 = csd1 [ ( i , j ) ] #NEWLINE# xc2 = csd1 [ ( j , i ) ] #NEWLINE# npt . assert_equal ( i , xc2 . conj ( ) , err_msg = 'MTM CSD not Hermitian' ) #NEWLINE# #UNINDENT# #UNINDENT# ( _ , psd , _ ) = tsa . multi_taper_psd ( sig , adaptive = False ) #NEWLINE# for i in range ( 4 ) : #NEWLINE# #INDENT# npt . assert_almost_equal ( psd [ i ] , csd1 [ ( i , i ) ] . real , err_msg = 'MTM CSD diagonal inconsistent with real PSD' )