Skip to main content

"Import, parse and process data collected with Spike2".

Project description


License: GPL v3 Code style: black coverage Contributor Covenant Documentation Status

spike2py provides a simple interface to analyse and visualise data collected using Spike2 software and Cambridge Electronics Design (CED) data acquisition boards. With it you can easily plot individual channels or all channels from a given trial. In addition, you can easily apply various signal processing methods to your waveform data. Finally, you can easily save your data at any point, allowing you to re-open and continue your work from where they left off.

To demonstrate, the following snippet of code shows you how to:

  1. Read a file
  2. Plot the electromyography (EMG) signal from one of the channels
  3. Remove the mean of the first 500 samples and rectify EMG signal, and plot the result
>>> from spike2py.trial import TrialInfo, Trial
>>> trial_info = TrialInfo(file="sample.mat")
>>> sample = Trial(trial_info)
>>> sample.muscle_emg.plot()
>>> sample.muscle_emg.remove_mean(first_n_samples=500).rect().plot()



Introductory tutorials, how-to's and other useful documentation are available on Read the Docs


spike2py is available on PyPI:

$ python -m pip install spike2py

spike2py officially supports Python 3.8+.


spike2py works with Matlab files exported from Spike2 v7, or any other Spike2 version that exports to Matlab 5.0 format. Spike2 v10 exports files to Matlab 7.3 format, which is currently not supported by spike2py. The ability to open both Matlab file formats will be added in future version of spike2py.


Like this project? Want to help? We would love to have your contribution! Please see CONTRIBUTING to get started.

Code of conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to



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

spike2py-0.2.10.tar.gz (30.3 kB view hashes)

Uploaded source

Built Distribution

spike2py-0.2.10-py3-none-any.whl (26.8 kB view hashes)

Uploaded py3

Supported by

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