Path: news.mathworks.com!not-for-mail
From: "Free " <free.claessens@student.kuleuven.be>
Newsgroups: comp.soft-sys.matlab
Subject: Simulink: playing and recording audio at the same time
Date: Tue, 27 Oct 2009 19:05:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 7
Message-ID: <hc7g90$fel$1@fred.mathworks.com>
Reply-To: "Free " <free.claessens@student.kuleuven.be>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1256670304 15829 172.30.248.38 (27 Oct 2009 19:05:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 27 Oct 2009 19:05:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2062837
Xref: news.mathworks.com comp.soft-sys.matlab:580430


Hi

I setup a simple simulink circuit consisting of a sine wave generator, a speaker ('to audio device' - block), a microphone ('from audio device' - block) and a 'To workspace' - block. The purpose is to play the sinus trough my loudspeaker, recording it AT THE SAME TIME with my microphone and then write the recorded signal to the MATLAB workspace. This all goes well but when I plot the recorded signal in MATLAB I get alternating zero - sine wave - zero - sine wave - zero - and so on... This while I expect a continuous (noisy) sine wave...

What could be the problem? I'm working under Linux. Maybe it is because of the linux scheduler which gives both tasks (play & record) alternating some processor time. Has anybody a solution?

Thanks