Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
6941ce4
fix!: variation prepend changed with append due to algo original setup
ben9809 Dec 22, 2025
0dcd481
refactor: fix tbr tests
ben9809 Dec 22, 2025
c2a8797
refactor: code style optimization
ben9809 Dec 22, 2025
40f70f9
docs: fix documentation style
ben9809 Dec 22, 2025
f3e258c
docs: refactor fundamentals of TBR
ben9809 Dec 29, 2025
15054e4
refactor: change output type and add code comments
ben9809 Dec 29, 2025
d698567
tests: handle return type tuple for TBR
ben9809 Dec 29, 2025
f2bb139
docs: style opt
ben9809 Dec 29, 2025
3f42dda
tests: remove test type factor variable
ben9809 Dec 29, 2025
3feac7d
tests: add test for npn numeric factor parameters
ben9809 Dec 29, 2025
10b6ae3
test: add test fro return types checking
ben9809 Dec 29, 2025
b9888c3
docs: update factor types and writing style reference
ben9809 Dec 29, 2025
44ba4d0
docs: update return type and add short description
ben9809 Dec 29, 2025
cda7aa7
docs: update return type and add short description
ben9809 Dec 29, 2025
ccb35df
docs: fix return type and update example including threshold variable
ben9809 Dec 29, 2025
371a287
refactor: code style optimization
ben9809 Dec 29, 2025
362baef
docs: update contributing directions
ben9809 Dec 29, 2025
3f85bc0
ci: test documentation and add new docs dependecy
ben9809 Dec 29, 2025
10734cd
refactor: update lock file
ben9809 Dec 29, 2025
926615b
docs: update description of TBR
ben9809 Dec 30, 2025
9a27189
refactor: factor types and relative tests
ben9809 Dec 30, 2025
53f26f9
tests: increase test coverage
ben9809 Dec 30, 2025
076e0f6
docs: fix raises error description
ben9809 Dec 30, 2025
76efdfc
refactor: code style optimization
ben9809 Dec 30, 2025
f5939e4
refactor: update lock file
ben9809 Dec 30, 2025
10b055f
refactor: docs style optimization
ben9809 Dec 30, 2025
c170439
Merge pull request #27 from neuromorphic-polito/fix/tbr
ben9809 Dec 30, 2025
53cb2ca
docs: update SF description
ben9809 Dec 30, 2025
88ee69c
fix: SF algorithm timestep
ben9809 Dec 30, 2025
f6220ca
docs: optimize description style
ben9809 Dec 30, 2025
b47426a
Merge pull request #28 from neuromorphic-polito/fix/sf
ben9809 Dec 30, 2025
f6f8f55
fix: mw algorithm
ben9809 Dec 31, 2025
e1eb271
docs: update description MW
ben9809 Dec 31, 2025
634be00
docs: update description for contrast based algorithms
ben9809 Dec 31, 2025
e8da67e
refactor: update types description
ben9809 Dec 31, 2025
35572ea
docs: update ZCSF description
ben9809 Dec 31, 2025
da909ac
docs: writing style optimization
ben9809 Dec 31, 2025
b3fb3b3
Merge pull request #29 from neuromorphic-polito/fix/deconv
ben9809 Dec 31, 2025
9f574dd
docs: update docs with pseudocode BSA
ben9809 Jan 1, 2026
c8b1e4d
refactor: add fir filter to BSA
ben9809 Jan 1, 2026
bd5e254
refactor: type docs and add kwargs params for filter parameter
ben9809 Jan 1, 2026
ee1c942
refactor: BSA code optimization for FIR configuration
ben9809 Jan 2, 2026
334b442
refactor: documentation and function parameters updates
ben9809 Jan 4, 2026
d45d060
tests: update and add new tests to reflect changes
ben9809 Jan 4, 2026
f1e5995
doctests: fix test failure due to print statement
ben9809 Jan 4, 2026
ace32b8
docs: code style optimization
ben9809 Jan 5, 2026
bbd8fbe
fix: hsa issue and doc updates
ben9809 Jan 5, 2026
0322769
docs: update pseudocode
ben9809 Jan 5, 2026
42299a3
docs: update hsa documentation
ben9809 Jan 5, 2026
728cdcc
fix: path directory
ben9809 Jan 5, 2026
ed7abbd
tests: update tests to reflect new changes
ben9809 Jan 5, 2026
37c66b1
docs: update description algo
ben9809 Jan 6, 2026
a18c4de
refactor: add new params and update documentation
ben9809 Jan 6, 2026
07dab51
tests: update tests for new parameter update
ben9809 Jan 6, 2026
4473509
docs: update description bsa
ben9809 Jan 6, 2026
1ef36d9
docs: update description
ben9809 Jan 6, 2026
5a13d77
dos: update docs and index descriptions
ben9809 Jan 7, 2026
3d8b69f
Merge pull request #30 from neuromorphic-polito/fix/conv
ben9809 Jan 7, 2026
af81dd0
refactor: change name to poisson encoding function
ben9809 Jan 7, 2026
0b71f7f
refactor: convert logo to jpeg
ben9809 Jan 8, 2026
669f9e0
fix: logo
ben9809 Jan 9, 2026
4341f7f
fix: logo alignment and switch white/dark logo
ben9809 Jan 9, 2026
1a5f872
fix: alignment logo with paragraph
ben9809 Jan 9, 2026
6bbc804
refactor: add readme compatible with pypi
ben9809 Jan 9, 2026
541fc3b
refactor: update codemeta version
ben9809 Jan 9, 2026
f063474
refactor: add codemeta version auto-update
ben9809 Jan 9, 2026
2f01221
fix: codemeta version identifier
ben9809 Jan 9, 2026
a081690
refactor: add download link version auto-update
ben9809 Jan 9, 2026
b08ff4f
refactor: description and email data
ben9809 Jan 9, 2026
03476ec
refactor: add possibility to update dates
ben9809 Jan 9, 2026
8097c5c
docs: add pseudocode and refactor documentation
ben9809 Jan 10, 2026
cad6cd1
refactor: documentation update and signal normalization update
ben9809 Jan 10, 2026
ead5383
tests: fix error signal type
ben9809 Jan 10, 2026
ee3bdf7
refactor: code style optimization and doc update
ben9809 Jan 13, 2026
1887a6b
refactor: rename global-referenced phase encoding function
ben9809 Jan 13, 2026
f009052
docs: import new poisson algorithm with its new function name
ben9809 Jan 13, 2026
0ebe86e
refactor: change function name
ben9809 Jan 13, 2026
723f7e4
docs: update animation image
ben9809 Jan 13, 2026
40a91ef
Merge pull request #33 from neuromorphic-polito/fix/readme-logo
ben9809 Jan 13, 2026
e23f1db
Merge branch 'dev' into fix/codemeta-version
ben9809 Jan 13, 2026
01c8960
Merge pull request #34 from neuromorphic-polito/fix/codemeta-version
ben9809 Jan 13, 2026
b55cd8e
Merge branch 'dev' into refactor/rate
ben9809 Jan 13, 2026
c00be80
docs: change import name function
ben9809 Jan 13, 2026
ca4bd3e
refactor: change import name function and fix example
ben9809 Jan 13, 2026
c4ec688
Merge branch 'dev' into refactor/gr
ben9809 Jan 14, 2026
85b326b
refactor: code style optimization
ben9809 Jan 14, 2026
241a12a
refactor: code style optimization
ben9809 Jan 14, 2026
9b145b4
docs: refactor poisson description and pseudocode and mhsa
ben9809 Jan 21, 2026
b6489a7
Merge pull request #31 from neuromorphic-polito/refactor/rate
ben9809 Jan 21, 2026
6a92206
Merge branch 'dev' into refactor/latency
ben9809 Jan 21, 2026
7296878
refactor(burst)!: rename burst encoding into burst coding to shorthen…
ben9809 Jan 26, 2026
07c5ac4
fix: doctest
ben9809 Jan 26, 2026
a25e765
docs: refactor burst coding description
ben9809 Jan 26, 2026
7541339
Merge branch 'dev' into refactor/gr
ben9809 Jan 26, 2026
d24cad4
refactor: update description documentation, handle automatic signal s…
ben9809 Jan 26, 2026
79adb24
refactor: reshape output vector
ben9809 Jan 26, 2026
a0635f2
refactor: typo and style optimization
ben9809 Jan 26, 2026
6254752
tests: fix return vector
ben9809 Jan 26, 2026
4163aff
docs: warning on doc compilation solved
ben9809 Jan 29, 2026
761907f
docs: change citation and rename encoding algo
ben9809 Feb 10, 2026
9c38d7b
refactor: code style optimization
ben9809 Feb 10, 2026
10dd742
docs: desc style optimization
ben9809 Feb 10, 2026
19887ed
docs: update description for phase encoding and style optimization
ben9809 Feb 10, 2026
d9b225b
docs: add link to python implementation
ben9809 Feb 10, 2026
4284d2f
docs: style optimization
ben9809 Feb 10, 2026
6172582
docs: style optimization
ben9809 Feb 10, 2026
a4d1c5f
docs: style optimization
ben9809 Feb 10, 2026
40ef7cb
Merge pull request #37 from neuromorphic-polito/refactor/latency
ben9809 Feb 11, 2026
f518769
Merge branch 'dev' into refactor/gr
ben9809 Feb 11, 2026
27ca024
docs: clarify description for global referenced algos
ben9809 Mar 3, 2026
6a2049b
Merge pull request #36 from neuromorphic-polito/refactor/gr
ben9809 Mar 3, 2026
a453c72
refactor(FilterBank): improve filter coefficient selection and update…
ben9809 Mar 3, 2026
cba2647
tests(FilterBank): improve test coverage on center frequencies
ben9809 Mar 3, 2026
bd0df3a
refactor(FilterBank): code style optimization
ben9809 Mar 3, 2026
ea383cb
refactor(FilterBank): ensure 2D signal processing and remove unnecess…
ben9809 Mar 3, 2026
33d2b9d
refactor: remove image
ben9809 Apr 14, 2026
752336b
refactor: code style opt
ben9809 Apr 14, 2026
d3f03b5
Merge pull request #38 from neuromorphic-polito/refactor/filterbank
ben9809 Apr 14, 2026
6ee22c1
refactor: add a more technical description for each encoding algo and…
ben9809 Apr 14, 2026
b960c70
refactor!: rename `filtering` and `encoding` packages to `filters` an…
ben9809 Apr 14, 2026
10b9182
docs: enhace doc and rename paths according to the new module renaming
ben9809 Apr 14, 2026
5c61504
refactor: apply description changes
ben9809 Apr 14, 2026
1a4212b
refactor: pypi read version
ben9809 Apr 14, 2026
d9a870b
Merge pull request #39 from neuromorphic-polito/refactor/readme
ben9809 Apr 14, 2026
0dba387
Merge branch 'dev' into refactor/structure
ben9809 Apr 14, 2026
b6fb556
Merge pull request #40 from neuromorphic-polito/refactor/structure
ben9809 Apr 14, 2026
e075b55
docs: update changelog
ben9809 Apr 14, 2026
1cb73ef
Merge pull request #42 from neuromorphic-polito/docs/changelog
ben9809 Apr 14, 2026
632dc58
Bump version: 0.3.0 → 1.0.0"
ben9809 Apr 14, 2026
fbab4b4
Merge pull request #43 from neuromorphic-polito/1.0.0
ben9809 Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
regex = false
current_version = "0.3.0"
current_version = "1.0.0"
ignore_missing_version = false
search = "{current_version}"
replace = "{new_version}"
Expand All @@ -29,4 +29,26 @@ replace = "version = \"{new_version}\""
[[tool.bumpversion.files]]
filename = "spikify/version.py"
search = "__version__ = \"{current_version}\""
replace = "__version__ = \"{new_version}\""
replace = "__version__ = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "codemeta.json"
search = "\"version\": \"{current_version}\""
replace = "\"version\": \"{new_version}\""

[[tool.bumpversion.files]]
filename = "codemeta.json"
search = "\"downloadUrl\": \"https://github.com/neuromorphic-polito/spikify/releases/tag/{current_version}"
replace = "\"downloadUrl\": \"https://github.com/neuromorphic-polito/spikify/releases/tag/{new_version}"

[[tool.bumpversion.files]]
filename = "codemeta.json"
search = "\"dateModified\": \"\\d{{4}}-\\d{{2}}-\\d{{2}}\""
replace = "\"dateModified\": \"{now:%Y-%m-%d}\""
regex = true

[[tool.bumpversion.files]]
filename = "codemeta.json"
search = "\"datePublished\": \"\\d{{4}}-\\d{{2}}-\\d{{2}}\""
replace = "\"datePublished\": \"{now:%Y-%m-%d}\""
regex = true
37 changes: 36 additions & 1 deletion .github/workflows/python-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,39 @@ jobs:
flags: unittests
name: coverage-spikify
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
verbose: true

test-documentation:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry

- name: Install dependencies
run: |
poetry install --with docs

- name: Test documentation
run: |
cd docs
poetry run make doctest

- name: Check documentation links
run: |
cd docs
poetry run make linkcheck

- name: Clean up documentation build files
run: |
cd docs
poetry run make clean
75 changes: 34 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
<p align="center">
<img src="https://github.com/neuromorphic-polito/spikify/blob/main/docs/_static/white_logo.svg" alt="Spikify Overview" />
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/neuromorphic-polito/spikify/42e47995b238a3dafbfe30480277edde62a2736e/docs/_static/dark_logo.svg" width=500>
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/neuromorphic-polito/spikify/42e47995b238a3dafbfe30480277edde62a2736e/docs/_static/white_logo.svg" width=500>
<img alt="spikify" src="https://raw.githubusercontent.com/neuromorphic-polito/spikify/42e47995b238a3dafbfe30480277edde62a2736e/docs/_static/white_logo.svg">
</picture>
</p>

Spikify is a Python package designed to transform raw signals into spike trains that can be fed into Spiking Neural Networks (SNNs). This package implements a variety of spike encoding techniques based on recent research to facilitate the integration of time-varying signals into neuromorphic computing frameworks.
spikify is a Python package designed to transform raw signals into spike trains that can be fed into Spiking Neural Networks (SNNs). This package implements a variety of spike encoding techniques based on recent research to facilitate the integration of time-varying signals into neuromorphic computing frameworks.

## Introduction

Spiking Neural Networks (SNNs) are a novel type of artificial neural network that operates using discrete events (spikes) in time, inspired by the behavior of biological neurons. They are characterized by their potential for low energy consumption and computational cost, making them suitable for edge computing and IoT applications. However, traditional digital signals must be encoded into spike trains before they can be processed by SNNs.

This package provides a suite of spike encoding techniques that convert time-varying signals into spikes, enabling seamless integration with neuromorphic computing technologies. The encoding techniques implemented in this package are based on the research article: "Spike Encoding Techniques for IoT Time-Varying Signals Benchmarked on a Neuromorphic Classification Task" (Forno et al., 2022).

## Features

* Multiple Spike Encoding Techniques: Includes both rate-based and temporal encoding schemes
* **Signal Preprocessing:** Tools for filtering and preparing signals, including:
* **Gammatone Filter:** Mimics human auditory filtering, useful for audio and speech signals.
* **Butterworth Filter:** Smooths and removes noise from signals, ideal for general sensor data.
* Easily chain filters before encoding to improve spike train quality.

## Installation

To install the Spikify package, use pip:
To install the spikify package, use pip:

```bash
pip install innuce-spikify
Expand All @@ -32,12 +28,12 @@ Here is a simple example to get started:

```python
import numpy as np
from spikify.filtering import FilterBank
from spikify.encoding.rate import poisson_rate
from spikify.filters import FilterBank
from spikify.encoders.rate import poisson

# Generate a sinusoidal signal
time = np.linspace(0, 2 * np.pi, 100) # Time from 0 to 2*pi
amplitude = np.sin(time) # Sinusoidal signal
time = np.linspace(0, 4 * np.pi, 200)
signal = np.sin(2 * time) + 0.5 * np.sin(4 * time)

filter = FilterBank(fs=50, channels=5, f_min=0.5, f_max=5, order=4, filter_type='butterworth')

Expand All @@ -46,44 +42,41 @@ filtered_signal = filter.decompose(signal) # (timesteps, channels, features)
filtered_signal = np.reshape(filtered_signal, (-1, filtered_signal.shape[1] * filtered_signal.shape[2]))

# Encode the filtered signal
encoded_signal = poisson_rate(filtered_signal, interval_length=2)
encoded_signal = poisson(filtered_signal, interval_length=2)
```

For more detailed examples and usage, please refer to the [documentation](https://spikify.readthedocs.io/en/latest/).

## Encoding Techniques

This package implements several spike encoding families techniques, including:

| Encoding Family | Algorithm | Description |
|------------------------|--------------------------|--------------------------------------|
| **Rate Encoding** | Poisson Rate | Encodes intensity as firing rate |
| **Temporal Encoding** | Moving Window | Spikes on local changes |
| | Step Forward | Spikes on signal steps |
| | Threshold-Based | Spikes when crossing thresholds |
| | Zero-Cross Step Forward | Spikes on zero-crossings |
| **Deconvolution-Based**| Ben Spiker | Deconvolves spikes from signal |
| | Hough Spiker | Uses Hough transform for spikes |
| | Modified Hough Spiker | Robust Hough-based encoding |
| **Global Referenced** | Phase Encoding | Encodes phase information |
| | Time-to-Spike | Spikes at specific time delays |
| **Latency Encoding** | Burst Encoding | Encodes bursts of spikes |

**Tip:**
spikify implements the following spike encoding families:

| Encoding Family | Algorithm | Description |
|------------------------|--------------------------|---------------------------------------------------------------------------------------------------|
| **Rate Encoding** | Poisson Rate | Models spike generation as a Poisson process; instantaneous firing rate proportional to signal amplitude |
| **Temporal Encoding** | Threshold-Based | Fires an ON spike when the signal crosses a positive threshold, and an OFF spike when it crosses a negative one |
| | Step Forward | Fires ON or OFF spikes each time the signal accumulates enough change in either direction |
| | Zero-Cross Step Forward | Simplified version of the step-forward that encodes only positive signals |
| | Moving Window | Fires positive or negative spikes when the signal rises or drops significantly within a short local window |
| **Deconvolution-Based** | Hough Spiker | Implements an iterative subtraction procedure between the signal and a convolution filter |
| | Modified Hough Spiker | Extends Hough Spiker with outlier rejection for noise-robust encoding |
| | Bens Spiker | Extends the Hough Spiker with an additional error control threshold |
| **Global Referenced** | Phase Encoding | Use the inverse arcsin transformation of the signal to compute the binary pattern based on a quantized local mean value of the input |
| | Time-to-First Spike | Encodes amplitude as latency delay from stimulus onset to first spike |
| **Latency Encoding** | Burst Coding | Represents signal intensity via inter-spike interval within a burst |

**Tips:**
- Use **Poisson Rate** for general-purpose encoding.
- Use **Temporal** or **Deconvolution** methods for signals where timing or event structure is important.

## Filters

Spikify provides preprocessing filters that can be applied to signals before encoding to improve spike train quality and remove noise. These filters help condition the raw signal data for better encoding performance.

### Available Filters

| Filter Type | Description |
|-------------------|----------------------------------------------------|
| **Gammatone** | Mimics human auditory filtering |
| **Butterworth** | Low-pass filter for noise reduction and smoothing |
spikify provides preprocessing filters to condition raw signals before encoding. Both filters are implemented as filter banks with configurable channels, frequency bounds, and order.

| Filter Type | Description |
|-----------------|------------------------------------------------------------------------------------------------------|
| **Gammatone** | Bandpass filterbank approximating basilar membrane response; models cochlear frequency decomposition |
| **Butterworth** | IIR low-pass filter with maximally flat passband; attenuates high-frequency noise before encoding |

## Encoded Datasets

Expand Down
111 changes: 111 additions & 0 deletions README_PYPI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<p align="center">
<img src="https://raw.githubusercontent.com/neuromorphic-polito/spikify/42e47995b238a3dafbfe30480277edde62a2736e/docs/_static/white_logo.svg"
width="500"
alt="spikify logo">
</p>

spikify is a Python package designed to transform raw signals into spike trains that can be fed into Spiking Neural Networks (SNNs). This package implements a variety of spike encoding techniques based on recent research to facilitate the integration of time-varying signals into neuromorphic computing frameworks.

## Introduction

Spiking Neural Networks (SNNs) are a novel type of artificial neural network that operates using discrete events (spikes) in time, inspired by the behavior of biological neurons. They are characterized by their potential for low energy consumption and computational cost, making them suitable for edge computing and IoT applications. However, traditional digital signals must be encoded into spike trains before they can be processed by SNNs.

This package provides a suite of spike encoding techniques that convert time-varying signals into spikes, enabling seamless integration with neuromorphic computing technologies. The encoding techniques implemented in this package are based on the research article: "Spike Encoding Techniques for IoT Time-Varying Signals Benchmarked on a Neuromorphic Classification Task" (Forno et al., 2022).

## Installation

To install the spikify package, use pip:

```bash
pip install innuce-spikify
```

## Usage

Here is a simple example to get started:

```python
import numpy as np
from spikify.filters import FilterBank
from spikify.encoders.rate import poisson

# Generate a sinusoidal signal
time = np.linspace(0, 4 * np.pi, 200)
signal = np.sin(2 * time) + 0.5 * np.sin(4 * time)

filter = FilterBank(fs=50, channels=5, f_min=0.5, f_max=5, order=4, filter_type='butterworth')

filtered_signal = filter.decompose(signal) # (timesteps, channels, features)

filtered_signal = np.reshape(filtered_signal, (-1, filtered_signal.shape[1] * filtered_signal.shape[2]))

# Encode the filtered signal
encoded_signal = poisson(filtered_signal, interval_length=2)
```

For more detailed examples and usage, please refer to the [documentation](https://spikify.readthedocs.io/en/latest/).

## Encoding Techniques

spikify implements the following spike encoding families:

| Encoding Family | Algorithm | Description |
|------------------------|--------------------------|---------------------------------------------------------------------------------------------------|
| **Rate Encoding** | Poisson Rate | Models spike generation as a Poisson process; instantaneous firing rate proportional to signal amplitude |
| **Temporal Encoding** | Threshold-Based | Fires an ON spike when the signal crosses a positive threshold, and an OFF spike when it crosses a negative one |
| | Step Forward | Fires ON or OFF spikes each time the signal accumulates enough change in either direction |
| | Zero-Cross Step Forward | Simplified version of the step-forward that encodes only positive signals |
| | Moving Window | Fires positive or negative spikes when the signal rises or drops significantly within a short local window |
| **Deconvolution-Based** | Hough Spiker | Implements an iterative subtraction procedure between the signal and a convolution filter |
| | Modified Hough Spiker | Extends Hough Spiker with outlier rejection for noise-robust encoding |
| | Bens Spiker | Extends the Hough Spiker with an additional error control threshold |
| **Global Referenced** | Phase Encoding | Use the inverse arcsin transformation of the signal to compute the binary pattern based on a quantized local mean value of the input |
| | Time-to-First Spike | Encodes amplitude as latency delay from stimulus onset to first spike |
| **Latency Encoding** | Burst Coding | Represents signal intensity via inter-spike interval within a burst |

**Tips:**
- Use **Poisson Rate** for general-purpose encoding.
- Use **Temporal** or **Deconvolution** methods for signals where timing or event structure is important.

## Filters

spikify provides preprocessing filters to condition raw signals before encoding. Both filters are implemented as filter banks with configurable channels, frequency bounds, and order.

| Filter Type | Description |
|-----------------|------------------------------------------------------------------------------------------------------|
| **Gammatone** | Bandpass filterbank approximating basilar membrane response; models cochlear frequency decomposition |
| **Butterworth** | IIR low-pass filter with maximally flat passband; attenuates high-frequency noise before encoding |

## Encoded Datasets

The following datasets have been selected to serve as examples for benchmarking spike train encoding techniques:

* WISDM Dataset: 20 Hz recordings of human activity through mobile and wearable inertial sensors

These datasets are preprocessed and converted into spike trains to evaluate the performance of different encoding techniques.

## Citation

If you use this framework in your research, please cite the following article:

```bibtex
@ARTICLE{
10.3389/fnins.2022.999029,
AUTHOR={Forno, Evelina and Fra, Vittorio and Pignari, Riccardo and Macii, Enrico and Urgese, Gianvito },
TITLE={Spike encoding techniques for IoT time-varying signals benchmarked on a neuromorphic classification task},
JOURNAL={Frontiers in Neuroscience},
VOLUME={16},
YEAR={2022},
URL={https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2022.999029},
DOI={10.3389/fnins.2022.999029},
ISSN={1662-453X},
}
```

## Contributing

We welcome contributions from the community. Please see our CONTRIBUTING.rst file for more details on how to get involved.

## License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
4 changes: 2 additions & 2 deletions animation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import matplotlib.pyplot as plt
import imageio.v2 as imageio
from spikify.encoding.rate import poisson_rate
from spikify.encoders.rate import poisson
import os

# Set style for better visualization
Expand All @@ -13,7 +13,7 @@
signal = np.sin(2 * t) + 0.5 * np.sin(4 * t) # More complex signal

# Generate spikes
spikes = poisson_rate(signal=signal, interval_length=5)
spikes = poisson(signal=signal, interval_length=5)
spike_times = t[spikes]

# Color settings
Expand Down
Loading
Loading