Path: news.mathworks.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!news.mathforum.org!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: real-time data acquisition from a custom device
Date: Tue, 17 Mar 2009 20:45:14 EDT
Organization: The Math Forum
Lines: 12
Message-ID: <13504335.1237337144959.JavaMail.jakarta@nitrogen.mathforum.org>
NNTP-Posting-Host: nitrogen.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1237337144 12620 144.118.30.135 (18 Mar 2009 00:45:44 GMT)
X-Complaints-To: news@news.mathforum.org
NNTP-Posting-Date: Wed, 18 Mar 2009 00:45:44 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:525712


I try to receive and process sound data frame by frame from a custom audio input board with USB interface in MATLAB. I have used this board through windows drivers and C APIs successfully in C world.

At first, I made a data receiving thread with C-MEX to copy frame buffers and call matlab functions to process and visualize the data. But, I realized that mex functions like mexCallMATLAB are not thread-safe functions. I had no idea to proceed.

Next, I noticed that the DAQ toolbox adaptor kit may work. Here, I don’t want to implement complicated timing codes. Just need places for Init, Start, Stop function and a thread for calling a MATLAB function with a sound frame. 

Do you have any idea or suggestion?
Other fancy solutions are welcome.

If the use of DAQ toolbox is best, I need simple examples or tutorials relevant to my problem. 

Thanks in advance.