{"id":20670914,"url":"https://github.com/mrkrd/cochlea3","last_synced_at":"2026-01-23T12:14:39.295Z","repository":{"id":40961725,"uuid":"219594488","full_name":"mrkrd/cochlea3","owner":"mrkrd","description":"Inner ear models for Python3","archived":false,"fork":false,"pushed_at":"2022-06-22T01:57:16.000Z","size":5439,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T20:19:41.102Z","etag":null,"topics":["action-potentials","auditory","basilar-membrane","cochlea","computational-neuroscience","inner-ear","inner-hair-cell","model","neuroscience","python","python3","sound","spike-trains","spikes"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrkrd.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-04T20:52:43.000Z","updated_at":"2022-06-03T01:24:34.000Z","dependencies_parsed_at":"2022-09-12T03:21:39.992Z","dependency_job_id":null,"html_url":"https://github.com/mrkrd/cochlea3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrkrd/cochlea3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkrd%2Fcochlea3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkrd%2Fcochlea3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkrd%2Fcochlea3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkrd%2Fcochlea3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrkrd","download_url":"https://codeload.github.com/mrkrd/cochlea3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkrd%2Fcochlea3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28690862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action-potentials","auditory","basilar-membrane","cochlea","computational-neuroscience","inner-ear","inner-hair-cell","model","neuroscience","python","python3","sound","spike-trains","spikes"],"created_at":"2024-11-16T20:24:04.941Z","updated_at":"2026-01-23T12:14:39.260Z","avatar_url":"https://github.com/mrkrd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"cochlea3 -- Work In Progress, i.e., API will change!\n========\n\n*cochlea3* is a collection of inner ear models.  All models are easily\naccessible as Python3 functions.  They take sound signal as input and\nreturn `spike trains`_ of the auditory nerve fibers::\n\n\n\n                           +----------+     __|______|______|____\n   .-.     .-.     .-.     |          |--\u003e  _|________|______|___\n  /   \\   /   \\   /   \\ --\u003e| Cochlea3 |--\u003e  ___|______|____|_____\n       '-'     '-'         |          |--\u003e  __|______|______|____\n                           +----------+\n            Sound                               Spike Trains\n                                              (Auditory Nerve)\n\n\n\nThe package contains state-of-the-art biophysical models, which give\nrealistic approximation of the auditory nerve activity.\n\nWhenever possible, the models were implemented using the original code\nfrom their authors.  As a result, they provide the same responses as\nthe original models.  In most cases, it was verified by the unit\ntesting (see tests directory for details).\n\nThe implementation is also fast.  It is easy to generate responses of\nhundreds or even thousands of auditory nerve fibers (ANFs).  For\nexample, one can generate responses of the whole human auditory nerve\n(around 30,000 ANFs).  The models were usually tested with sounds of\nup to 1 second in duration.\n\n*cochlea3* is derived from *cochlea* but with Python 3 support and\nsome minor changes.\n\nI developed *cochlea* during my PhD in the group of Werner Hemmert\n(`Bio-Inspired Information Processing`_) at the TUM.\n\n.. _`spike trains`: https://en.wikipedia.org/wiki/Spike_train\n.. _`Bio-Inspired Information Processing`: https://www.ei.tum.de/en/bai/home/\n\n\n\nFeatures\n--------\n\n- State of the art inner ear models accessible from Python 3.\n- Contains full biophysical inner ear models: sound in, spikes out.\n- Fast; can generate thousands of spike trains.\n- Can be used with with neuron simulation software such as NEURON_ or Brian_.\n\n.. _NEURON: http://www.neuron.yale.edu/neuron/\n.. _Brian: http://briansimulator.org/\n\n\n\nImplemented Models\n------------------\n\n- Holmberg, M. (2007). Speech Encoding in the Human Auditory\n  Periphery: Modeling and Quantitative Assessment by Means of\n  Automatic Speech Recognition. PhD thesis, Technical University\n  Darmstadt.\n- Zilany, M. S., Bruce, I. C., Nelson, P. C., \u0026\n  Carney, L. H. (2009). A phenomenological model of the synapse\n  between the inner hair cell and auditory nerve: long-term adaptation\n  with power-law dynamics. The Journal of the Acoustical Society of\n  America, 126(5), 2390-2412.\n- Zilany, M. S., Bruce, I. C., \u0026 Carney, L. H. (2014). Updated\n  parameters and expanded simulation options for a model of the\n  auditory periphery. The Journal of the Acoustical Society of\n  America, 135(1), 283-286.\n\n\n\nUsage\n-----\n\nInitialize the modules::\n\n  import cochlea3\n\n\nGenerate sound::\n\n  fs = 100e3\n  sound = wv.ramped_tone(\n      fs=fs,\n      freq=1000,\n      duration=0.1,\n      dbspl=50\n  )\n\n\nRun the model (responses of 200 cat HSR fibers)::\n\n  anf_trains = cochlea.run_zilany2014(\n      sound,\n      fs,\n      anf_num=(200,0,0),\n      cf=1000,\n      seed=0,\n      species='cat'\n  )\n\n\nPlot the results::\n\n  th.plot_raster(anf_trains)\n  th.show()\n\n\n\nMore examples are available in examples_ directory.\n\n.. _examples: ./examples\n\n\n\nInstallation\n------------\n\n::\n\n  pip3 install cochlea3\n\nCheck INSTALL.rst_ for more details.\n\n.. _INSTALL.rst: ./INSTALL.rst\n\n\n\n\nSpike Train Format\n------------------\n\nAll models return spike trains in a common format.  The format is\nbased on standard Python data structures (list, dict) and Numpy\narrays.  It contains of a list of dicts where each dict contains\nstandard keys: 'type', 'cf', 'offset', 'duration', 'spikes'.\n\n\n\nSpike train data format is based on a standard DataFrame_ format from\nthe excellent pandas_ library.  Spike trains and their meta data are\nstored in DataFrame_, where each row corresponds to a single neuron:\n\n=====  ========  ====  ====  =================================================\nindex  duration  type    cf                                             spikes\n=====  ========  ====  ====  =================================================\n0          0.15   hsr  8000  [0.00243, 0.00414, 0.00715, 0.01089, 0.01358, ...\n1          0.15   hsr  8000  [0.00325, 0.01234, 0.0203, 0.02295, 0.0268, 0....\n2          0.15   hsr  8000  [0.00277, 0.00594, 0.01104, 0.01387, 0.0234, 0...\n3          0.15   hsr  8000  [0.00311, 0.00563, 0.00971, 0.0133, 0.0177, 0....\n4          0.15   hsr  8000  [0.00283, 0.00469, 0.00929, 0.01099, 0.01779, ...\n5          0.15   hsr  8000  [0.00352, 0.00781, 0.01138, 0.02166, 0.02575, ...\n6          0.15   hsr  8000  [0.00395, 0.00651, 0.00984, 0.0157, 0.02209, 0...\n7          0.15   hsr  8000  [0.00385, 0.009, 0.01537, 0.02114, 0.02377, 0....\n=====  ========  ====  ====  =================================================\n\nThe column 'spikes' is the most important and stores an array with\nspike times (time stamps) in seconds for every action potential.  The\ncolumn 'duration' is the duration of the sound.  The column 'cf' is\nthe characteristic frequency (CF) of the fiber.  The column 'type'\ntells us what auditory nerve fiber generated the spike train.  'hsr'\nis for high-spontaneous rate fiber, 'msr' and 'lsr' for medium- and\nlow-spontaneous rate fibers.\n\nAdvantages of the format:\n\n- easy addition of new meta data,\n- efficient grouping and filtering of trains using DataFrame_\n  functionality,\n- export to MATLAB struct array through mat files::\n\n    scipy.io.savemat(\n        \"spikes.mat\",\n        {'spike_trains': spike_trains.to_records()}\n    )\n\nThe library thorns_ has more information and functions to manipulate\nspike trains.\n\n\n.. _DataFrame: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html\n.. _pandas: http://pandas.pydata.org/\n.. _thorns: https://github.com/mrkrd/thorns\n\n\n\nContribute \u0026 Support\n--------------------\n\n- Open tasks: TODO.org_ (best viewed in Emacs org-mode)\n- Issue Tracker: https://github.com/mrkrd/cochlea/issues\n- Source Code: https://github.com/mrkrd/cochlea\n\n.. _TODO.org: TODO.org\n\n\n\nSimilar Projects\n----------------\n\n- `Carney Lab`_\n- `Matlab Auditory Periphery`_\n- DSAM_\n- `Brian Hears`_\n- `The Auditory Modeling Toolbox`_\n\n.. _`Carney Lab`: http://www.urmc.rochester.edu/labs/Carney-Lab/publications/auditory-models.cfm\n.. _DSAM: http://dsam.org.uk/\n.. _`Matlab Auditory Periphery`: http://www.essexpsychology.macmate.me/HearingLab/modelling.html\n.. _`Brian Hears`: http://www.briansimulator.org/docs/hears.html\n.. _`The Auditory Modeling Toolbox`: http://amtoolbox.sourceforge.net/\n\n\n\nCiting\n------\n\nRudnicki M., Schoppe O., Isik M., Völk F. and\nHemmert W. (2015). *Modeling auditory coding: from sound to spikes*.\nCell and Tissue Research, Springer Nature, 361, pp. 159—175.\ndoi:10.1007/s00441-015-2202-z\nhttps://link.springer.com/article/10.1007/s00441-015-2202-z\n\n\nBibTeX entry::\n\n  @Article{Rudnicki2015,\n    author    = {Marek Rudnicki and Oliver Schoppe and Michael Isik and Florian Völk and Werner Hemmert},\n    title     = {Modeling auditory coding: from sound to spikes},\n    journal   = {Cell and Tissue Research},\n    year      = {2015},\n    volume    = {361},\n    number    = {1},\n    pages     = {159--175},\n    month     = {jun},\n    doi       = {10.1007/s00441-015-2202-z},\n    publisher = {Springer Nature},\n  }\n\n\nDo not forget to cite the original authors of the models as listed in\nImplemented Models.\n\n\n\nAcknowledgments\n---------------\n\nWe would like to thank Muhammad S.A. Zilany, Ian C. Bruce and\nLaurel H. Carney for developing inner ear models and allowing us to\nuse their code in *cochlea*.\n\nThanks goes to Marcus Holmberg, who developed the traveling wave based\nmodel.  His work was supported by the General Federal Ministry of\nEducation and Research within the Munich Bernstein Center for\nComputational Neuroscience (reference No. 01GQ0441, 01GQ0443 and\n01GQ1004B).\n\nWe are grateful to Ray Meddis for support with the Matlab Auditory\nPeriphery model.\n\nAnd last, but not least, I would like to thank Werner Hemmert for\nsupervising my PhD.  The thesis entitled *Computer models of\nacoustical and electrical stimulation of neurons in the auditory\nsystem* can be found at https://mediatum.ub.tum.de/1445042\n\nThis work was supported by the General Federal Ministry of Education\nand Research within the Munich Bernstein Center for Computational\nNeuroscience (reference No. 01GQ0441 and 01GQ1004B) and the German\nResearch Foundation Foundation's Priority Program PP 1608 *Ultrafast\nand temporally precise information processing: Normal and\ndysfunctional hearing*.\n\n\nLicense\n-------\n\nThe project is licensed under the GNU General Public License v3 or\nlater (GPLv3+).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkrd%2Fcochlea3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrkrd%2Fcochlea3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkrd%2Fcochlea3/lists"}