In [123]:
import numpy as np
import scipy.signal as signal
import scipy
import matplotlib.pyplot as plt
%matplotlib inline
n = np.arange(0,511)
x = np.exp(1.j * 0.3 * 1.*np.pi * n)
f=plt.plot(n,x.real)
f=plt.plot(n,x.imag)
In [124]:
scales = np.linspace(1e-9,np.pi*2, 512)
#scales = np.linspace(1, 512, 512)
def sinwavelet(n, f):
s = np.exp(1.j * f * 2.*np.pi * np.arange(0,n))
return s
f = plt.plot(x)
f = plt.figure()
f = plt.plot(np.abs(np.fft.fft(x)))
f = plt.figure()
w = signal.cwt(x, sinwavelet, scales)
f = plt.imshow(w, aspect='auto', extent=[0, 511, 0, 512])
In [125]:
np.linspace(0, 1, 4)
Out[125]:
In [ ]:
In [ ]:
In [ ]: