Data Acquisition Software for Neurobiology using Matlab

Introduction

As part of an effort to make inexpensive and flexible biology lab instrumentation, we have written Matlab programs which simulate many of the functions of actual instruments. The instruments are intended to be used in a real lab setting with real data. We used Matlab because it is a flexible programming language which includes the abilities to:

This page describes:

Note that some of the programs shown here are upgraded versions of software originally developed in 2001.


Soft oscilloscope

This program:

The next two sections explain how to set up the program and how to operate the controls. The program assumes that you have installed the necessary drivers supplied with whatever data aquisition card you are using. The winsound (audio port) drivers are installed with windows, but (for example) the National Instruments interfaces require NIDAQmx 8.3 drivers. This program is cycle and memory hungry. It may not work well on slow machines. The program has only been tested on machines running WindowsXP/SP2.

There are two different ways of setting up the program:

The scope controls:

Scope Internal Organization (you don't need this to use the scope):

The program is structured as a Matlab function. Persistant data is stored in the UserData area of the figure. The initial execution of the function from the command line initializes a bunch of variables and the GUI, then exits. At that point, the GUI is drawn in the figure window and all the GUI controls are waiting patiently for a user action. Control returns to the main function under three conditions:

Each of the events or callbacks passes a string to the main function which is dispatched by a gigantic case statement to perform an action, perhaps modify the persistant data, then exit. Since the main function is not running most of the time, the Matlab command line stays active.

The DAQ toolbox provides an (almost) hardware-independent, abstract, data acqusition interface to Matlab. Several devices are supported. The current version of this program has been tested with the Winsound device and National Instruments NIDAQ hardware. It turns out that there are some device dependencies so not all hardware will respond correctly. The DAQ toolbox defines analog input objects which have quite complex, and potentially asynchronous, behavior. The usual get/set commands specify DAQ object parameters and read back their state. Debugging the prorgram consisted mostly of figuring out how to set up DAQ objects and their parameters.

Note that it is possible to produce weird concurrent errors if the user happens to trigger a GUI element at just the wrong time. I am still working on this. There are a few sub-functions near the end of the program. One of them displays the scope traces.


Frequency and ISI histogram analysis program

This program:

Program download (matlab source)

Control description:


Physiological Stimulator

This program uses a analog interface to simulate a physiological pulse stimulator. The stimulator produces a synch pulse on channel 0 and a pulse train on channel 1. Some winsound devices have a 50 Hz highpass characteristic, so pulses longer than about 10 mSec will be distorted when using winsound on those systems. You should check your output with a scope. Output can be single pulses, a pulse train, or a tetanic burst.

Program Download (matlab source version 23)

The stimulator controls.

Two Channel Version
There is a two channel version which produces two pulse trains (but no sync pulse). This program uses a analog interface to simulate a physiological pulse stimulator. The stimulator produces a pulse train on channel 0 and a pulse train on channel 1. Some winsound devices have a 50 Hz highpass characteristic, so pulses longer than about 10 mSec will be distorted when using winsound on those systems. You should check your output with a scope. Output is two pulse trains.

Program version 24 (two channel)

The stimulator controls.


Stimulus Editor and WAV player

This program:

Program download (matlab source)

Control description:

A small utility program plays back WAV files produced by the stimulus editor.

Program download (matlab source)

To use this program


Copyright Cornell University may 2007