Git Product home page Git Product logo

python-signal-processing's Introduction

Python Signal Processing Awesome

This repository 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.

Contents


Tutorials

Signal processing can be daunting; 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

Now we know what are signals made of and we learned that combining multiple signals of various frequencies will jumbled up all the frequencies. 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

We know that signals can be noisy, and this tutorial will focus on removing these noise. We learn to apply the simplest filter to perform denoising, the running mean filter. We will also understand what are edge effects.

Open In Colab

4. Denoising with Gaussian-smooth filter

Next, we will look at a slight adaptation of the mean-smooth filter, the Gaussian smoothing filter. This tends to smooth the data to be a bit smoother compared to mean-smooth filter. This does not mean that one is better than the other, it depends on the specific applications. So, it is important to be aware of different filters type and how to use them.

Open In Colab

5. Canonical correlation analysis

Canonical correlation analysis (CCA) is applied to analyze the frequency components of a signal. In this tutorials, we use CCA for feature extraction and classification.

Open In Colab

6. Task-related component analysis

Task-related component analysis (TRCA) is a classification method originally for steady-state visual evoked potentials (SSVEPs) detection.

Open In Colab


Getting Started

Installation

Currently, this has not been released. Use git clone, 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 generate_signal
from splearn.filter.butter import butter_bandpass

signal_2d = generate_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, 
    sampling_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!

python-signal-processing's People

Contributors

jinglescode avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.