All Projects → claudiodsf → stockwell

claudiodsf / stockwell

Licence: other
Stockwell transform for Python

Programming Languages

python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to stockwell

SciDataTool
SciDataTool is an open-source Python package for scientific data handling. The objective is to provide a user-friendly, unified, flexible module to postprocess any kind of signal. It is meant to be used by researchers, R&D engineers and teachers in any scientific area. This package allows to efficiently store data fields in the time/space or in …
Stars: ✭ 21 (-44.74%)
Mutual labels:  signal
signal-cli-rest-api
signal-cli-rest-api is a wrapper around signal-cli and allows you to interact with it through http requests
Stars: ✭ 26 (-31.58%)
Mutual labels:  signal
BruteSploit
BruteSploit is a collection of method for automated Generate, Bruteforce and Manipulation wordlist with interactive shell. That can be used during a penetration test to enumerate and maybe can be used in CTF for manipulation,combine,transform and permutation some words or file text :p
Stars: ✭ 26 (-31.58%)
Mutual labels:  transform
ctxutil
utils for Go context
Stars: ✭ 18 (-52.63%)
Mutual labels:  signal
mapneat
MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJO to JSON in a declarative way.
Stars: ✭ 45 (+18.42%)
Mutual labels:  transform
DTMF-Decoder
A Java program to implement a DMTF Decoder.
Stars: ✭ 28 (-26.32%)
Mutual labels:  signal
conjson
(conventional, consistent, conformative) JSON - A simple, functional, no-tags-required mechanism to handle and transform JSON representations of values, consistently.
Stars: ✭ 47 (+23.68%)
Mutual labels:  transform
metalsmith-babel
A Metalsmith plugin to compile JavaScript with Babel
Stars: ✭ 19 (-50%)
Mutual labels:  transform
sigctx
context with signal in golang
Stars: ✭ 19 (-50%)
Mutual labels:  signal
xMusicWeb
已停止维护/此项目的功能是将qq歌单转换为网易云歌单,基于flask
Stars: ✭ 30 (-21.05%)
Mutual labels:  transform
binance-pump-alerts
Tracks prices of pairs on binance and notifies when price movements based on pre-defined parameters are met.
Stars: ✭ 65 (+71.05%)
Mutual labels:  signal
golib
Open version of common golang libraries useful to many projects.
Stars: ✭ 47 (+23.68%)
Mutual labels:  signal
acto
A signals library for functional reactive programming
Stars: ✭ 18 (-52.63%)
Mutual labels:  signal
fastener
Functional Zipper for manipulating JSON
Stars: ✭ 54 (+42.11%)
Mutual labels:  transform
tmo-live-graph
A simpe react app that plots a live view of the T-Mobile Home Internet Nokia 5G Gateway signal stats, helpful for optimizing signal.
Stars: ✭ 15 (-60.53%)
Mutual labels:  signal
purescript-wire
Events and Signals for FRP. Monad instances included
Stars: ✭ 13 (-65.79%)
Mutual labels:  signal
hassio-addons
Some home assistant addons I manage
Stars: ✭ 16 (-57.89%)
Mutual labels:  signal
signal2html
Export a Signal backup to pretty HTML
Stars: ✭ 45 (+18.42%)
Mutual labels:  signal
fefe
Validate, sanitize and transform values with proper TypeScript types and zero dependencies.
Stars: ✭ 34 (-10.53%)
Mutual labels:  transform
presage
A high-level Rust library to help write clients for the Signal Messenger.
Stars: ✭ 27 (-28.95%)
Mutual labels:  signal

Stockwell

Python package for time-frequency analysis through Stockwell transform.

Based on original code from NIMH MEG Core Facility.

cf-badge PyPI-badge license-badge

Installation

Using Anaconda

If you use Anaconda, the latest release of Stockwell is available via conda-forge.

To install, simply run:

conda install -c conda-forge stockwell

Using pip and PyPI

The latest release of Stockwell is available on the Python Package Index.

You can install it easily through pip:

pip install stockwell

Installation from source

If no precompiled package is available for you architecture on PyPI, or if you want to work on the source code, you will need to compile this package from source.

To obtain the source code, download the latest release from the releases page, or clone the GitHub project.

C compiler

Part of Stockwell is written in C, so you will need a C compiler.

On Linux (Debian or Ubuntu), install the build-essential package:

sudo apt install build-essential

On macOS, install the XCode Command Line Tools:

xcode-select --install

On Windows, install the Microsoft C++ Build Tools.

FFTW

To compile Stockwell, you will need to have FFTW installed.

If you use Anaconda (Linux, macOS, Windows):

conda install fftw

If you use Homebrew (macOS)

brew install fftw

If you use apt (Debian or Ubuntu)

sudo apt install libfftw3-dev

Install the Python package from source

Finally, install this Python package using pip:

pip install .

Or, alternatively, in "editable" mode:

pip install -e .

Usage

Example usage:

import numpy as np
from scipy.signal import chirp
import matplotlib.pyplot as plt
from stockwell import st

t = np.linspace(0, 10, 5001)
w = chirp(t, f0=12.5, f1=2.5, t1=10, method='linear')

fmin = 0  # Hz
fmax = 25  # Hz
df = 1./(t[-1]-t[0])  # sampling step in frequency domain (Hz)
fmin_samples = int(fmin/df)
fmax_samples = int(fmax/df)
stock = st.st(w, fmin_samples, fmax_samples)
extent = (t[0], t[-1], fmin, fmax)

fig, ax = plt.subplots(2, 1, sharex=True)
ax[0].plot(t, w)
ax[0].set(ylabel='amplitude')
ax[1].imshow(np.abs(stock), origin='lower', extent=extent)
ax[1].axis('tight')
ax[1].set(xlabel='time (s)', ylabel='frequency (Hz)')
plt.show()

You should get the following output:

stockwell.png

You can also compute the inverse Stockwell transform, ex:

inv_stock = st.ist(stock, fmin_samples, fmax_samples)
fig, ax = plt.subplots(2, 1, sharex=True)
ax[0].plot(t, w, label='original signal')
ax[0].plot(t, inv_stock, label='inverse Stockwell')
ax[0].set(ylabel='amplitude')
ax[0].legend(loc='upper right')
ax[1].plot(t, w - inv_stock)
ax[1].set_xlim(0, 10)
ax[1].set(xlabel='time (s)', ylabel='amplitude difference')
plt.show()

inv_stockwell.png

References

Stockwell, R.G., Mansinha, L. & Lowe, R.P., 1996. Localization of the complex spectrum: the S transform, IEEE Trans. Signal Process., 44(4), 998–1001, doi:10.1109/78.492555

S transform on Wikipedia.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].