Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Python Signal Processing

Signal processing can be daunting; this repo contains tutorials on understanding and applying signal processing using NumPy and PyTorch.

splearn is a package for signal processing and machine learning with Python. It is built on top of NumPy and SciPy, to provide easy to use functions from common signal processing tasks to machine learning.

Table of Contents


Tutorials

We aim to bridge the gap for anyone who are new signal processings to get started, check out the tutorials to get started on signal processings.

1. Signal composition (time, sampling rate and frequency)

In order to begin the signal processing adventure, we need to understand what we are dealing with. In the first tutorial, we will uncover what is a signal, and what it is made up of. We will look at how the sampling rate and frequency can affect a signal. We will also see what happens when we combine multiple signals of different frequencies.

Open In Colab

2. Fourier Transform

In the first tutorial, we learned that combining multiple signals will produce a new signal where all the frequencies are jumbled up. In this tutorial, we will learn about Fourier Transform and how it can take a complex signal and decompose it to the frequencies that made it up.

Open In Colab

3. Denoising with mean-smooth filter

How can we apply the simplest filter to perform denoising? Introduce the running mean filter; we can remove noise that is normally distributed relative to the signal of interest.

Open In Colab

Getting Started

Installation

Currently, this has not been released. Use Git or checkout with SVN, and install the dependencies:

git clone https://github.com/jinglescode/python-signal-processing.git
pip install -r requirements.txt

Dependencies

See requirements.txt.

Usage

Let's generate a 2D-signal, sampled at 100-Hz. Design and apply a 4th-order bandpass Butterworth filter with a cutoff frequency between 5-Hz and 20-Hz.

from splearn.data.generate import signal
from splearn.filter.butter import butter_bandpass

signal_2d = signal(
    length_seconds=4, 
    sampling_rate=100, 
    frequencies=[[4,7,11,17,40, 50],[1, 3]],
    plot=True
)

signal_2d_filtered = butter_bandpass(
    signal=signal_2d, 
    lowcut=5, 
    highcut=20, 
    sample_rate=100,
    type='sos',
    order=4, 
    plot=True,
    plot_xlim=[3,20]
)

Disclaimer on Datasets

We do not host or distribute these datasets, vouch for their quality or fairness, or claim that you have license to use the dataset. It is your responsibility to determine whether you have permission to use the dataset under the dataset's license.

If you're a dataset owner and wish to update any part of it (description, citation, etc.), or do not want your dataset to be included in this library, please get in touch through a GitHub issue. Thanks for your contribution to the ML community!

Metadata

Release files for splearn 0.1a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for splearn 0.1a1
File Size Uploaded
splearn-0.1a1.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for splearn 0.1a1
File Interpreter ABI Platform
splearn-0.1a1-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / splearn-0.1a1.tar.gz

Download URL splearn-0.1a1.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dd7a47bcdc180ad5be9d79c61f1d2f9ecce2ce77942c0254217b4a0761d8302b
BLAKE2b-256 checksum
How to use checksums
0f134afb9cb07e3cfbd28ae5597deb6d33e416abaedfee700acc87e39fc59b42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

Release files / splearn-0.1a1-py3-none-any.whl

Download URL splearn-0.1a1-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cb749aa4f83767c559dc0b9b2a9f7125a17525d6ffc9c9e29eab81244e2ff11
BLAKE2b-256 checksum
How to use checksums
f5949ac6754c468943f53ffbf80752a93ce398d38ee75cf9e16a2b1fd5314662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.1a1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page