spkit.cwt.WavePSD

spkit.cwt.WavePSD(x, t, wType='Gauss', PlotW=False, PlotPSD=True, dFFT=False, nFFT=False, reshape=True, **Parameters)

Wavelet Power Spectral Density

Note

This is experimental function, Use ScalogramCWT instead.

Warning

This is experimental function, Use ScalogramCWT instead.

  1. For Gauss : f0 =Array, Q=float, t0=float=0, f=Freq Range

  2. For Morlet : sig=Array, f=Freq Range

  3. For Gabor : f0 =Array, a=float, t0=float=0, f=Freq Range

  4. For Poisson: n =Array, f=Freq Range

  5. For Complex MaxicanHat, f0=freq shift f=Freq Range

  6. For Complex Shannon , f0=freq shift,fw=BandWidth f=Freq Range

Parameters:
x: array-like, input signal,
t: array-like, time array corresponding to x, same length as x
fs: sampling rate
PlotPSD: bool, if True, plot Scalogram
PlotWbool, if True, plot wavelets in time and frequecy with different scalling version
fftMeth: if True, FFT method is used, else convolution method is used. FFT method is faster.
interpolation: str, or None, interpolation while ploting Scalogram.
Parameters for different wavelet functions
Common Parameters for all the Wavelet functions
farray of frequency range to be analysed, e.g. np.linspace(-10,10,2*N-1), where N = len(x)

: if None, frequency range of signal is considered from -fs/2 to fs/2 : ( fs/n1*(np.arange(n1)-n1/2))

A list of wavelets will be generated for each value of scale (e.g. f0, sigma, n etc)
1. Gauss: (wType ==’Gauss’)

f0 = array of center frquencies for wavelets, default: np.linspace(0.1,10,100) [scale value] Q = float or array of q-factor for each wavelet, e.g. 0.5 (default) or np.linspace(0.1,5,100)

: if array, should be of same size as f0

t0 = float=0, time shift of wavelet, or phase shift in frquency, Not suggeestive to change

2. For Morlet: (wType ==’Morlet’)

sig = array of sigma values for morlet wavelet, default: np.linspace(0.1,10,100) [scale value] fw = array of frequency range, e.g. np.linspace(-10,10,2*N-1), where N = len(x) ref: https://en.wikipedia.org/wiki/Morlet_wavelet

3. For Gabor: (wType ==’Gabor’)

Gauss and Gabor wavelet are essentially same f0 = array of center frquencies for wavelets, default: np.linspace(1,40,100) [scale value] a = float, oscillation parameter, default 0.5,

could be an array (not suggeestive), similar to Gauss, e.g np.linspace(0.1,1,100) or np.logspace(0.001,0.5,100)

t0 = float=0, time shift of wavelet, or phase shift in frquency. Not suggeestive to change

4. For Poisson: (wType==’Poisson’)

n = array of intergers, default np.arange(100), [scale value] method = 1,2,3, different implementation of Poisson funtion, default 3 keep the method=3, other methods are under development and not exactly compatibile with framework yet,

ref: https://en.wikipedia.org/wiki/Poisson_wavelet

5. For Complex MaxicanHat: (wType==’cMaxican’)

f0 = array of center frquencies for wavelets, default: np.linspace(1,40,100) [scale value] a = float, oscillation parameter, default 1.0, could be an array (not suggeestive)

ref: https://en.wikipedia.org/wiki/Complex_Mexican_hat_wavelet

6. For Complex Shannon: (wType==’cShannon’)

f0 = array of center frquencies for wavelets, default: 0.1*np.arange(10) [scale value], fw = BandWidth each wavelet, default 0.5, could be an array (not suggeestive)

ref: https://en.wikipedia.org/wiki/Shannon_wavelet

Returns:
XW: Complex-valued matrix of time-scale - Scalogram, with shape (len(S), len(x)). scale vs time
Sscale values

See also

ScalogramCWT

Notes

NOTE: Use ScalogramCWT instead.