Can someone please explain how this function? It is for simultaneously recording with the input(X) being white noise at FS 44100hz

1 vue (au cours des 30 derniers jours)
function recording = audioOI(x,fs)
% audioOI - Simulataneously plays and records the test signal.
% Uses Parallel Computing Toolbox.
% INPUT: x - test signal
% fs - sampling frequency
% OUTPUT: y - recorded signal
time = length(x)/fs; % play/record time
recObj = audiorecorder(44100,16,2);
parfor ii = 1:2
if ii==1
recordblocking(recObj, time);
recording{ii} = getaudiodata(recObj);
elseif ii==2
soundsc(x, fs);
end
end

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by