features.xcor_acor_ratio
features.xcor_acor_ratio(v, geometry, n_neighbor=3)Compute cross-correlation over auto-correlation ratio.
This function calculates the ratio of cross-correlation between neighboring channels over the auto-correlation for each channel in the AP band data.
Args: v (np.ndarray): Voltage array for AP band with shape (nc, ns) where nc is number of channels and ns is number of samples. geometry (dict): Geometry dictionary with ‘x’ and ‘y’ arrays for electrode positions. n_neighbor (int, optional): Number of neighboring channels to consider. Defaults to 3.
Returns: np.ndarray: Array of size (nc,) containing the correlation ratios.
Note: The function computes covariance matrices and extracts diagonal elements to calculate cross-correlation ratios for neighboring channels.