In [4]:
%load_ext autoreload
%autoreload 2

import waipy
import numpy as np


z = np.linspace(0,2048,2048)
x = np.sin(50*np.pi*z)+3.5*np.randn(size(z))
y = np.cos(50*np.pi*z+pi/4)+4*np.randn(size(z))

data_norm = waipy.normalize(x)
result = waipy.cwt(data_norm, 1, 1, 0.25, 4, 4/0.25, 0.72, 6, mother='Morlet',name='x')
waipy.wavelet_plot('Sine with noise', z, data_norm, 0.03125, result)

data_norm1 = waipy.normalize(y)
result1 = waipy.cwt(data_norm1, 1, 1, 0.25, 4, 4/0.25, 0.72, 6, mother='Morlet',name='y')
waipy.wavelet_plot('Cosine with noise', z, data_norm1, 0.03125, result1)

cross_power, coherence, phase_angle = waipy.cross_wavelet(result['wave'], result1['wave'])
figname='example3.png'
waipy.plot_cross('Crosspower sine and cosine', cross_power, phase_angle, z, result, result1,figname)


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-fdb5ad5ae826> in <module>()
      7 
      8 z = np.linspace(0,2048,2048)
----> 9 x = np.sin(50*np.pi*z)+3.5*np.randn(size(z))
     10 y = np.cos(50*np.pi*z+pi/4)+4*np.randn(size(z))
     11 

AttributeError: module 'numpy' has no attribute 'randn'

In [7]:
np.random.randn


Out[7]:
<function RandomState.randn>

In [ ]: