ffrprep.analysis.corr_resp_to_resp¶
- ffrprep.analysis.corr_resp_to_resp(resp1, resp2, sfreq)[source]¶
Compute the correlation between two brain responses.
The function compares two brain responses to each other across various time lags and returns the strongest correlation and lag pair where the strongest correlation is.
- Parameters:
resp1 (array-like) – First brain response signal, should represent a single time-series
resp2 (array-like) – Second brain response signal, should represent a single time-series
sfreq (float) – Sampling frequency, used to convert lag values to milliseconds
- Returns:
peak_corr (float) – The highest correlation value between the two responses
peak_lag (float) – The lag at which the maximum correlation occurs.