tag:www.mathworks.com,2005:/matlabcentral/fileexchange/feedMATLAB Central File Exchangeicon.pnglogo.pngMATLAB Central - File Exchange - category:"Data Analysis" product:"Data Acquisition Toolbox"User-contributed code library2015-01-30T11:30:59-05:00251100tag:www.mathworks.com,2005:FileInfo/438022013-10-07T15:24:28Z2014-12-02T16:34:12ZGeneration of Audio Test Signals with Matlab ImplementationGeneration of sine wave, square wave, chirp, sinc, white and pink noise via sound card.<p>The present submission is a set of seven Matlab functions that provides a generation of wave packets of:
<br />1) Sine wave signal
<br />2) Square wave signal
<br />3) Triangular wave signal
<br />4) Sawtooth wave signal
<br />5) Chirp signal
<br />6) White noise signal
<br />7) Pink noise signal
<br />8) Sinc wave signal (sin(x)/x)
<br />Each function passes the generated signal to the analog output of the sound card so one can use it for acoustic or other measurements. The signals could be followed by pause with arbitrary duration, and each signal could be formed in wave packets. </p>
<p>A brief example is given to clarify the usage of the functions. The input and output arguments are given in the beginning of each function.</p>
<p>Warning: The code is available only for sound devices that can be used with the Legacy Interface on 32-bit MATLAB.</p>
<p>The code is based on the theory described in:</p>
<p>[1] Хр. Живомиров, И. Илиев. Генериране на измервателни сигнали с приложение на Matlab. Национална конференция с м.у. „Акустика I 2013”, 11 Октомври 2013, Варна / Списание Акустика, ISSN: 1312-4897, год. XV, бр. 15, стр. 87-90, 2013.</p>
<p>[2] Signal Processing Toolbox User’s Guide.pdf. The MathWorks Inc, 1999.</p>
<p>[3] Data Acquisition Toolbox User’s Guide.pdf. The MathWorks Inc, 2005.</p>Hristo Zhivomirovhttp://www.mathworks.com/matlabcentral/profile/authors/3571337-hristo-zhivomirovMATLAB 7.11 (R2010b)Data Acquisition ToolboxSignal Processing ToolboxMATLABThe code is available only for sound devices that can be used with the Legacy Interface on 32-bit MATLAB.falsetag:www.mathworks.com,2005:FileInfo/466852014-08-12T15:40:07Z2014-09-23T16:14:45ZLive data acquisition for real-time signal processing in MATLABStream signals to and from data acquisition hardware using simple for or while loops<p>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.
<br />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.
<br />
<br />This new interface allows you to
<br />- Get or push arrays of samples to/from data acquisition hardware, directly within for or while loops
<br />- Discover installed and compatible hardware by inspecting the properties of a single object
<br />- 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)
<br />
</p>Gabriele Bunkheilahttp://www.mathworks.com/matlabcentral/profile/authors/1297680-gabriele-bunkheilaMATLAB 8.3 (R2014a)Data Acquisition ToolboxDSP System ToolboxSignal Processing ToolboxMATLABfalsetag:www.mathworks.com,2005:FileInfo/437952013-10-07T14:41:23Z2013-10-07T14:41:23ZBrain-Machine Interface (BMI) based on Electroencephalography (EEG)Real-Time Discrete Wavelet Transform and ANFIS classifier for Brain-Machine Interface based on EEG<p>Main program: bmi_three_channels</p>
<p>The explanation of the project methodology and results is presented on:
<br /><a href="http://www.youtube.com/watch?v=4IodfA_fHUM">http://www.youtube.com/watch?v=4IodfA_fHUM</a></p>
<p>The signal processing algorithm and pattern recognition system are presented in the IEEE publication:
<br />Eduardo López-Arce Vivas, Alejandro García-González, Iván Figueroa, and Rita Fuentes. Discrete Wavelet Transform and ANFIS Classifier for Brain-Machine Interface based on EEG. International Conference on Human System Interaction, 2013. (THE BEST PAPER AWARD in the area of Human Machine Interaction)
<br /><a href="http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6577814&tag=1">http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6577814&tag=1</a></p>
<p>Special Features:
<br />*Algorithm for Real-Time Discrete Wavelet Transform.
<br />*NI DAQ USB-6009 for Matlab 64-bits using listener and event.
<br />*NI DAQ USB-6009 for Matlab 64-bits: analog input and digital output simultaneous sessions.
<br />*On-line data plotted on GUI.
<br />*Off-line Short-Time Fourier Transform data analysis.
<br />*Save data acquired on GUI.</p>Eduardohttp://www.mathworks.com/matlabcentral/profile/authors/3232200-eduardoMATLAB 7.14 (R2012a)Data Acquisition ToolboxFuzzy Logic ToolboxWavelet ToolboxMATLABfalsetag:www.mathworks.com,2005:FileInfo/403242013-02-14T18:22:45Z2013-02-14T18:22:45ZWave Player Visualizations (Geek)Kviz_playerV1 is Kamya Visualization music player Version 1 have a number of Geek Visz (3D-also)<p>Want to enjoy cool Geek and 3-D visualization while listening songs. Browse your wave format music file, click play and select visualization from pop-up-menu.
<br />In next version (V2) a no. of features will be added like: playlist, animation etc.</p>Suraj Kamyahttp://www.mathworks.com/matlabcentral/profile/authors/2219789-suraj-kamyaMATLAB 7.11 (R2010b)Data Acquisition ToolboxSignal Processing ToolboxMATLABfalsetag:www.mathworks.com,2005:FileInfo/273012010-04-19T17:50:25Z2012-02-10T03:40:30ZDemonstration of Fourier transformationThe first file construct signals from Fourier terms
The second file analyzes actual signals <p>These are two M-files “fourier1” and “fourier2” The first is designed to demonstrate how triangular, rectangular, saw tooth, half wave and full wave rectified signals can be built from superposition of a predefined no of Fourier harmonic terms. It demonstrates how increasing the number of terms included in the summation will improve the signal shape.
<br />The second file is useful for analyzing actual audio signals connected to the PC line in port of the sound card. The out put of the program is plot showing all harmonic amplitudes contained in the signal.. It can be used with a microphone, a signal generator, or with any sound pre-recorded or saved and being played on the PC.
<br />
</p>aasim Azoozhttp://www.mathworks.com/matlabcentral/profile/authors/277505-aasim-azoozMATLAB 6.5 (R13)Data Acquisition Toolboxfalsetag:www.mathworks.com,2005:FileInfo/339312011-11-25T08:50:45Z2011-11-25T08:50:45ZLive audio stream analyser and voice coachA program that uses 'analoginput' to create a live audio stream, which is analyzed in real-time.<p>The program creates a real-time audio feed by using 'analoginput', which is filtered though a band pass filter and the dominant frequency is extracted with FFT and then plotted. I've thought of this script as a voice coach, so I've also plotted a few musical notes as reference on the frequency scale. In theory it is possible to create any reference sequences, which means that one could learn to sing anything perfectly. There are two other plots, the bottom-left one shows the current filtered signal and a bottom-right one shows the frequency spectrum. These plots give a picture to the user of the signal's composition.
<br />Of course this can be put to far better use than singing but that's up to you.</p>Steve Lawrencehttp://www.mathworks.com/matlabcentral/profile/authors/3200254-steve-lawrenceMATLAB 7.13 (R2011b)Data Acquisition ToolboxSignal Processing ToolboxMATLABMALAB win32falsetag:www.mathworks.com,2005:FileInfo/335212011-10-28T14:53:12Z2011-10-28T14:53:12ZmakeWavesConverts DAQ channels into WAV files<p>Converts DAQ channels into WAV files using 3rd order bandpass Butterworth filter. Note that current code is set up for 9 DAQ channels and should be changed depending on user's needs.</p>Matthew Brittonhttp://www.mathworks.com/matlabcentral/profile/authors/2951189-matthew-brittonMATLAB 7.13 (R2011b)Data Acquisition Toolboxfalsetag:www.mathworks.com,2005:FileInfo/329852011-09-23T05:49:37Z2011-09-23T05:49:37ZLaboratory froth flotation machine automation GUIThis program was designed to work as a controller for upgraded DV-2 laboratory flotation machine.<p>It is designed to work with following data acquisition cards:
<br /> - ADVANTECH PCI-1713-AE, 16 - channel differential analog input card
<br /> - ADVANTECH PCI-1720, 4 - channel analog output card</p>
<p>Following devices are connected (although these can be changed for other models with analog input/output):
<br /> - MVXF50A0-2, adjustable frequency AC drive controller (0-10V analog input)
<br /> - FMA-A2409, mass flow meter and controler (0-5V analog input and 4-20mA analog output)
<br /> - PHP-701, pH meter and controller (4-20mA analog output)
<br /> - TXDIN70, pt100 temperature transmitter (4-20mA analog output)</p>
<p>This connection makes it possible to:
<br /> - turn flotation test on/off (agitation)
<br /> - automatically adjust air flow after conditioning period is over
<br /> - measure temperature and pH
<br /> - log all of the above mentioned parameters (for each second of test) and save the results as txt or xls file</p>Ivan Brezanihttp://www.mathworks.com/matlabcentral/profile/authors/2241235-ivan-brezaniMATLAB 7.10 (R2010a)Data Acquisition Toolboxfalsetag:www.mathworks.com,2005:FileInfo/323042011-07-22T12:32:18Z2011-07-22T12:32:18ZRealtime audio inputRealtime audio input, flexible and glitch-free.<p>I explored different options for realtime audio input (see below for a summary) before having to settling for this option. Unfortunately this solution requires Windows and the Data Acquisition toolbox. I hope to be able to report at some point that this function has been superceded by something more generally useful, so please let me know if you come across something better.</p>
<p>Other possibilities:
<br />PortAudio (<a href="http://www.portaudio.com/):">http://www.portaudio.com/):</a> seem to be the workhorse of audio input, but it's in C++, not Matlab code</p>
<p>PlayRec.m (<a href="http://www.playrec.co.uk/):">http://www.playrec.co.uk/):</a> An adaptation of PortAudio for Matlab. However, support seems to have ended around 2008, and I know several people who have spent many hours failing to compile it for more recent operating systems and/or Matlab versions.</p>
<p>PsychPortAudio (<a href="http://docs.psychtoolbox.org/PsychPortAudio):">http://docs.psychtoolbox.org/PsychPortAudio):</a> This may be the best option, although it requires PsychToolbox, which can be challenging to install itself. Can anyone confirm that PsychPortAudio works for realtime audio input?</p>
<p>In the meantime, the detailed function of tgrabaudio.m is described in its help section, copied below for convenience:</p>
<p>1/ Initialisation (mandatory)
<br /> tgrabaudio('start', [fs, [maxduration]])</p>
<p> fs = the sample-rate [default = 44100]
<br /> maxduration = the maximum delay (in seconds) that is considered an
<br /> acceptable build-up of audio samples. If this buffer is
<br /> exceeded during auditory capture, an error will be generated.
<br />
<br />2/ Audio capture
<br /> wave=tgrabaudio(N);
<br />
<br /> N = the number of samples to be "grabbed".</p>
<p> wave = by default, stereo input [hard-wired: search the code for "addchannel" to adapt for mono input]</p>
<p>3/ Tidying up (mandatory)</p>
<p> tgrabaudio('stop')</p>
<p> This clears the persistent variables and stops the background audio
<br /> input. Careful, if this step is omitted, Matlab is likely to crash or
<br /> behave strangely the next time tgrabaudio is run. NB if a program that
<br /> uses tgrabaudio crashes before calling tgrabaudio('stop'), don't forget
<br /> to call tgrabaudio('stop') as soon as possible (either manually or using
<br /> Matlab's try...catch keywords).</p>
<p> EXAMPLE:</p>
<p>The following code shows how to use tgrabaudio to input sound in
<br />realtime. For demo purposes, the audio is gathered over a finite period,
<br />reconstructed into a single variable, and then simply played back.
<br />However, the same construction could be used for continuous processing of
<br />audio input.</p>
<p>>> framesamples=160; fs=16000; totalframes=100;
<br />>> wave=zeros(framesamples*totalframes,2);
<br />>> pointer=1;
<br />>> tgrabaudio('start',fs);
<br />>> for ii=1:totalframes
<br />>> framedata=tgrabaudio(framesamples);
<br />>> %do realtime processing here
<br />>> wave(pointer:pointer+framesamples-1,:)=framedata;
<br />>> pointer=pointer+framesamples;
<br />>> end;
<br />>> sound(wave,fs)</p>Trevor Agushttp://www.mathworks.com/matlabcentral/profile/authors/2504231-trevor-agusMATLAB 7.5 (R2007b)Data Acquisition ToolboxCurrently set up for Windows. May be easy to adapt for other operating systems (keep me posted, and I'll update accordingly).18596falsetag:www.mathworks.com,2005:FileInfo/239542009-04-28T23:07:21Z2010-04-12T04:00:40ZMATLAB Programming Example for U2500A USB Modular Data Acquisition (DAQ) module’s Analog InputThis program sets the USB DAQ module to sample immediately without waiting for a trigger signal<p>Models in the family that supports the data acquisition toolbox are the U2531A, U2541A, and U2542A.
<br />
<br />In order to use these devices with the MATLAB data acquisition toolbox software, you need to install MATLAB and Agilent software components and applications, connect the USB multifunction DAQ device, and install the respective drivers.
<br />
<br />This example requires the instrument’s respective IVI-COM instrument driver to be installed in order to operate. This driver can be downloaded for free at:
<br /><a href="http://www.agilent.com/find/ivi-com">http://www.agilent.com/find/ivi-com</a>
<br />
<br />This example also requires VISA software to be installed in order to connect to the instrument using IVI-COM drivers. The software is included in the Agilent IO Libraries and is available for download at:
<br /><a href="http://www.agilent.com/find/iosuite">http://www.agilent.com/find/iosuite</a>
<br />
<br />Useful MATLAB resources:
<br />1. Summary sheet: Using MATLAB with Agilent Instruments
<br /><a href="http://www.home.agilent.com/agilent/redirector.jspx?action=ref&lc=eng&cc=US&nfr=&ckey=1325209&cname=AGILENT_EDITORIAL">http://www.home.agilent.com/agilent/redirector.jspx?action=ref&lc=eng&cc=US&nfr=&ckey=1325209&cname=AGILENT_EDITORIAL</a>
<br />2. Overview of MATLAB: <a href="http://www.mathworks.com/agilent/matlab">http://www.mathworks.com/agilent/matlab</a>
<br />3. Overview of MATLAB Data Acquisition Toolbox: <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/daq/index.html?/access/helpdesk/help/toolbox/daq/f5-32960.html&http://www.mathworks.com/cgi-bin/texis/webinator/search/">http://www.mathworks.com/access/helpdesk/help/toolbox/daq/index.html?/access/helpdesk/help/toolbox/daq/f5-32960.html&http://www.mathworks.com/cgi-bin/texis/webinator/search/</a>
<br />4. Overview of using MATLAB with Agilent Instruments: <a href="http://www.mathworks.com/agilent/overview">http://www.mathworks.com/agilent/overview</a>
<br />5. For more MATLAB program examples and information: <a href="http://www.mathworks.com/matlabcentral/">http://www.mathworks.com/matlabcentral/</a>
<br />
<br />For More Information
<br />1. Receive a trial of MATLAB and MATLAB’s Data Acquisition Toolbox:
<br /><a href="http://www.mathworks.com/agilent/daq/tryit.html">http://www.mathworks.com/agilent/daq/tryit.html</a>
<br />2. Learn more about using MATLAB software with Agilent U2300A Series devices:
<br /><a href="http://www.mathworks.com/agilent/daq/overview">http://www.mathworks.com/agilent/daq/overview</a>
<br />3. Learn how to use Data Acquisition Toolbox to create MATLAB scripts by reading the user documentation for Data Acquisition Toolbox: <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/daq/index.html">http://www.mathworks.com/access/helpdesk/help/toolbox/daq/index.html</a>
<br />4. Learn how to use MATLAB software with other Agilent hardware:
<br /><a href="http://www.mathworks.com/agilent/overview">http://www.mathworks.com/agilent/overview</a> </p>Neohttp://www.mathworks.com/matlabcentral/profile/authors/1000698-neoMATLAB 7.8 (R2009a)Data Acquisition Toolboxfalse