Back to the Basement Computing Page
 

Documentation
 

Index
 
ASCII Table
AudMat
AudSDK
Basement Blog
BC - Behaving Cat
COM Data Collection
COMA Data Analysis
Correcting GW for phone
CSF format
DAFLIB
Data Schemas
DCP - Introduction
DCP - Tech Notes
DCP - Users Guide
DCPLIB
DSS-III Notes
DSS-III Prototype
DSSLIB
DSS3LIB
DSS4LIB
DSS4FLIB
Effective SPL computation
EP - Evoked Potential
Error Codes
Falling Cost of Computing
FF - Free Field
Fortran and C/C++ mix
GWE - Waveform Editor
Local FAQs
Mathematical Formulae
Minicomps. & Neurophys.
MISLIB
Numerical Constants
NUMLIB
PIN - Edge/Notch
PIN - Summary
Probe Tube Correction
RA - Introduction
RA - Tech Notes
RA - Users Guide
RAP - Users Guide
Rayleigh Test
SER - Search Stimulus
SERCOM - COM Search
Signal Analysis Review
Simulating Free Space
STATPK - Introduction
STATPK - Tech Notes
STATPK - Users Guide
Status Table Formats
SysInfo
 
Disclaimer
 
AudMAT - Auditory Toolkit for Matlab
Quick Links
System Requirements
Download
Installation Guide
Usage Guide
Function Reference
References
Feedback
Acknowledgements

Ravi Kochhar
Dept. of Neuroscience
University of Wisconsin - Madison
Jan. 2008
rev. 1.07, Nov. 24, 2008
Technical Report no. 25

Introduction

AudMAT is a collection of Matlab mex-files (functions) to allow Auditory data to be accessed from Matlab. AudMAT works in MS Windows only. See the "System Requirements" section below for more details.

Over the years, researchers here at the Univ. of Wisconsin have collected a fair amount of Auditory Physiology data, stored in a lab-standard format (ref. 1), and I have written a number of Mex-files and functions as an aid for users who wish to import the data into Matlab for further analysis. I named these functions "The Auditory Toolkit for Matlab", or AudMAT for short.

Matlab is a well-known data analysis and plotting program from Mathworks (ref. 2). One of its strengths is that it can be extended to call user-written functions, via a facility known as MEX-files (ref. 3). Essentially, a mex-file is a user function, written in C or Fortran, which has been compiled using a standard compiler, then linked with special Matlab functions into a Windows DLL, allowing the user function to be called from Matlab. The Matlab functions provide the interface between Matlab and the user function, allowing parameters to be passed to the mex-file, and the results passed back to Matlab.

Back to Top

System Requirements

The requirements for using AudMAT are as follows:

Microsoft Windows 2000 or newer (i.e. Windows 2000, XP, 2003, Vista or Windows 7 and later)
Matlab v7.1 or later (32-bit version of Matlab required)
Permission to install programs in the "C:\Program Files\" folder
Approx. 20 MB or greater free space on the C: drive

Back to Top

Download

The most recent version of AudMAT can be downloaded as a single executable file named Install_AudMat.exe, by clicking on the following link:

Click here to download Install_AudMat.exe

AudMAT is a free download, but may not be included in any package for re-sale. Source code is not available.

Follow the instructions below for installing AudMAT.

Back to Top

Installation Guide

When you click on the download link (above), you will be presented with a dialog with choices like Run/Save/Cancel etc. Click Save to save it to any folder on your hard drive (e.g. to C:\Temp, or to your Desktop).

Next, exit any unnecessary windows and run the installer by double-clicking on the file (Install_AudMat.exe) which you just saved.

On some systems you will get a cautionary window informing you that the executable is unsigned or unknown, and asking your permission to proceed. Click OK, or "Allow", to proceed with installer.

Click on "Yes", "Next" or default answers to all installer questions, and the installation should be done in a few seconds.

The program installs itself in the folder "C:\Program Files\Audstuff\audmat" (Or in "C:\Program Files (x86)\Audstuff\audmat" on 64-bit versions of Windows). This cannot be changed at the moment.

To complete the installation, you must also do the following step:

Start Matlab, and add "C:\Program Files\Audstuff\audmat" (or "C:\Program Files (x86)\Audstuff\audmat" on 64-bit Windows) to the Matlab Path. You can do this in Matlab by selecting File -> Set Path, then click on "Add Folder", then browse on over to "C:\Program Files\Audstuff\audmat" (or to "C:\Program Files (x86)\Audstuff\audmat") and click on "Add" then "Save" etc. If you now click (in Matlab) on File -> Set Path, you should see "C:\Program Files\Audstuff\audmat" (or "C:\Program Files (x86)\Audstuff\audmat") near the top of the search path list.

The best way to verify that AudMAT is installed correctly is to type:

    >> audmat
      
at the Matlab command prompt. If it is installed correctly then you should see a list of AudMAT functions.

Optionally, you can view the folder "C:\Program Files\Audstuff\audmat" (or "C:\Program Files (x86)\Audstuff\audmat" on 64-bit Windows) with Windows Explorer, and it should contain the AudMAT mex-files, as shown in Fig. 1 below.

Fig. 1 - Audmat folder contents

Figure 1 - Audmat folder contents.

Back to Top

Usage Guide

Using AudMAT consists of calling the various functions from within Matlab. Typically, you would call the functions from within a Matlab m-file.

The list of AudMAT functions is below, but the following tips may help in getting started:

  • All AudMAT function names begin with aud... (e.g. audspktimes).
  • All AudMAT functions return an error/status code (variable NER). It is very important to check its value after each call. A value of 0 means successful completion, non-zero means a possible error. You can decipher the meaning of the error code by looking at file "error.txt" which is found in the AudMAT install folder (normally "c:\program files\audstuff\audmat") or by looking it up on-line (ref. 4).
  • You can get a list of available AudMAT functions by typing "audmat" at a Matlab prompt.
  • You can get details about a specific function by typing just its name at a Matlab prompt. For example, type >> audspktimes to learn more about the audspktimes function.
  • Most AudMAT functions work for both Harris and VAX format data files.

Many AudMAT functions require a file name as input. The file in question must be an auditory data file in EDF format, as described in Ref. 1 below.

All AudMAT functions return some value or results. You must specify the proper number of variables on the left-side to receive these values. For Example:

 >> [ner,numv,extyp,names]=audvarnames('c:\r8814.dat','u5-4');
      
Here we called the function "audvarnames", sending it two input arguments, a file name and a dataset ID. The function return four values - ner is the error code, numv is the number of variables, extyp is the experiment-type code, and names is an array that contains variable names (e.g. FREQ and SPL). ner and numv are numeric values, while extyp and names are character strings. The variable types and number are documented for each function below in the Function Reference section, and may also be obtained within Matlab by typing just the function name (e.g. >> audvarnames) at a command prompt.

Newer versions of Matlab complain with a warning message if you call a function with incorrect case, e.g. if you call the function in our example by using "AudVarNames" instead of "audvarnames". To avoid these nuisance warnings, always call AudMAT functions by using all lower-case characters in the function name.

Back to Top

Function Reference

The following table is a list of currently available AudMAT functions. Click on any name for a detailed description, or just scroll down.
audautocs audcrosscs audfileformat audfiltpar2 audfilttyp
audfixfreqspl2 audgetstats audgetstatsex audgetth audgwpar2
audmatver audnextdsid audreadgw audrgl audrglex
audrycoff audsach audspktimes audspktimesex audstimgw
audvarnames audvarrange2

The following is a description of each current AudMAT function, in alphabetical order.

audautocs

This function computes an Auto-Correlation Histogram from Spike Times. It is called as follows:

  [ner,AutoC]=audautocs(spktimes,nbin,xmin,xmax)
      
where 'spktimes' is a two-dimensional array containing spike times (in a format similar to that returned by audspktimes), 'nbin' is the number of bins to be used and 'xmin' and 'xmax' are the range of the histogram in milliseconds.
It returns an error/status code in 'ner' (0 means all went OK) The Auto-Correllogram is returned in 'AutoC'.

Example:

  [ner,autoc]=audautocs(spktimes,512,0.0,50.0);
      
Be sure to check the return code (ner) after every call!!!

audcrosscs

This function computes a Cross-Correlation Histogram from Spike Times It is called as follows:

  [ner,CrossC]=audcrosscs(spktimes1,spktimes2,tmax,nbin)
      
where 'spktimes1' is a two-dimensional array containing spike times (in a format similar to that returned by AudSpkTimes) 'spktimes2' contains the array of spike times for 2nd condition 'tmax' is the max analysis time (millisecs) (normally=stmdur) and 'nbin' is the number of bins to be used. It returns an error/status code in 'ner' (0 means all went OK). The Cross-Correllogram is returned in 'CrossC'.

Example:

  [ner,CrossC]=audcrosscs(spktimes1,spktimes2,250,100);
      
Be sure to check the return code (ner) after every call!!!

audfileformat

This function determines the "file type", given the file name. For example, it can tell you whether a file is Harris or VAX format. It is called as follows:

  [ner,ntype]=audfileformat(file)
      
where 'file' is the file name to be checked. It returns an error/status code in 'ner' (0 means all went OK). It returns the file type in 'ntype'.
ntype=1 means a VAX format EDF
ntype=21 means a Harris format EDF

Example:

  [ner,ntype]=audfileformat('c:\data\r8814.dat');
      
Be sure to check the return code (ner) after every call!!!

audfiltpar2

This function gets the stimulus Filter params (CF/BW) from the dataset header. It is called as follows:

  [ner,CF,BW]=audfiltpar2(file,dsid)
      
where 'file' is the EDF name and 'dsid' is the dataset ID. It returns an error/status code in 'ner' (0 means all went OK). The stimulus filter Center Frequency is returned in CF, the stimulus filter Band-width is returned in BW.
Params are fetched for Master DSS only! This function is for use with data sets with Type-2 Status Tables only! It works for Vax format files only!

Example:

  [ner,CF,BW]=audfiltpar2('c:\data\r8814.dat','u5-4');
      
Be sure to check the return code (ner) after every call!!!

audfilttyp

This function gets the stimulus Filter Type (e.g. KLATT) from the dataset header. It is called as follows:

  [ner,cFiltTypM,cFiltTyps]=audfilttyp(file,dsid)
      
where 'file' is the EDF name and 'dsid' is the data set ID. It returns an error/status code in 'ner' (0 means all went OK). The Master stimulus filter type is returned in cFiltTypm as a character string (e.g. KLATT or NONE), and the Slave Stim Filter Type is returned in cFiltTypS. This function works for Vax format files only!

Example:

  [ner,cFiltM,cFiltS]=audfilttyp('c:\r8814.dat','u5-4');
      
Be sure to check the return code (ner) after every call!!!

audfixfreqspl2

This function gets the Fixed Freq and SPL from dataset header. It is called as follows:

  [ner,Freq,SPL]=audfixfreqspl2(file,dsid,msv)
      
where 'file' is the EDF name and 'dsid' is the data set ID and msv is 1 to fetch for Master DSS and 2 for Slave. It returns an error/status code in 'ner' (0 means all went OK) The Fixed Frequency is returned in Freq and the Fixed SPL is returned in SPL. Params are fetched for master or slave according to msv. This function is for use with data sets with Type-2 Status Tables only!!

Example:

  [ner,FR,SPL]=audfixfreqspl2('c:\r8814.dat','u5-4',1);
      
Be sure to check the return code (ner) after every call!!!

audgetstats

This function gets statistics computed from spike time data. It is called as follows:

[ner,stats]=audgetstats(file,dsid,StimPt,NumVar,iOcur,
                                          AWindow,BinF)
      
where 'file' is the EDF name and 'dsid' is the data set ID. 'StimPt' is a NumVar-word array containing the stimulus point. iOcur is an integer 'Occurrence Number' that is used when the specified Stimulus Point may occur more than once. iOcur should normally be set to 1. AWindow is the analysis window in millisecs [from,to]. If AWindow=[-1,-1] then a default analysis window is used. BinF is the binning freq. for sync/phase computation. It returns an error/status code in 'ner' (0 means all went OK) and the computed statistics in 'stats'.

Example:

[ner,stats]=audgetstats('c:\data\r8814.dat','u5-4',
                           [250,70],2,1,[-1,-1],250)

will get the statistics for the Stimulus Point
where X-var=250 and Y-var=70

 The contents of array 'stats' are as follows (if ner=0):
 stats(1) = Number of reps 
 stats(2) = Spike Count
 stats(3) = Spike rate 
 stats(4) = Peak spike rate 
 stats(5) = Steady-State rate
 stats(6) = Peak/ssr ratio
 stats(7) = Sync. Coeff. 
 stats(8) = Phase (0 to 1)
 stats(9) = Rayleigh Coeff.
 stats(10)= Num of Trials with at least one spike
 stats(11)= Mean 1st spk Latency 
 stats(12)= Std. Dev. Latency
 stats(13)= Median Latency
 stats(14)= First Peak Latency
 stats(15)= Mean Iinter-spike interval
 stats(16)= Std. Dev. ISI histogram
 stats(17)= Skewness of ISI histogram 
 stats(18)= Kurtosis of ISI histogram 
 stats(19)= Coeff. of Var. of ISI histogram
 stats(20)= Std. Dev. of Spike Rate
      
Be sure to check the return code (ner) after every call!!!

audgetstatsex

This is the "extended" version of audgetstats. It gets statistics computed from spike time data, plus allows the analysis to be restricted by user-supplied parameters. It is called as follows:

[ner,stats]=audgetstatsex(file,dsid,StimPt,NumVar,iOcur,
                                AWindow,BinF,nParm,Parm)
      
where 'file' is the EDF name and 'dsid' is the data set ID. 'StimPt' is a NumVar-word array containing the stimulus point. iOcur is an integer 'Occurrence Number' that is used when the specified Stimulus Point may occur more than once. iOcur should normally be set to 1. AWindow is the analysis window in millisecs [from,to]. If AWindow=[-1,-1] then a default analysis window is used. BinF is the binning freq. for sync/phase computation.

The above are the same as for "audgetstats". There are also two new parameters, as follows:

nParm is the number of parameters specified in 'Parm'. Parm is any array of parameters that can modify the analysis. The first two values of 'Parm' can be a range of reps to include in the analysis. For example, to restrict the analysis to reps 50 to 100, specifiy Parm(1)=50, Parm(2)=100, and nParm=2. If nParm=0 then Parm will be ignored and all reps will be included. Also, if nParm=2 or greater, and Parm(1) and Parm(2) are both zero, then all reps will be included.

It returns an error/status code in 'ner' (0 means all went OK) and the computed statistics in 'stats'.

Example:

[ner,stats]=audgetstatsex('c:\data\r8814.dat','u5-4',
                  [250,70],2,1,[-1,-1],250,2,[10,90])

will get the statistics for the Stimulus Point
where X-var=250 and Y-var=70, and only for reps 10 to 90.

 The contents of array 'stats' are the same as described 
 for audgetstats above.
      
Be sure to check the return code (ner) after every call!!!

audgetth

This function gets the Tuning (Threshold) Curve. It is called as follows:

[ner,iPar,rPar,TCF,TCS]=audgetth(file,dsid)
      
where 'file' is the EDF name and 'dsid' is the data set ID. It returns an error/status code in 'ner' (0 means all went OK). The integer parameters are returned in iPar, the floating-point params in rPar, and the tuning curve itself in TCF and TCS. TCF holds the Freq while TCS holds the SPL. Missing values returned as the value NaN in TCS.

iPar(1)=No. of pts in TC, iPar(2)=No. of Reps
iPar(3)=No. DSS's, iPar(4)=Master DSS number
rPar(1)=Stimulus Duration, rPar(2)=Rep. Time in millisecs

Example:

[ner,iPar,rPar,TCF,TCS]=audgetth('c:\data\r8814.dat',
                                        '1-1-THL');
      
Be sure to check the return code (ner) after every call!!!

audgwpar2

This function gets params for a GW stimulus waveform. It is called as follows:

  [ner,GWpar]=audgwpar2(file,dsid)
      
where 'file' is the EDF name and 'dsid' is the data set ID. It returns an error/status code in 'ner' (0 means all went OK). Parameters relevant to the GW stimulus are returned in GWpar.

The contents of GWpar are interpreted as follows:,

 
  GWpar(1)   = Number of points in GW waveform 
  GWpar(2)   = Playback resolution (in microsecs)
  GWpar(3)   = Correction flag, =1 means corrected 
               for Calib., =0 means not 
  GWpar(4)   = Waveform type-code
  GWpar(5)   = if=1 then Unfrozen option was enabled 
  GWpar(6)   = Step incr. (# of points) - unfrozen option
Params are fetched for Master DSS only! This function is for use with data sets with Type-2 Status Tables only!!

Example:

  [ner,GWpar]=audgwpar2('c:\data\r8814.dat','u5-4');
      
Be sure to check the return code (ner) after every call!!!

audmatver

This function gets or displays version info for AudMat currently installed It is called as follows:

  audmatver
 or
  [Ver]=audmatver
      
If called without any arguments, it displays the AudMat version info on the screen.

If called with a variable specified on the left, it returns the version number as a floating point value in "Ver".

Examples:

  >>audmatver

  AudMAT version 2.12

  >>Ver=audmatver;
  >>Ver
   
     Ver =
         2.1200
      

audnextdsid

This function gets the next Dataset ID in a data file. It is called as follows:

  [ner,cNextID]=audnextdsid(file,dsid)
      
where 'file' is the EDF name and 'dsid' is the data set ID. It returns an error/status code in 'ner' (0 means all went OK). and it returns the next data set ID in cNextID as a character string (e.g. u3-12). If dsid is supplied as a blank then it returns the very first data set ID in the specified file.

Examples:

  [ner,cNextID]=audnextdsid('c:\data\r8814.dat','u5-4');
 will return the DSID immediately after u5-4, and

  [ner,cNextID]=audnextdsid('c:\data\r8814.dat',' ');
 will return the very first DSID in the file.
      
Be sure to check the return code (ner) after every call!!!

audreadgw

This function gets the General Waveform from a GW format dataset. It is called as follows:

  [ner,nump,res,wave]=audreadgw(file,dsid)
      
where 'file' is the EDF name and 'dsid' is the data set ID. It returns an error/status code in 'ner' (0 means all went OK). The number of points is returned in nump, the time resolution in microsecs in 'res', and the waveform itself in 'wave'

Example:

  [ner,nump,res,wave]=audreadgw('c:\r8814.dat','n10k');
      
Be sure to check the return code (ner) after every call!!!

audrgl

This does Regularity Analysis for any stimulus point. It is called as follows:

[ner,nbin,cv,mean,sd]=audrgl(file,dsid,StimPt,NumVar,iOccur)
      
where 'file' is the EDF name and 'dsid' is the data set ID. 'StimPt' is a NumVar-word array containing the stimulus point. iOcur is an integer 'Occurrence Number' that is used when the specified Stimulus Point may occur more than once. iOcur should normally be set to 1. It returns an error/status code in 'ner' (0 means all went OK), the number of bins in 'nbin', the coefficient of variation in 'cv', the mean in 'mean', and the standard deviation in 'sd'. Note that cv, mean and sd are arrays of length 'nbin'

Example:

  Stim=[250,70]
  [ner,nbin,cv,mean,sd]=audrgl('c:\data\r8814.dat',
                                   'u5-4',Stim,2,1)

 Will get the regularity results for the Stimulus Point
 where X-var=250 and Y-var=70
      
Be sure to check the return code (ner) after every call!!!

audrglex

This is the "extended" version of audrgl. It does Regularity Analysis for any stimulus point, plus allows the analysis to be restricted by user-supplied parameters. It is called as follows:

[ner,nbin,cv,mean,sd]=audrglex(file,dsid,StimPt,NumVar,
                      iOccur,nparm,parm)
      
where 'file' is the EDF name and 'dsid' is the data set ID. 'StimPt' is a NumVar-word array containing the stimulus point. iOccur is an integer 'Occurrence Number' that is used when the specified Stimulus Point may occur more than once. iOccur should normally be set to 1.

The above are the same as for "audrgl". There are also two new parameters, as follows:

nParm is the number of parameters specified in 'Parm'. Parm is any array of parameters that can modify the analysis. The first two values of 'Parm' can be a range of reps included in the analysis. For example, to restrict the analysis to reps 50 to 100, specifiy Parm(1)=50, Parm(2)=100, and nParm=2. If nParm=0 then Parm will be ignored and all reps will be included. Also, if nParm=2 or greater, and Parm(1) and Parm(2) are both zero, then all reps will be included.

It returns an error/status code in 'ner' (0 means all went OK), the number of bins in 'nbin', the coefficient of variation in 'cv', the mean in 'mean', and the standard deviation in 'sd'. Note that cv, mean and sd are arrays of length 'nbin'

Examples:

  Stim=[250,70]
  [ner,nbin,cv,mean,sd]=audrglex('c:\data\r8814.dat',
                                 'u5-4',Stim,2,1,2,[10,90])

 will get the regularity results for the Stimulus Point
 where X-var=250 and Y-var=70, and only for reps in 
 the range 10 to 90 (inclusive).

      [ner,nbin,cv,mean,sd]=audrglex('c:\data\r8814.dat',
                                 'u5-4',Stim,2,1,0,[10,90])
 and  [ner,nbin,cv,mean,sd]=audrglex('c:\data\r8814.dat',
                                 'u5-4',Stim,2,1,0,0)

 will both get the regularity for all reps (i.e. as 
 if audregl had been called).

      [ner,nbin,cv,mean,sd]=audrglex('c:\data\r8814.dat',
                                 'u5-4',Stim,2,1)
 and  [ner,nbin,cv,mean,sd]=audrglex('c:\data\r8814.dat',
                                 'u5-4',Stim,2,1,1,[10,90])

 are both invalid and will result in an error code in ner.

      
Be sure to check the return code (ner) after every call!!!

audrycoff

This Computes the Rayleigh Coefficient. It is called as follows:

  [ner,rycoff]=audrycoff(nspk,sync)
      
where 'nspk' is the Number of Spikes and 'sync' is the sync. coeff. It returns an error/status code in 'ner' (0 means all went OK). The Rayleigh Coeff is returned in 'rycoff'.

Example:

[ner,rycoff]=audrycoff(nspk,sync);
      
Be sure to check the return code (ner) after every call!!!

audsach

This function computes a Shuffled Auto-correlation Histogram from Spike Times. It is called as follows:

  [ner,SACH]=audsach(spktimes,nbin,xmin,xmax)
      
where 'spktimes' is a two-dimensional array containing spike times (in a format similar to that returned by AudSpkTimes), 'nbin' is the number of bins to be used, and 'xmin' and 'xmax' are the range of the histogram in milliseconds. It returns an error/status code in 'ner' (0 means all went OK). The Shuffled Auto-Correllogram is returned in 'SACH'.

Example:

[ner,sach]=audsach(spktimes,512,0.0,50.0);
      
Be sure to check the return code (ner) after every call!!!

audspktimes

This function gets the spike time data for any stimulus point. It is called as follows:

  [ner,nreps,nspks,stimes]=AudSpkTimes(file,dsid,StimPt,
                                          NumVar,iOccur)
      
where 'file' is the EDF name and 'dsid' is the data set ID, 'StimPt' is a NumVar-word array containing the stimulus point. iOcur is an integer 'Occurrence Number' that is used when the specified Stimulus Point may occur more than once iOcur should normally be set to 1. It returns an error/status code in 'ner' (0 means all went OK), the number of reps in 'nreps', the number of spikes in each trial is returned in the vector 'nspks', and the spike times are returned in the two-dimensional matrix 'stimes'. Spike times are returned in units of millisecs. Note: The size of 'nspks' and 'stimes' will automatically be set by this function. If the max number of spikes in any trial is Maxx, then the size of 'stimes' will be Maxx x nreps i.e. Maxx rows by nreps columns.

Example:

  Stim=[250,70]
  [ner,nreps,Nspk,Times]=audspktimes('c:\data\r8814.dat',
                                         'u5-4',Stim,2,1)

 Will get the spike times for the Stimulus Point
 where X-var=250 and Y-var=70
      
Be sure to check the return code (ner) after every call!!!

audspktimesex

This is the "extended" version of audspktimes. It gets the spike time data for any stimulus point, plus allows the retrieval to be restricted by user-supplied parameters. It is called as follows:

  [ner,nreps,nspks,stimes]=AudSpkTimesEx(file,dsid,StimPt,
                                 NumVar,iOccur,nParm,Parm)
      
where 'file' is the EDF name and 'dsid' is the data set ID, 'StimPt' is a NumVar-word array containing the stimulus point. iOcur is an integer 'Occurrence Number' that is used when the specified Stimulus Point may occur more than once iOcur should normally be set to 1.

The above are the same as for "audrgl". There are also two new parameters, as follows:

nParm is the number of parameters specified in 'Parm'. Parm is any array of parameters that can modify the retrieval. The first two values of 'Parm' can be a range of reps to be retrieved. For example, to restrict the retrieved to reps 50 to 100, specifiy Parm(1)=50, Parm(2)=100, and nParm=2. If nParm=0 then Parm will be ignored and all reps will be included. Also, if nParm=2 or greater, and Parm(1) and Parm(2) are both zero, then all reps will be included.

It returns an error/status code in 'ner' (0 means all went OK), the number of reps in 'nreps', the number of spikes in each trial is returned in the vector 'nspks', and the spike times are returned in the two-dimensional matrix 'stimes'. Spike times are returned in units of millisecs. Note: The size of 'nspks' and 'stimes' will automatically be set by this function. If the max number of spikes in any trial is Maxx, then the size of 'stimes' will be Maxx x nreps i.e. Maxx rows by nreps columns.

Example:

  Stim=[250,70]
  [ner,nreps,Nspk,Times]=audspktimesex('c:\data\r8814.dat',
                                 'u5-4',Stim,2,1,2,[10,90])

 Will get the spike times for the Stimulus Point
 where X-var=250 and Y-var=70, and only for 
 reps 10 to 90.
      
Be sure to check the return code (ner) after every call!!!

audstimgw

This function gets the stimulus-type and GWID for any dataset. It is called as follows:

 [ner,mstim,sstim,mgwid,sgwid]=audstimgw(file,dsid)
      
where 'file' is the EDF name and 'dsid' is the data set ID. It returns an error/status code in 'ner' (0 means all went OK. ) The stimulus types for master and slave DSS are returned in mstim and sstim respectively. The DSID of the GW waveform used for the master DSS is returned in mgwid, and for the slave it is returned in sgwid.

The Stimulus-types are returned as numbers. Some common Stimulus Types (and their interpretations) are:

1=TONE, 2=SFM, 3=LFM, 4=AM, 5=GWS, 6=GWR, 7=MSK etc.

Example:

[ner,mstim,sstim,mgwid,sgwid]=audstimgw('r8814.dat','u5-4');
      
Be sure to check the return code (ner) after every call!!!

audvarnames

This function gets the stim-Variable names and Expt. Type for any dataset. It is called as follows:

 [ner,numv,extyp,names]=audvarnames(file,dsid)
      
where 'file' is the EDF name and 'dsid' is the data set ID. It returns an error/status code in 'ner' (0 means all went OK). The number of stimulus variables is returned in numv, the experiment-type is returned in extyp, and the variable names in 'names'.

Example:

[ner,numv,extyp,names]=audvarnames('c:\r8814.dat','u5-4');
      
Be sure to check the return code (ner) after every call!!!

audvarrange2

This function gets the number of stimulus variables and their range for any dataset. It is called as follows:

 [ner,nreps,numv,x,y,z]=audvarrange2(file,dsid)
      
where 'file' is the EDF name and 'dsid' is the data set ID. It returns an error/status code in 'ner' (0 means all went OK). The number of stimulus variables is returned in numv, the number of reps in 'nreps' and the range of the x-,y- and z-variables in 'x','y' and 'z'.

This function is for use with data sets with Type-2 Status Tables only!!

Example:

[ner,nreps,numv,x,y,z]=audvarrange2('c:\r8814.dat','u5-4');
      
Be sure to check the return code (ner) after every call!!!

Back to Top

References

  1. DAFLIB - Auditory Data Format and Retrieval http://www.neurophys.wisc.edu/comp/docs/daflib/
  2. Matlab product page http://www.mathworks.com/products/matlab/
  3. MEX-files guide http://www.mathworks.com/support/.../1605.html
  4. AudSDK Error Codes http://www.neurophys.wisc.edu/../rep023.asp

Back to Top

Feedback

Please send feedback/suggestions/questions/complaints to the author via email, at rkochhar@wisc.edu

Back to Top

Acknowledgements

This work was done at the University of Wisconsin - Madison under the direction of Dr. W.S.Rhode. Supported in part by a grant from NIH.

(This page last modified on May 19, 2015)

 
Back to Top
Back to The Basement Computing Page
Back to The Basement

Please send questions, complaints or comments to rkochhar@wisc.edu