pactools.utils.spectrum.Bicoherence

class pactools.utils.spectrum.Bicoherence(block_length=1024, fft_length=None, step=None, wfunc=<function hamming>, fs=1.0)[source]

Bicoherence estimator

Parameters
block_lengthint

Length of each signal block, on which we estimate the spectrum

fft_lengthint or None

Length of FFT, should be greater or equal to block_length. If None, it is set to block_length

stepint or None

Step between successive blocks If None, it is set to half the block length (i.e. 0.5 overlap)

wfuncfunction

Function used to compute the weitghting window on each block. Examples: np.ones, np.hamming, np.bartlett, np.blackman, …

fsfloat

Sampling frequency

donormboolean

If True, the amplitude is normalized

__init__(self, block_length=1024, fft_length=None, step=None, wfunc=<function hamming at 0x7fd5ecd21d30>, fs=1.0)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self[, block_length, fft_length, …])

Initialize self.

check_params(self)

fit(self, sigs[, method])

Computes the bicoherence for one signal

main_frequency(self)

Extract the frequency of the maximum in the spectrum

periodogram(self, signals[, hold, mean_psd])

Computes the estimation (in dB) for each epoch in a signal

plot(self[, fig, ax])

plots the power spectral density warning: the plot will only appear after plt.show()