I must estimate the direction of arrival of an acoustic source, and I hope to distinguish between a voice input and musical input using a frequency cutoff. In order to do this, I apply the same bandpass elliptic filter on the left and right channels of the stereo microphone. I have applied the filter to white noise and verified using a spectrogram that the filter does indeed retain the frequencies that it is designed to retain. I calculate the power after filtering, and use a power threshold to decide whether the frame of data is noise or not. I then use cross-correlation between the left and right channel, to estimate the time delay between left and right channels, and use that to calculate the angle of arrival.
I had first simulated the situation with two signals in numpy, with random noise added to it, and delayed by a certain number of samples. I then applied the same filter to the 'left' and 'right' channels, where the 'right' channel was simply delayed by a certain number of samples from the 'left', and random noise added. I was then able to compute the correct delay between the signals by giving the filtered 'left' and 'right' channels as input to the cross-correlator.
In real time, however, after applying the filter to the left and right channels, the time delay is neither accurate not consistent. Could it be possible that the process of computing and applying the filter (in python) is interfering with the acquisition of signals, thereby adding some random time delays and making my time delay measurements entirely inaccurate? If so, how would I go about resolving the issue?