# What is “automated cross-correlation” and how can I do it in Matlab?

16 views (last 30 days)
Dominik Stolfa on 30 Nov 2023
Commented: Dominik Stolfa on 30 Nov 2023
I came across one article saying this: “ An automated cross-correlation of the recorded signal with the sequence of on/off stimulus states (m-sequence steps) for a specific hexagon allows for the extraction of the corresponding local ERG.” It is talking about splitting one mfERG signal into several ones according to their time delays (and areas) each area has different delay. How can I do it in Matlab?

Pratik on 30 Nov 2023
In MATLAB, you can achieve this by performing cross-correlation and signal processing operations. Here's a general outline of how you can approach this:
2. Create M-Sequence Steps: Generate the sequence of on/off stimulus states (m-sequence steps) for a specific hexagon.
3. Cross-correlation: Use the xcorr function in MATLAB to perform cross-correlation between your recorded signal and the m-sequence steps. This will help you identify time delays and areas where the signal correlates with the stimulus states.
4. Identify Peaks: After cross-correlation, you can identify peaks in the cross-correlation result to pinpoint the time delays and areas where the local ERG responses occur.
5. Extract Local ERG: Based on the identified peaks, extract the corresponding local ERG signals from the original mfERG signal.
Here's a basic code outline to get you started:
% Generate the m-sequence steps for the specific hexagon
mSequence = generateMSequence(hexagon); % Replace with your m-sequence generation method
% Perform cross-correlation
[correlation, lag] = xcorr(mfERG_signal, mSequence);
% Find peaks in the cross-correlation result
[peaks, peak_locs] = findpeaks(correlation);
% Extract local ERG based on identified peaks
localERG = extractLocalERG(mfERG_signal, peak_locs);
Remember to replace the placeholder functions (generateMSequence, extractLocalERG) with your actual implementation for generating m-sequence steps and extracting local ERG signals. Additionally, you may need to adjust the cross-correlation and peak-finding parameters based on your specific data and requirements.
Dominik Stolfa on 30 Nov 2023
Thank you very much. One more thing if you don’t mind. What is the difference between cross-corelation and automated cross-corelation?