#NEWLINE# def direct_hilbert( x ) : #NEWLINE# #INDENT# fx = fft ( w ) #NEWLINE# n = len ( fx ) #NEWLINE# w = ( fftfreq ( n ) * n ) #NEWLINE# w = ( 1j * sign ( w ) ) #NEWLINE# return ifft ( ( w * fx ) )