Delay between two audiorecorder orders?

I have the next code:
r1 = audiorecorder(Fs, nBits, chans, devs.input(3).ID);
r2 = audiorecorder(Fs, nBits, chans, devs.input(4).ID);
record(r1);
record(r2);
pause(T);
stop(r1);
stop(r2);
Where Fs, nBits, chans, devs & T are previously defined. The code runs properly, but I have a question. When I write record(r1);record(r2) the r1 recording starts before r2 recording? It's plausible because I use two different orders. The same occurs with stop orders, maybe the same delay. It is, the signals are delayed (signal r2 with respect to r1)
How can I know this time of delay? Using a sound source and 2 microphones (with sampling frequency of 96 kHz). I can't see the delay. I suppose the delay is really small.
Thank you everybody. David

2 个评论

Maybe find the lag from a crosscorrelation?
When you use multiple audiorecorder(), the delay between starting of two record() is not under your control, and there is no synchronization method provided.
Using
record(r1); record(r2)
instead of splitting them, would give less delay -- there is overhead at the beginning of every line in MATLAB.
The question was asked a number of years ago; these days the functions in Audio System Toolbox give better control.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 MATLAB 的更多信息

产品

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by