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
2021-6-5
Maybe find the lag from a crosscorrelation?
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 Exchange 中查找有关 MATLAB 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!