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)
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.
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.
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.
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.
@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.
Need help, how to run file DaqBasicAnalogInExample.m and DaqBasicAnalogOutExample.m in MATLAB? tq
Updates to title, summary and description to make the submission text clearer and better searchable
Added basic AnalogInput and AnalogOutput examples and improved stability of measurement example.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.