cogpy.spectral.features

Spectral features derived from pre-computed PSD estimates.

Status

STATUS: ACTIVE Reason: PSD-first spectral feature extraction for iEEG channel characterization. Superseded by: n/a Safe to remove: no

Convention:

psd : (…, freq) as returned by psd_welch or psd_multitaper freqs : (freq,) Hz, strictly increasing scalar output : (…,) freq axis reduced vector output : (…, freq) same freq axis as input

Functions

am_artifact_score(psd, freqs, *, fc, fm[, ...])

log10(P_sideband / P_background).

am_depth(psd, freqs, *, fc, fm[, ...])

log10(P_sideband / P_carrier).

aperiodic_exponent(psd, freqs, *[, freq_range])

Fit 1/f aperiodic exponent via specparam (fooof).

band_power(psd, freqs, band)

Integrate PSD over band using trapezoidal rule.

broadband_snr(psd, freqs, *[, sig_band, ...])

log10(P_signal / P_noise).

fooof_periodic(psd, freqs, *[, freq_range])

Periodic component above 1/f background via specparam (fooof).

ftest_line_scan(signal, fs, *[, NW, p_threshold])

F-test line scan across all frequency bins.

line_noise_ratio(psd, freqs, *[, f_line, bw])

P_line / P_flanks.

narrowband_ratio(psd, freqs, *[, flank_hz])

Narrowband prominence ratio per frequency bin.

reduce_tf_bands(score, bands, *[, freq_dim, ...])

Reduce a frequency axis to per-band scalars.

relative_band_power(psd, freqs, band, *[, ...])

band_power(band) / band_power(norm_range).

spectral_edge(psd, freqs, *[, p])

Frequency below which fraction p of total power lies (SEF).

spectral_entropy(psd, freqs)

Shannon entropy of normalized PSD.

spectral_flatness(psd, freqs)

Spectral flatness (Wiener entropy).

spectral_peak_freqs(psd, freqs, *[, ...])

Detect discrete peak frequencies in a PSD.