In [2]:
%load_ext autoreload
%autoreload 2
import waipy
import numpy as np

x = np.linspace(0,100,100)
y1 = np.random.rand(100)  # Generation of the Random Signal 1
y2 = np.random.rand(100)  # Generation of the Random Signal 2
#print x
data_norm = waipy.normalize(y1)
data_norm1 = waipy.normalize(y2)

result = waipy.cwt(data_norm, 1, 1, 0.25, 2, 4/0.25, 0.72, 6, mother='Morlet',name='x')
result1 = waipy.cwt(data_norm1, 1, 1, 0.25, 2, 4/0.25, 0.72, 6, mother='Morlet',name='y')

waipy.wavelet_plot('y1-signal', x, data_norm, 0.03125, result)
waipy.wavelet_plot('y2-signal', x, data_norm1, 0.03125, result1)

cross_power, coherence, phase_angle = waipy.cross_wavelet(result['wave'], result1['wave'])
figname='example2.png'
waipy.plot_cross('Crosspower two random signals', cross_power, phase_angle, x, result, result1,figname)


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
64 64
64 64
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/numeric.py:492: ComplexWarning: Casting complex values to real discards the imaginary part
  return array(a, dtype, copy=False, order=order)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/ma/core.py:2778: ComplexWarning: Casting complex values to real discards the imaginary part
  order=order, subok=True, ndmin=ndmin)

In [18]:
np.log2(0.1)


Out[18]:
-3.3219280948873622