morlet_func
- ketos.utils.morlet_func(time, frequency, width, displacement, norm=True, dfdt=0)[source]
Compute Morlet wavelet function
The function is implemented as in Eq. (15) in John Ashmead, “Morlet Wavelets in Quantum Mechanics”, Quanta 2012; 1: 58-70, with the replacement f -> 2*pi*f*s, to allow f to be identified with the physical frequency.
- Args:
- time: float or numpy array
Time in seconds at which the function is to be evaluated
- frequency: float
Wavelet frequency in Hz
- width: float
Wavelet width in seconds (1-sigma width of the Gaussian envelope function)
- displacement: float
Wavelet centroid in seconds
- norm: bool
Include [pi^1/4*sqrt(sigma)]^-1 normalization factor
- dfdt: float
Rate of change in frequency as a function of time in Hz per second. If dfdt is non-zero, the frequency is computed as
f = frequency + (time - displacement) * dfdt
- Returns:
- y: float or numpy array
Value of Morlet wavelet function at time t
- Example:
>>> from ketos.utils import morlet_func >>> >>> time = np.array([-1., 0., 0.5]) >>> f = morlet_func(time=time, frequency=10, width=3, displacement=0) >>> print(f) [0.41022718 0.43366254 0.42768108]