The scalogram cone of influence is wrong when the time= parameter is set to put the axis in time units as opposed to sample indices.
import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
import cwt
# make signal
P = 17.0 # period, s
D = 100 # duration, s
N = 1000 # number of samples
x = np.linspace(0, D, N) # time, s
data = np.sin(2*np.pi/P*x)
label = 'P=%0.1f sine wave' % P
# plot signal
plt.plot(x, data)
plt.title(label)
plt.xlabel('Time [s]')
plt.ylabel('signal')
# continuous wavelet transform
scales = np.arange(200)
mother = cwt.Morlet(len_signal = len(data), scales = scales)
wavelet = cwt.cwt(data, mother)
# plot with builtin function
wavelet.scalogram(time=x, show_coi=True)
The
scalogram
cone of influence is wrong when thetime=
parameter is set to put the axis in time units as opposed to sample indices.