I'm trying to define my own wavelet to perform wavelet transform on some data. The wavelet I want to define which is basically the same as the morlet wavelet, but instead of cosine I use sine.
The morlet wavelet is defined as e^(-t^2 / 2) cos(5t). I want to define a wavelet as e^(-t^2 / 2) sin(5t). I haven't been able to find any resources that provide examples of this or something similar.
I'm not sure how to define the wavelet and then how to use it when calling pywt.cwt. Like how to define it then what does wavelet = "" in pywt.cwt.
I tried to define the wavelet as a function but then I'm not sure how it's used in pywt.cwt
This is how I used the already defined morlet wavelet:
data_364 = pd.read_csv("Intensity_3.64_20220110_136K copy2.csv")
t_364 = data_364['Time'].values
y_364 = data_364['20-2'].values
dt_364 = np.array([])
for i in range(len(t_364)-1):
dt_364 = np.append(dt_364 , t_364[i+1] - t_364[i])
plt.plot(t_364[:-1], dt_364, 'o', markersize=3)
plt.semilogy()
plt.show()
#print(dt_364)
dt_364_ = 1.0656
# period range and resolution
Tmin = 1e-1
Tmax = 1e3
resolution = 2000
# wavelet transform takes normalized values centered at 0, so input signal is subtracted by 1
sig_364 = y_364-1
wavelet = 'morl'
periods = np.geomspace(Tmin, Tmax, resolution)
# coefficient for Morlet wavelet is 0.8125, don't ask
widths_364 = 0.8125*periods/dt_364_
cwtmatr_364, freqs_364 = pywt.cwt(sig_364, widths_364, wavelet, sampling_period=dt_364_)
I want to do the same thing but with the wavelet defined as e^(-t^2 / 2) sin(5t).
How do I define the wavelet properly to call it in cwtmatr_364, freqs_364 = pywt.cwt()?