0

I did the cwt on a chirp signal :

import numpy as np
from scipy.signal import chirp
import matplotlib.pyplot as plt

T = 5 n = 1000 t = np.linspace(0, T, n, endpoint=False) f0 = 1 f1 = 10 y = chirp(t, f0, T, f1, method='logarithmic')

plt.plot(t, y) plt.grid(alpha=0.25) plt.xlabel('t (seconds)') plt.show()

Sinusoid with varying frequencies from 1-10 Hz

from scipy import signal
import matplotlib.pyplot as plt

widths = np.arange(1,100) #wavelet widths cwtmatr = signal.cwt(y, signal.ricker, widths)

plt.pcolormesh(t,widths,cwtmatr,shading='auto',cmap='jet')

output from cwt

As you can see I get time values on x-axis. However, I get width values on y-axis . How can I convert the width values to the corresponding wavelet frequencies ?

  • Related, apply answer to signal.ricker (compute center freq for width=1 instead of using 5). – OverLordGoldDragon Sep 30 '22 at 06:59
  • @OverLordGoldDragon Thanks for responding, but I didn't really get your answer. Do you mean that the frequency corrseponding to the width of 1 is 5hz ? But what if my signal is consisted of the frequencies which are lower than 5 ? – Fearless_Wolf Sep 30 '22 at 19:43

0 Answers0