https://github.com/claudiodsf/stockwell

Stockwell transform for Python

https://github.com/claudiodsf/stockwell

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.1%) to scientific vocabulary

Keywords

processing signal time-frequency-analysis transform
Last synced: 5 months ago · JSON representation

Repository

Stockwell transform for Python

Basic Info
  • Host: GitHub
  • Owner: claudiodsf
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 306 KB
Statistics
  • Stars: 96
  • Watchers: 7
  • Forks: 30
  • Open Issues: 3
  • Releases: 11
Topics
processing signal time-frequency-analysis transform
Created almost 8 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.md

Stockwell

Python package for time-frequency analysis through Stockwell transform.

Based on original code from NIMH MEG Core Facility.

changelog-badge 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.

On Linux and macOS, you can download and compile FFTW from source using the script get_fftw3.sh provided in the scripts directory:

./scripts/get_fftw3.sh

Alternatively, you can install FFTW using your package manager:

  • 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:

```python 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) fminsamples = int(fmin/df) fmaxsamples = int(fmax/df) stock = st.st(w, fminsamples, fmaxsamples) 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:

python 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.

Owner

  • Name: Claudio Satriano
  • Login: claudiodsf
  • Kind: user
  • Location: Paris, France
  • Company: @IPGP

Seismologist, Continuous Learner

GitHub Events

Total
  • Release event: 1
  • Watch event: 13
  • Issue comment event: 1
  • Push event: 13
  • Fork event: 4
  • Create event: 1
Last Year
  • Release event: 1
  • Watch event: 13
  • Issue comment event: 1
  • Push event: 13
  • Fork event: 4
  • Create event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 150
  • Total Committers: 2
  • Avg Commits per committer: 75.0
  • Development Distribution Score (DDS): 0.007
Past Year
  • Commits: 23
  • Committers: 1
  • Avg Commits per committer: 23.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Claudio Satriano s****o@g****m 149
Kacper Synowiec k****c@c****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 11
  • Total pull requests: 1
  • Average time to close issues: 5 months
  • Average time to close pull requests: about 2 years
  • Total issue authors: 11
  • Total pull request authors: 1
  • Average comments per issue: 2.64
  • Average comments per pull request: 2.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: 4 months
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 2.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • BubbaRich (1)
  • jkmacc-LANL (1)
  • mojeamjad (1)
  • amargondaliya (1)
  • YANKT (1)
  • IgnacioRubioScola (1)
  • AmirSarrafzadeh (1)
  • chiseo36 (1)
  • willw1 (1)
  • zhiwenj-HNU (1)
  • joamanuel (1)
Pull Request Authors
  • kacpersyn7 (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 700 last-month
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 3
    (may contain duplicates)
  • Total versions: 15
  • Total maintainers: 1
pypi.org: stockwell

Time-frequency analysis through Stockwell transform

  • Versions: 12
  • Dependent Packages: 2
  • Dependent Repositories: 3
  • Downloads: 700 Last month
Rankings
Dependent packages count: 4.6%
Average: 7.9%
Forks count: 8.0%
Stargazers count: 8.2%
Dependent repos count: 9.1%
Downloads: 9.8%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: stockwell

Python package for time-frequency analysis through Stockwell transform. Based on original code from NIMH MEG Core Facility (https://kurage.nimh.nih.gov/meglab/Meg/Stockwell).

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Forks count: 35.4%
Stargazers count: 35.5%
Average: 39.0%
Dependent packages count: 51.2%
Last synced: 6 months ago