Skip to main content

splearn: package for signal processing and machine learning with Python.

Project description

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!

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

splearn-0.1a1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

splearn-0.1a1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file splearn-0.1a1.tar.gz.

File metadata

  • Download URL: splearn-0.1a1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for splearn-0.1a1.tar.gz
Algorithm Hash digest
SHA256 dd7a47bcdc180ad5be9d79c61f1d2f9ecce2ce77942c0254217b4a0761d8302b
MD5 8d18e7de6f96391fd04310f5075430ab
BLAKE2b-256 0f134afb9cb07e3cfbd28ae5597deb6d33e416abaedfee700acc87e39fc59b42

See more details on using hashes here.

File details

Details for the file splearn-0.1a1-py3-none-any.whl.

File metadata

  • Download URL: splearn-0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for splearn-0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 8cb749aa4f83767c559dc0b9b2a9f7125a17525d6ffc9c9e29eab81244e2ff11
MD5 70ea9b4b4c89ead0f8ae219ec41ea3b7
BLAKE2b-256 f5949ac6754c468943f53ffbf80752a93ce398d38ee75cf9e16a2b1fd5314662

See more details on using hashes here.

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