pybispectra.cfc.AAC#

class pybispectra.cfc.AAC(data: ndarray, freqs: ndarray, sampling_freq: int | float, times: ndarray | None = None, verbose: bool = True)[source]#

Class for computing amplitude-amplitude coupling (AAC).

Parameters:
datandarray, shape of [epochs, channels, frequencies, times]

Amplitude (power) of the time-frequency representation (TFR) of data.

freqsndarray, shape of [frequencies]

Frequencies (in Hz) in data. Frequencies are expected to be evenly spaced.

sampling_freqint | float

Sampling frequency (in Hz) of the data from which data was derived.

timesndarray, shape of [times] | None

Timepoints (in seconds) in data. If data has a times dimension and times = None, the time of the first sample in data is assumed to be 0 seconds.

Added in version 1.3.

verbosebool (default True)

Whether or not to report the progress of the processing.

Attributes:
resultsResultsCFC

AAC results.

datandarray, shape of [epochs, channels, frequencies, times]

Amplitude (power) of the TFR of data.

freqsndarray, shape of [frequencies]

Frequencies (in Hz) in data.

sampling_freqint | float

Sampling frequency (in Hz) of data.

verbosebool

Whether or not to report the progress of the processing.

Methods

compute([indices, f1s, f2s, times, n_jobs])

Compute AAC, averaged over epochs.

copy()

Return a copy of the object.

compute(indices: tuple[tuple[int]] | None = None, f1s: tuple[int | float] | None = None, f2s: tuple[int | float] | None = None, times: tuple[int | float] | None = None, n_jobs: int = 1) None[source]#

Compute AAC, averaged over epochs.

Parameters:
indicestuple of tuple of int, length of 2 | None (default None)

Indices of the seed and target channels, respectively, to compute AAC between. If None, coupling between all channels is computed.

f1stuple of int or float, length of 2 | None (default None)

Start and end lower frequencies to compute AAC on, respectively. If None, all frequencies are used.

f2stuple of int or float, length of 2 | None (default None)

Start and end higher frequencies to compute AAC on, respectively. If None, all frequencies are used.

timestuple of int or float, length of 2 | None (default None)

Start and end times (in seconds) to compute AAC on, respectively. If None, all timepoints are used.

Added in version 1.3.

n_jobsint (default 1)

Number of jobs to run in parallel. If -1, all available CPUs are used.

Notes

AAC is computed as the Pearson correlation coefficient across times for each frequency in each epoch, with coupling being averaged across epochs [1].

AAC is computed between all values of f1s and f2s.

Warning

For values of f1s higher than f2s, a numpy.nan value is returned.

References

copy()[source]#

Return a copy of the object.