Skip to main content

A biologically plausible vocoder framework for auditory perception modeling and cochlear implant simulation

Project description

🧠 NeuroVoc: From Spikes to Speech 🔊

arXiv
A biologically plausible vocoder for auditory perception modeling and cochlear implant simulation.


🔍 Overview

NeuroVoc is a flexible, biologically inspired vocoder that reconstructs audio signals from simulated auditory nerve activity. It is designed to support both normal hearing (NH) and electrical hearing (EH) models, allowing for a seamless comparison of auditory perception under different hearing conditions.

NeuroVoc Diagram

🧭 Diagram Explanation

The diagram above illustrates the NeuroVoc processing pipeline:

  1. Sound — An input waveform (e.g., speech) is passed to an auditory model.
  2. Hearing Model — This model (e.g., normal hearing or cochlear implant simulation) transforms the sound into a neural representation.
  3. Neurogram — The output is a time–frequency matrix of spike counts, simulating auditory nerve activity.
  4. Decoder — The neurogram is then converted back into an acoustic waveform using an inverse short-time Fourier transform (STFT)-based decoder.

This modular flow enables the flexible substitution of different models or model parameters while maintaining a consistent reconstruction backend.


📁 Repository Structure

neurovoc/
├── neurovoc/               # Core vocoder framework (Python package)
├── experiments/            # Scripts for generating the figures from the paper
├── data/                   # Din test data and paper data
├── tests/                  # Unit tests

The main package can be found in the neurovoc folder. Experiments holds the notebooks that were used to generate the plots in the paper. The online Digits in Noise test platform, can be found in this repository.


You're absolutely right — numbering those steps suggests a sequence, but in this case, they’re two alternative ways to install the package. Here's a better structure:


🚀 Getting Started

📦 Installation Options

🔧 Option 1: Install from Source (Development Version)

If you want to modify or contribute to the codebase:

git clone https://github.com/jacobdenobel/neurovoc.git
cd neurovoc
pip install .

🧪 Option 2: Install from PyPI (Stable Release)

If you just want to use the package:

pip install neurovoc

💻 Command Line Interface (CLI)

NeuroVoc provides a flexible CLI for simulation and vocoding. Once installed, you can use the neurovoc command. If you want to know more about a command, or see which options are available, add the --help flag. For example:

    neurovoc generate bruce --help

🔧 Generate a Neurogram

These commands take an audio waveform and convert it into a neurogram (neural spike representation):

neurovoc generate bruce input.wav output.pkl
neurovoc generate specres input.wav output.pkl
neurovoc generate ace input.wav output.pkl

Each model supports its own optional flags, like --n-fibers-per-bin, --n-mels, or --version for ACE.

🎧 Reconstruct Audio from Neurogram

Converts a saved neurogram back into an audio waveform using an inverse STFT-based decoder. Use options like --n-hop, --n-fft, or --target-sr to control reconstruction parameters.

neurovoc reconstruct output.pkl reconstructed.wav

🧪 Full Vocoder Run (Simulate + Reconstruct)

These commands run a full simulation + reconstruction cycle in one go:

neurovoc vocode bruce input.wav output.wav
neurovoc vocode specres input.wav output.wav
neurovoc vocode ace input.wav output.wav

Add --plot to visualize original vs reconstructed signal.


Certainly! Here's the “Processing a Custom Neurogram” section you can directly paste into your README:


🧩 Processing a Custom Neurogram

If you want to apply the NeuroVoc reconstruction logic to a neurogram generated by a method not included in this repository, you can wrap your custom matrix in a Neurogram object:

from neurovoc import Neurogram

neurogram = Neurogram(
    dt=...,             # float: time resolution of the neurogram (in seconds)
    frequencies=...,    # np.array (m, 1): frequency bins corresponding to rows
    data=...,           # np.array (m, t): matrix of normalized spike counts or neural activity
    source=...,         # str: label describing the source/method
)

📌 Note: Currently, only mel-scale frequency bins are supported for decoding.

Once constructed, save it to disk with:

neurogram.save("my_custom_ng.pkl")

Then reconstruct it using the CLI:

neurovoc reconstruct my_custom_ng.pkl reconstructed.wav

This makes it easy to plug external auditory models into the NeuroVoc decoding pipeline.


🧠 Citation

If you use NeuroVoc in your work, please cite the following:

@misc{denobel2025spikesspeechneurovoc,
    title={From Spikes to Speech: NeuroVoc -- A Biologically Plausible Vocoder Framework for Auditory Perception and Cochlear Implant Simulation}, 
    author={Jacob de Nobel and Jeroen J. Briaire and Thomas H. W. Baeck and Anna V. Kononova and Johan H. M. Frijns},
    year={2025},
    eprint={2506.03959},
    archivePrefix={arXiv},
    primaryClass={cs.SD},
    url={https://arxiv.org/abs/2506.03959}, 
}

📫 Contact

For questions or feedback, contact nobeljpde1@liacs.leidenuniv.nl
Or open an issue in this repository.


🛠 License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neurovoc-0.1.2.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neurovoc-0.1.2-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file neurovoc-0.1.2.tar.gz.

File metadata

  • Download URL: neurovoc-0.1.2.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for neurovoc-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e0b71b053edc86bb800bdcbf2b73522986f9c9743186b7bd0ce8b4fc95494c93
MD5 59f4403d2797ca5a512196abe86c250b
BLAKE2b-256 2584aa3f0be9d566abd50a5e79406426ece5c3a1951d99798538208f65c294f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for neurovoc-0.1.2.tar.gz:

Publisher: python-publish.yml on jacobdenobel/NeuroVoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file neurovoc-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: neurovoc-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for neurovoc-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b414509fcb56a04f3577892892eaacf0c0d92c058d84eab9eec709d2fcba9f46
MD5 c8a6a9d0d52aaa7fb79684bf9ac83717
BLAKE2b-256 14394b6764dd334489aaf305875f4def3962d3e251c7432505e9b8a66f2fd0b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for neurovoc-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on jacobdenobel/NeuroVoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page