text: cochlea 1.2
  Inner ear models in Python is also fast. It is easy to generate responses of hundreds or even thousands of auditory nerve fibers (ANFs). It is possible, for example, to generate responses of the whole human auditory nerve (around 30,000 ANFs). We usually tested the models with sounds up to 1 second in duration.
  I developed cochlea during my PhD in the group of Werner Hemmert (Bio-Inspired Information Processing) at the TUM. It went through several versions and rewrites. Now, it is quite stable and we decided to release it for the community.
  Features
  Implemented Models
  - Holmberg, M. (2007). Speech Encoding in the Human Auditory Periphery: Modeling and Quantitative Assessment by Means of Automatic Speech Recognition. PhD thesis, Technical University Darmstadt.
  - Zilany, M. S., Bruce, I. C., Nelson, P. C., & Carney, L. H. (2009). A phenomenological model of the synapse between the inner hair cell and auditory nerve: long-term adaptation with power-law dynamics. The Journal of the Acoustical Society of America, 126(5), 2390-2412.
  - Zilany, M. S., Bruce, I. C., & Carney, L. H. (2014). Updated parameters and expanded simulation options for a model of the auditory periphery. The Journal of the Acoustical Society of America, 135(1), 283-286.
  - MATLAB Auditory Periphery by Meddis et al. (external model, not implemented in the package, but easily accessible through matlab_wrapper).
  Usage
  Check our online DEMO and examples (probably the easiest is to start with run_zilany2014.py).
  Initialize the modules:
  import cochlea import thorns as th import thorns.waves as wv
  Generate sound:
  fs = 100e3 sound = wv.ramped_tone( fs=fs, freq=1000, duration=0.1, dbspl=50 )
  Run the model (responses of 200 cat HSR fibers):
  anf_trains = cochlea.run_zilany2014( sound, fs, anf_num=(200,0,0), cf=1000, seed=0, species='cat' )
  Plot the results:
  th.plot_raster(anf_trains) th.show()
  You can browse through the API documentation at:
  Installation
  pip install cochlea
  Check INSTALL.rst for details.
  Spike Train Format
  Spike train data format is based on a standard DataFrame format from the excellent pandas library. Spike trains and their meta data are stored in DataFrame, where each row corresponds to a single neuron:
  The column ‘spikes’ is the most important and stores an array with spike times (time stamps) in seconds for every action potential. The column ‘duration’ is the duration of the sound. The column ‘cf’ is the characteristic frequency (CF) of the fiber. The column ‘type’ tells us what auditory nerve fiber generated the spike train. ‘hsr’ is for high-spontaneous rate fiber, ‘msr’ and ‘lsr’ for medium- and low-spontaneous rate fibers.
  Advantages of the format:
  easy addition of new meta data,
  efficient grouping and filtering of trains using _DataFrame functionality,
  export to MATLAB struct array through mat files:
  scipy.io.savemat( "spikes.mat", {'spike_trains': spike_trains.to_records()} )
  Please, check thorns for more information and functions to manipulate spike trains.
  Contribute
  - Open tasks: TODO.org (best viewed in Emacs org-mode)
  - Issue Tracker:
  - Source Code:
  Support
  If you are having issues, please let us know. We have a mailing list located at: cochlea-and-thorns@googlegroups.com.
  Acknowledgments
  We would like to thank Muhammad S.A. Zilany, Ian C. Bruce and Laurel H. Carney for developing inner ear models and allowing us to use their code in cochlea.
  Thanks goes to Marcus Holmberg, who developed the traveling wave based model.+).
  - Author: Marek Rudnicki
  - Documentation: cochlea package documentation
  - Download URL:
  - License: GPLv3+
  - Platform: Linux,Windows,FreeBSD,OSX
  - Categories
  - Development Status :: 5 - Production/Stable
  -.2.xml