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 件のコメント

Eline Somberg
Eline Somberg 2021 年 6 月 5 日
Maybe find the lag from a crosscorrelation?
Walter Roberson
Walter Roberson 2021 年 6 月 5 日
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 ExchangeMATLAB についてさらに検索

製品

タグ

質問済み:

2013 年 10 月 3 日

コメント済み:

2021 年 6 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by