# No cross-correlation between same signal recorded using two different microphones

I've recorded the same audio signal using two microphones located at the same approximate location. However, when checking the cross-correlation using MATLAB (using the xcorr function) it is negligible, even though the signals look approximately the same and sound the same. The signals were brought to MATLAB using the audioread function. This scenario was repeated using a different set of microphones, achieving the same results.

Did anybody encounter this kind of problem in the past and has a solution?

EDIT: First of all, thank you all for the help. This is a scenario of two sources and two microphones in different locations in space. The signals clearly sound mixed (each signal contains both sources) and the microphones are synchronized and at the same sample rate of 44.1kHz. The code:

[x1,Fs1]=audioread('channel_1.wav');
[x2,Fs2]=audioread('channel_2.wav');
figure; subplot(2,1,1); plot(x1);subplot(2,1,2);plot(x2);
[R_11,lags]=xcorr(x1,x1);
R_22=xcorr(x2,x2);
R_12=xcorr(x1,x2);
figure;plot(lags,R_11);hold on;plot(lags,R_22);plot(lags,R_12);


The correlations: The signals: • It would be helpful if you posted your plots and code. You might try the autocorrelation as a diagnostic – user28715 Jun 11 '18 at 17:06
• Edited, now includes code and plot. – Guest_audio Jun 11 '18 at 17:34
• it looks like a problem but I don't know your sample rate or why you decided to specify a max lag of 1500. what kind of delay did you anticipate. – user28715 Jun 11 '18 at 17:57
• Can you please plot the two waveforms in their own plot space? Something like subplot(211) for example. I get the impression that one of the waveforms is the reverse of the other (?). If the microphones are close by, why does the blue waveform start immediately and the orange one registers a delay? Also, if you notice, the orange waveform beginnings and endings do not match. You might get something like that in a church with tenths of meters between mics and sources but if they are close by there is no reason. – A_A Jun 12 '18 at 12:47
• The plots you have added show that the two recordings have not used the same same sampling clock: The distance between the red and blue peaks increases with increasing lag time. You are probably using two unsynchronised devices for the recording. The time base difference is even large enough to suggest two entirely different sampling rates, like @Marcus Müller suggested below. Triple check your sampling rates and use synchronisation. – Jazzmaniac Jun 12 '18 at 14:23

# This answer is now obsolete.

I still keep it, because future searchers might come here with similar problems.

This is not the signal as it is now, but as it was before, when I answered: I'll do a hypothesis: the autocorrelation peaks are due to periodicity in your signal. But if that's the case, they should be the same for $R_{11}$ and $R_{22}$.

My guess is that you're comparing two recordings of different sampling rate (for example, 44.1 vs 48 kHz). But xcorr only sees the vector of numbers and doesn't know about the sampling rate!

• Indeed you are right. I'll edit with different data. – Guest_audio Jun 12 '18 at 16:44