#NEWLINE# def test_MorletWaveletAnalyzer( ) : #NEWLINE# #INDENT# 'Testing the MorletWaveletAnalyzer ' #NEWLINE# time_series = ts . TimeSeries ( data = np . random . rand ( 100 ) , sampling_rate = 100 ) #NEWLINE# W = nta . MorletWaveletAnalyzer ( time_series , freqs = 20 ) #NEWLINE# WL = nta . MorletWaveletAnalyzer ( time_series , freqs = 20 , log_morlet = True ) #NEWLINE# H = nta . HilbertAnalyzer ( W . real ) #NEWLINE# HL = nta . HilbertAnalyzer ( WL . real ) #NEWLINE# npt . assert_almost_equal ( np . sin ( H . phase . data [ 10 : ( - 10 ) ] ) , np . sin ( W . phase . data [ 10 : ( - 10 ) ] ) , decimal = 0 ) #NEWLINE# npt . assert_almost_equal ( np . sin ( HL . phase . data [ 10 : ( - 10 ) ] ) , np . sin ( WL . phase . data [ 10 : ( - 10 ) ] ) , decimal = 0 )