Auditory nerve model for predicting performance limits (Heinz et al 2001)

 Download zip file 
Help downloading and running models
A computational auditory nerve (AN) model was developed for use in modeling psychophysical experiments with normal and impaired human listeners. In this phenomenological model, many physiologically vulnerable response properties associated with the cochlear amplifier are represented by a single nonlinear control mechanism, see paper for details. Several model versions are described that can be used to evaluate the relative effects of these nonlinear properties.
1 . Heinz MG, Zhang X, Bruce IC, Carney LH (2001) Auditory nerve model for predicting performance limits of normal and impaired listeners. Acoustics Research Letters Online 2(3):91-96
Model Information (Click on a link to find other models with that property)
Model Type:
Brain Region(s)/Organism:
Cell Type(s): Auditory nerve;
Gap Junctions:
Simulation Environment: C or C++ program; MATLAB;
Model Concept(s): Activity Patterns; Temporal Pattern Generation; Audition;
Implementer(s): Zhang, Xuedong ;
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "spikes.h"
#include "mex.h"

extern void _main();
extern int SGmodel(double tdres, const double *sout, double** sptimeptr, const int nstim, const int nrep);

/* The gateway routine */
void mexFunction( int nlhs, mxArray *plhs[],
                  int nrhs, const mxArray *prhs[])
      int error;
      double *para,*in,*out,*out2;
      double tdres;
      int nrep,nspikes;
      double  x;
      double** outptr;
      int     length,mrows,ncols;
      /*  Check for proper number of arguments. */
      /* NOTE: You do not need an else statement when using
           mexErrMsgTxt within an if statement. It will never
           get to the else statement if mexErrMsgTxt is executed.
           (mexErrMsgTxt breaks you out of the MEX-file.) 
        mexErrMsgTxt("[sptime,nspikes] = ihcmodel([tdres,nrep],input);");
        mexErrMsgTxt("Two output required.");

      /*  Get the input parameter. */
	mexErrMsgTxt("The first input para contains [tdres,nrep]");
      para = mxGetPr(prhs[0]);
      tdres = para[0];
      nrep = (int)para[1];
      /*  Create a pointer to the input matrix in. */
      in = mxGetPr(prhs[1]);

      /*  Get the dimensions of the matrix input in. */
      mrows = mxGetM(prhs[1]);
      ncols = mxGetN(prhs[1]);
      /*  Set the output pointer to the output matrix. */
/*      plhs[0] = mxCreateDoubleMatrix(mrows,ncols, mxREAL);*/
      plhs[1] = mxCreateDoubleMatrix(1,1, mxREAL);
      out2 = mxGetPr(plhs[1]);
      /*  Create a C pointer to a copy of the output matrix. */
/*      out = mxGetPr(plhs[0]); */
      length = mrows*ncols;

      /*  Call the C subroutine. */
      plhs[0] = mxCreateDoubleMatrix(10000,1,mxREAL);
      out = mxGetPr(plhs[0]);
      outptr  = &out;
      nspikes = SGmodel(tdres,in,outptr,length,nrep);
/*      plhs[0] = mxCreateDoubleMatrix(nspikes,1,mxREAL);
      out = mxGetPr(plhs[0]);
      for(length = 0; length<nspikes; length++)
	out[length] = (*outptr)[length];
      out2[0] = (int)(nspikes+0.1);
/*      free(*outptr); */

Loading data, please wait...