&
API for MATLAB

Device Driver for the MATLAB Data Acquisition Toolbox

 


The API for MATLAB is available for g.USBamp and the g.MOBIlab+. The toolbox is a device driver that allows to read biosignal data like EEG, ECoG, EMG, EOG and ECG into the MATLAB environment. MATLAB is a very flexible development environment which allows to setup easily your own signal acquisition and analysis by utilizing all available toolboxes from MATLAB (like Statistics, Neural Networks, Signal Processing,...).

The API for MATLAB contains commands which give full access to the amplifier. There are commands for reading the data, for setting the bandpass and Notch filters, for changing the sampling frequency of the amplifier, to define bipolar derivations and to calibrate the system.

Multiple g.USBamps and g.MOBIlab+s can be used if they are connected to the synchronization cable to work absolute in synchrony. Therefore one device must be defined as MASTER to control the other amplifiers.

An integrated impedance check gives you the impedance values of all electrodes connected to the 16 input channels and 4 reference channels.

Tne of the key advantages of API for MATLAB is that it is fully integrated into the MATLAB Data Acquisition Toolbox. Therefore you can start within minutes with the acquisition of data and build your application easily and fast on top of it.


Highlights
   
Acquire EEG, ECoG, ECG, EMG, EOG data directly within MATLAB  
Control g.USBamp from the MATLAB command line  
Write your own MATLAB programs for on-line visualization and signal analysis  
Use easily the MATLAB Data Acquisition Toolbox to handle g.USBamp  
Data can be read directly into MATLAB for further off-line processing  
Speeds-up your development time from month to hours  

On-line Biosignal Acquisition

Define the analog input object for g.USBamp

ai = analoginput('guadaq',1);
addchannel(ai,[1]);


Set the sampling rate to 256 Hz and acquire 10 seconds of data

set(ai,'SampleRate',256,'SamplesPerTrigger',10*256);
preview=256;
p = plot(zeros(preview,1)); grid on
start(ai)


Wait for one second to have at least 256 samples for the visualization

while ai.SamplesAcquired < preview
end


Show the acquired data in the figure

while ai.SamplesAcquired < 10 * 256
    data = peekdata(ai,preview);
    set(p,'ydata',data);
    drawnow;
end




Extract the whole 10 second data segment and plot it

data = getdata(ai);
plot(data), grid on


Clear the analog input object

delete(ai);
clear ai


Usage of Softscope

The Data Acquisition Toolbox provides a scope block for the visualization of data. Perform the following steps to visualize g.USBamp and g.MOBIlab+ data in this scope.

First register the g.USBamp/g.MOBIlab+ adaptor with

daqregister('guadaq')
ans =  'guadaq.dll' successfully registered.

Configure g.USBamp to acquire 1 channel in calibration mode. Therefore an analog input object with the adaptor guadaq of device 1 must be created.

ai = analoginput('guadaq',1);

Add the first channel

addchannel (ai,1)

and set g.USBamp to calibration mode

set(ai,'Mode','Calibration');

Start the Data Acquisition Oscilloscope

softscope(ai);


Prerequisite

MATLAB and the Data Acquisition Toolbox (Release 2008b)
The Signal Processing Toolbox is a useful extension for doing signal analysis in time and frequency domain.


Up