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?
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에 대해 자세히 알아보기

제품

태그

질문:

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