I’m new to MAX/MSP and I would like to do a simple cross-correlation between two incoming microphone signals and then extract at what lag the maximum value occurs at in this correlation. I’ve figured how to calculate the cross-correlation but, now how do I extract this lag information?
You need to search the cross-correlation for a suitably large peak. Often you normalise the cross-correlation to have a peak of one, and take the first peak that is greater than threshold (0-1). Alternatively you can skip normalisation and take the first peak that is > thresh * peak, which is equivalent. A very simple algorithm would simply always take the peak.