# Define frequencies present in the time-frequency spectrum using scipy.signal.cwt

I have a very basic question, but I didn't find a definite answer elsewhere. When we use scipy.signal.cwt we specify only one parameter widths. Do you know a function that can help to relate this widths parameter to frequencies? Like, pywt.scale2frequency() to relate scales to frequencies in pywt package. The only hint I found is here: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.morlet2.html

freq = np.linspace(1, fs/2, 100)
widths = w*fs / (2*freq*np.pi)


Can you please explain how this works?

The center frequency at scale=1 is w, which defaults to 5. Then for any other scale (cwt's width) the frequency is w / scale, i.e. w / widths.