I'm trying to use the SciPy implementation of the Continuous Wavelet Transform to analyze EEG data.
I am using The problem is that I have no idea what the width parameter should be. It says that it's a list of "widths" for the wavelet, but I have no idea what these widths should be. Playing around with the scipy Ricker function directly seems to indicate that it should relate to sample frequency somehow (as the same width with different number of points is quite different) but I don't know how.
Let's say, for example, that I have a 2 second signal consisting of two sine waves, one at 50 Hz and one at 100 Hz, both sampled at 1000 Hz. I want to create a scalogram of this signal, and my region of interest is between 10 Hz and 150 Hz. What should the widths parameter be? How does the "width" of the Ricker function relate to various frequencies?
Below is a script attempting to use this function with very different values for the width:
import numpy as np
from numpy import pi
import matplotlib.pyplot as plt
from scipy.signal import cwt, ricker
fs = 1000.0
t0 = 0.0
t1 = 4.0
N = int((t1-t0)*fs)
t = np.linspace(t0,t1,N)
s = np.sin(2*pi * 50*t) + np.sin(2*pi * 100*t)
widths1 = np.arange(0.1,10.0,0.1)
widths2 = np.arange(1.0,500.0,1.0)
cwtmatr1 = cwt(s,ricker,widths1)
cwtmatr2 = cwt(s,ricker,widths2)
Producing the two images below. Neither seem very illuminating.