Matrix microphones with MATLAB?


I’m completely new to RP3 and Matrix Creator but I’ve progressed to the point of being able to run the demos. Sorry if this is a naive question…

My goal is to take the microphones inputs and run them through some MATLAB scripts that I’ve got running on simulated mic input. I’ve already installed the MATLAB/RP3 interface from The Mathworks, but I’m not sure how to pull in the microphone signals to MATLAB.

The alternative (I think) would be to re-write my MATLAB scripts in Python (not trivial for me) and try running them on the Pi.

Has anyone tried either of these approaches? (Or can anyone recommend a cleaner path to microphone post-processing?) Ideally I’d like to run this real time.

My goal is to run a source localization estimator and use the LED ring to point toward the most prominent source. Think of having two or more people having a conversation in a room and being able to point toward the person speaking.

Any idea/hints/tips/etc would be greatly appreciated!

Hi @robot.scott

Sounds like a very cool project. Would be great to see it in action. I don’t use MATLAB so take what I say with a grain of salt.

On the RPI you can get the audio data from each microphone by reading a file (/tmp/matrix_micarray_channel_), where id is the microphone ID number. There’s now an additional channel that has the beamformed stream which you should ignore.

Looking through the documentation of the RPI interface, it appears to support running a shell script on the RPI (openShell). You can likely write a small shell script that reads the data (could be as simple as tail -f) and sends it to MATLAB. I don’t know if you can open on shell per channel (which would be simple) or if you need to write one script that muxes all the channels before sending the data to MATLAB (you will, of course, need to demux the data in MATLAB).


have you tried with octave running in the raspberry pi?. I don’t know if it’s possible to interface with the microphones executing external scripts for capture data and then processing the data in octave.

also another tool should be great to see in action is the support package for raspberry pi for matlab interfacing with the matrix sensor.

due the package support several kind of communication protocol maybe is possible to interface with this tool directly.

any ideas?