audio - Recording from 2 microphones (simultaneously) into MATLAB -
audio - Recording from 2 microphones (simultaneously) into MATLAB -
i have 2 microphones connected y-adapter cable connects microphone port on laptop. microphones distance apart, , goal find time delay between 2 signals. however, don't think i'm reading in sound correctly. understanding should able obtain 2 separate vectors representing sound recorded each microphone. when compare plots though looks weird. amplitude on 1 plot way off scale , cant visually observe delay. can tell me i'm doing wrong? here's code:
rec1=audiorecorder(44100,16,1,1); rec2=audiorecorder(44100,16,1,2); record(rec1,5); record(rec2,5); y1=getaudiodata(rec1); y2=getaudiodata(rec2); plot(y1) figure; plot(y2)
this assumes "microphone" input stereo, otherwise assumption misguided.
myhardware=audiodevinfo; devid=myhardware.input(1).id stereo = 2 %check myhardware.input(1).name right input alter (1) until find right mic rec1=audiorecorder(44100,16,stereo,devid); recordblocking(rec1,5); y1=getaudiodata(rec1); plot(y1) left=y1(:,2); right=y1(:,1);
matlab audio signal-processing audio-recording
Comments
Post a Comment