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 Kommentare

Eline Somberg
Eline Somberg am 5 Jun. 2021
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 3 Okt. 2013

Kommentiert:

am 5 Jun. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by