coherence_analysis#
- class braintools.metric.coherence_analysis(lfp1, lfp2, dt, nperseg=None)#
Compute coherence between two LFP signals.
- Parameters:
lfp1 (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – LFP signals with shape (n_time,).lfp2 (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – LFP signals with shape (n_time,).dt (
float) – Sampling interval in seconds.nperseg (
int) – Length of each segment. Default: n_time // 8.
- Return type:
- Returns:
freqs (jax.Array) – Array of sample frequencies.
coherence (jax.Array) – Magnitude-squared coherence.