API Reference

Classifiers

rCCA(stimulus, fs[, event, onset_event, ...])

Reconvolution CCA classifier.

eCCA(lags, fs[, cycle_size, ...])

ERP CCA classifier.

Ensemble(estimator, gate)

Ensemble classifier.

EEG

generate_impulse_response(fs[, components, ...])

Generate a temporal response function (i.e., a VEP / impulse response kernel) as the sum of one or more Ricker wavelets (a biphasic bump, similar to a single-component visual evoked potential).

generate_c_vep_source(stimulus, y, n_samples, fs)

Generate a single-source c-VEP signal per trial.

generate_mixing_matrix(n_channels[, ...])

Generate a mixing matrix that projects one or more sources to channel space, simulating volume conduction.

apply_mixing_matrix(source, mixing_matrix)

Project one or more source signals to channel space using a mixing matrix.

generate_white_noise(n_trials, n_channels, ...)

Generate white sensor / measurement noise, i.e., independent and identically distributed Gaussian noise per channel and sample.

generate_pink_noise(n_trials, n_channels, ...)

Generate 1/f (pink) noise per channel, approximating the aperiodic background spectrum of EEG.

generate_line_noise(n_trials, n_channels, ...)

Generate electrical line noise (e.g., 50 Hz mains interference and its harmonics), shared (with only small gain variations) across channels, with a random phase per trial.

generate_noise(n_trials, n_channels, ...[, ...])

Generate multi-channel EEG background noise as the sum of white sensor noise, 1/f pink noise, and electrical line noise.

generate_c_vep(n_trials, n_channels, ...[, ...])

Generate a synthetic multi-channel c-VEP EEG dataset.

Envelope

aud_space_bw(fmin, fmax[, bw, scale])

Auditory scale points specified by bandwidth.

aud_to_freq(aud[, scale])

Convert auditory units at the auditory scale to frequency (Hz).

gammatone(audio, fs[, fs_inter, fs_target, ...])

Compute the envelope of audio using a gammatone filterbank.

rms(audio, fs[, fs_inter, fs_target])

Compute the envelope of the audio as the root mean square (RMS) of the signal.

erb_space_bw(fmin, fmax[, bw])

Auditory scale points specified by bandwidth.

freq_to_aud(freq[, scale])

Convert frequencies (Hz) to auditory units at the auditory scale.

Gates

AggregateGate([aggregate])

Gate described by an aggregate function.

DifferenceGate(estimator)

Gate described by classification of difference scores.

Plotting

eventplot(S, E, fs[, ax, upsample, plotfs, ...])

Plot the event time-series.

stimplot(S, fs[, ax, upsample, plotfs, labels])

Plot the stimulus time-series.

topoplot(z, locfile[, cbar, ax, iso, chan, ...])

Plot a topoplot.

Stimulus

make_apa_sequence()

Make an almost perfect auto-correlation (APA) sequence.

make_de_bruijn_sequence([k, n, seed])

Make a de Bruijn sequence.

make_golay_sequence()

Make complementary Golay sequences.

make_gold_codes([poly1, poly2, seed1, seed2])

Make a set of Gold codes.

make_m_sequence([poly, base, seed])

Make a maximum length sequence.

is_de_bruijn_sequence(stimulus[, k, n])

Check whether a stimulus is a de Bruijn sequence.

is_gold_code(stimulus)

Check whether a stimulus is a Gold code.

is_m_sequence(stimulus)

Check whether a stimulus is an m-sequence.

modulate(stimulus)

Modulate a stimulus.

shift(stimulus, stride)

Shift a code to create multiple circularly shifted versions of it.

optimize_subset_clustering(X, n_subset)

Optimize the subset by first clustering similar codes and subsequently selecting the best candidates from each cluster.

optimize_layout_incremental(X, neighbours[, ...])

Optimize the allocation of codes to a layout by considering the correlation between neighboring codes.

Stopping

BayesStopping(estimator, segment_time, fs[, ...])

Bayesian dynamic stopping.

CriterionStopping(estimator, segment_time, fs)

Criterion static stopping.

DistributionStopping(estimator, segment_time, fs)

Distribution dynamic stopping.

MarginStopping(estimator, segment_time, fs)

Margin dynamic stopping.

ValueStopping(estimator, segment_time, fs[, ...])

Value dynamic stopping.

Transformers

CCA(n_components[, gamma_x, gamma_y, ...])

Canonical correlation analysis (CCA).

Vectorizer([channel_prime])

Vectorizer.

Utilities

correct_latency(X, y, latency, fs[, axis])

Correct for a latency in data.

correlation(A, B[, n_old, avg_old, cov_old, ...])

Compute the correlation coefficient.

covariance(data[, n_old, avg_old, cov_old, ...])

Compute the covariance matrix.

decoding_matrix(data, length[, stride])

Make a Hankel-like decoding matrix.

encoding_matrix(stimulus, length[, stride, ...])

Make a Toeplitz-like encoding matrix.

euclidean(A, B[, sum_aa_old, sum_bb_old, ...])

Compute the Euclidean distance.

event_matrix(stimulus, event[, onset_event])

Make an event matrix.

filterbank(X, passbands, fs[, tmin, ftype, ...])

Apply a filterbank.

find_neighbours(layout[, border_value])

Find the neighbour pairs (horizontal, vertical, diagonal) in a rectangular layout.

find_worst_neighbour(score, neighbours, layout)

Find the neighbouring pair with maximum score.

pinv(A[, alpha])

Compute the (Moore-Penrose) pseudo-inverse of a matrix.

itr(n, p, t)

Compute the information-transfer rate (ITR).

trials_to_epochs(X, y, codes, epoch_size, ...)

Slice trials to epochs.