File Exchange

image thumbnail

Live data acquisition for real-time signal processing in MATLAB

version 1.4 (651 KB) by

Stream signals to and from data acquisition hardware using simple for or while loops

21 Downloads

Updated

View License

This code extends the Data Acquisition Toolbox by providing a simple interface to stream signals to and from data acquisition hardware within for or while loops, and to apply signal processing algorithms in MATLAB on live real-world data.
Use dspdemo.DAQRecorder to acquire live data, and dspdemo.DAQPlayer to generate live data. These system objects work with any of the hardware supported by Data Acquisition Toolbox for AnalogInput/AnalogOutput in continuous mode.

This new interface allows you to
- Get or push arrays of samples to/from data acquisition hardware, directly within for or while loops
- Discover installed and compatible hardware by inspecting the properties of a single object
- Connect with data acquisition devices via the same programming pattern used in a number of MATLAB Toolboxes for other hardware interfaces (e.g. for audio cards, video cameras, software defined radios, Ethernet sockets)

Comments and Ratings (10)

Hi James, thank you for your feedback. It has been a while this project hasn't been maintained, but the basic principles of device discovery are the same as for the regular functionality in Data Acquisition Toolbox (e.g. as described in http://www.mathworks.com/help/daq/discover-hardware-devices.html).
dspdemo.DAQRecorder should recognize regular 'Analog Output' devices, but may not be able to cope with different interfaces types.

James Ashton

Hey,

So I installed the files and am trying to incorporate it into my code but the demoDSP.DAQplayer isn't finding my DAQ card. The
"DeviceName" field is (no devices) but the DAQrecorder is.

Hi Silken, Thank you for posting your question. To install, unzip the archive into a permanent folder, navigate to that folder, and run InstallMe, e.g. using the MATLAB command line. To check that the installation was successful, check that the folder in question and its subfolder .\Data have been added to the MATLAB path (e.g. using pathtool).
Please note this submission has last been tested with R2014a.

Silken Jones

How do I install the files/test if they're successfully installed?

Hi Taka. Thank you for leaving a comment and apologies for the late response due to a glitch in the notification system.
This object gives you an easier interface to stream from multiple channels of the same type in a single device. If you need to stream simultaneously from more channels across different devices in the same chassis, I recommend using the interface provided by Data Acquisition Toolbox directly, e.g. refer to daq.createSession or addAnalogInputChannel, startForeground, or startBackground. I hope this helps.

taka

taka (view profile)

Is this code available to record from multiple channels?

Great piece of work!
System Object for Data Acquisition are definitely missing in the product.
This submission enabled me to easily and quickly create a sound level meter app in MATLAB.
Thanks

@prie: Both files should simply run in MATLAB (e.g. by typing the file name at command prompt) if you have a compatible data acquisition card/device installed.
To understand things even better, I suggest opening the example scripts in the MATLAB Editor, reading through the comments and executing the
code section by section.
Apologies for missing your comment. Please feel free to contact me directly for help if that's still needed.

prie

prie (view profile)

Need help, how to run file DaqBasicAnalogInExample.m and DaqBasicAnalogOutExample.m in MATLAB? tq

prie

prie (view profile)

Updates

1.4

Updates to title, summary and description to make the submission text clearer and better searchable

1.3

Added basic AnalogInput and AnalogOutput examples and improved stability of measurement example.

MATLAB Release
MATLAB 8.3 (R2014a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today