pybic.BicAn
- class pybic.BicAn(inData, **kwargs)[source]
Main class of
pybicmodule, i.e., Bicoherence Analyzer.pybic.BicAn(inData,**kwargs)A typical usage is
# Import pybic module import pybic as bic # Create time series to analyze x,t,fS = bic.TestSignal('circle') # Analyze! b = bic.BicAn(x,SampRate=fS)
Note
When using the
__init__method (i.e.,pybic.BicAn(...)), keywords are case insensitive! For example,BicAn(inData,samprate=fS),BicAn(inData,SAMPRATE=fS), andBicAn(inData,sAmPrAtE=fS)are all valid means of setting theSampRateattribute upon initialization.However, the direct augmentation of attributes is case sensitive, i.e.,
b.samprate = 100.0will throw an error!- Parameters:
inData (
ndarrayorstr) – Time series to be analyzed orTestSignal()string. Using'input'opensFileDialog()window to choose a local file for input.**kwargs – Keyword-argument pairs to set attributes (see
BicAnattributes for more info).
- Returns:
Output object.
- Return type:
Attributes
CWT alpha exponent (see
ApplyCWT()).List of axes handles.
Calculate bispectrum/bicoherence spectrum for selected
PlotSlice.Integers representing desired time series for cross-bispectrum.
Calculate bispectrogram.
Colormap for plots.
Cone of influence logarithmic cutoff (see
BicAn.SpectroWavelet()).Calculate cone of influence (COI) for CWT (see
BicAn.SpectroWavelet()).Calculate histogram of amplitude from time series (see
CalcHistVsT()).List of colorbar axes handles.
Place colorbar above plot.
Calculate cross-spectrum/cross-coherence.
Date when
pybicis loaded.Detrend input time series before analysis.
Y-axis limit for bicoherence uncertainty analysis.
Small value in polycoherence calculations.
Threshold for mean of time-frequency representation (TFR) over all frequency bins.
Log scale for frequency labels (see
ScaleToString()).Used for
BicAn.PlotGUI()functionality.Desired filter.
Plot font size in points.
Frequency resolution in Hz.
Input cone of influence (see
BicAn.SpectroWavelet()).Estimated instantaneous frequency of time-series.
Toggle behavior of user clicks in
BicAn.PlotGUI().Limit calculation to time-frequency representation (TFR), ie, no polyspectral analysis.
Duplicate of BicAn.Epsilon for back-compatability.
Maximum frequency of CWT given by
pybic.SampRate/LimFreq.Line color in plots.
Plot linewidths in points.
Number of frequency bins.
Flag for creating new colorbar axes.
Normalize bicoherence spectrum when using
BicAn.PlotBispec().User note.
Dots per inch of plots.
Run
BicAn.PlotGUI()after analysis is complete.Selected time series to plot when using
BicAn.PlotSpectro().Selected slice of TFR to plot when using
BicAn.PlotPowerSpec()andBicAn.PlotMeanHist().Desired bispectral quantity to plot (see
BicAn.PlotBispec()andBicAn.PlotPointOut()).Processed input data.
Level of randomization in bicoherence uncertainty analysis.
Raw input data.
Sampling rate in Hz.
Number of samples in processed data.
Desired axis scaling.
CWT time-frequency resolution parameter (see
ApplyCWT()).Display warning for large TFRs.
Smoothing factor in samples.
Desired time-frequency representation (TFR).
Spectrogram colorbar limits as
[vmin,vmax].STFT step in samples.
STFT subinterval size in samples.
Colormap for automatic calls to
PlotTimeline().Log scale for time labels (see
ScaleToString()).Initial time.
Tick label customization.
Calculate trispectrum.
Plot linewidths.
STFT window function (see
HannWindow()andFlatTopWindow()).Pad time series with zeros to avoid truncation for STFT.
Bicoherence spectrum.
Bispectrogram.
Bispectrum.
Bin vector of input signal histogram.
Cross-coherence.
Coherence spectrum (or 'coherogram').
Cross-spectrum.
Mean & std dev of FFT.
Full frequency vector
Fourier amplitudes
Frequency vector associated with time-frequency representation
Histogram of input signal amplitudes.
Time vector of input signal histogram.
Mean bicoherence.
Input signal histogram averaged over time.
Std dev of bicoherence spectrum.
Spectrogram (complex)
Tricoherence spectrum.
Root window for tkinter.
Variable for tkinter.
Trispectrum (complex).
Time vector associated with time-frequency representation
Methods
Apply zero padding to
Rawdata.Class wrapper for bispectral analysis.
CalcMean([Ntrials])Calculate mean of bicoherence spectrum across the full bi-frequency space.
CheckCouple(f[, checkdiff])Check nth order coupling for a given test vector of freqs.
ClickPlot(event)Callback for
BicAn.PlotGUI()clicks.Class wrapper for
SpecToCoherence().FindMaxInRange(FxLo, FxHi, FyLo, FyHi[, useb2])Finds maximum bicoherence in given range.
HistogramSig([Nbins])Class wrapper for
CalcHistVsT().InstAmpFreq(j[, calc_type, fband, realBPF, ...])Perform instantaneous amplitude and frequency analysis.
InstDiffFreq(j, k[, fband, fwindow, dist, ...])Plot the instantaneous difference frequency vs normalized bispectral modulus.
MonteCarloMax([N, Nrolls, critCoh, plot, ...])Identifies maxima in N-coherence spectra with random restart hillclimb.
ParseInput(inData, kwargs)Parse inputs for
BicAnconstructor.PlotBispec(*args[, normb2, plot3d, squeezeAxes])Plots bispectrum or bicoherence spectrum.
PlotCoherence(*args[, crossSpec, vLim])PlotGUI([SaveAs, subplotType])Main graphical interface for exploring
BicAndata.PlotHelper(whatPlot, X, Y[, IsFreq, ...])Estimate and plot distribution of bispectrum/bicoherence for single point.
PlotHisto(*args[, vLim])Plots data histogram vs time.
PlotInstFreq(j, k[, diff_freq, freq_type, ...])Perform instantaneous frequency analysis.
PlotMeanHist(*args[, vLim])Plots time average (or slice) of data histogram.
PlotPhaseDist(j, k[, ylim, SaveAs])Plots phase distribution of single point in bifrequency space.
PlotPointOut(X, Y[, IsFreq, PlotAll, ...])Wraps
BicAn.PlotHelper()forBicAn.PlotGUI().PlotPowerSpec(*args[, vLim])Plots time average (or slice) of spectrogram.
PlotSpectro(*args[, vLim, maxLine])Plots absolute value of spectrogram.
PlotTrispec([Tval, colorTricoh, elev, azim, ...])Plots trispectrum or tricoherence spectrum.
Main processing loop (see source code).
RefreshGUI([SaveAs])Refreshes GUI as initiated by
BicAn.PlotGUI().Modal warning about large FFT size.
Class wrapper for
ApplySTFT().Class method for CWT analysis.
Interactive colormap selection.
Callback function for
BicAn.SwitchCMap().SwitchPlot(event)Callback for
BicAn.PlotGUI()keypresses.Class wrapper for trispectral analysis (
SpecToTrispec()).WhichPlot([local])Assists plotting functions with data and labeling.