Skip to main content

Fast FFTW-based spectrogram computation — a drop-in replacement for scipy.signal.spectrogram

Project description

spectrofast

Fast FFTW-based spectrogram computation for Python. A simple, fast alternative to scipy.signal.spectrogram.

Installation

Prerequisites

spectrofast requires the FFTW3 library and a C compiler.

Windows:

  • Install Visual Studio Build Tools (select "Desktop development with C++")
  • FFTW is bundled with the package, no extra steps needed

Linux (Debian/Ubuntu):

sudo apt install libfftw3-dev

Linux (Fedora):

sudo dnf install fftw-devel

macOS:

brew install fftw

Install spectrofast

pip install spectrofast

Or install from source:

git clone https://github.com/yourusername/spectrofast.git
cd spectrofast
pip install .

Usage

import numpy as np
from spectrofast import spectrogram

# Single signal
signal = np.sin(2 * np.pi * np.arange(1024) / 32).astype(np.float64)
result = spectrogram(signal, nperseg=256, noverlap=128)
print(result.shape)  # (4, 129)

# Batch of signals
signals = np.random.randn(100, 1024).astype(np.float64)
result = spectrogram(signals, nperseg=256, noverlap=128)
print(result.shape)  # (100, 4, 129)

# With zero-padding
result = spectrogram(signal, nperseg=256, noverlap=128, nfft=512)
print(result.shape)  # (4, 257)

Output

The spectrogram function returns magnitude-squared values (i.e., real^2 + imag^2). This avoids the expensive sqrt operation and is suitable for most spectral analysis tasks.

License

MIT

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

spectrofast-0.3.2.tar.gz (997.8 kB view details)

Uploaded Source

Built Distributions

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

spectrofast-0.3.2-cp313-cp313-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.13Windows x86-64

spectrofast-0.3.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

spectrofast-0.3.2-cp313-cp313-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

spectrofast-0.3.2-cp312-cp312-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.12Windows x86-64

spectrofast-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

spectrofast-0.3.2-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

spectrofast-0.3.2-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11Windows x86-64

spectrofast-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

spectrofast-0.3.2-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

spectrofast-0.3.2-cp310-cp310-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.10Windows x86-64

spectrofast-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

spectrofast-0.3.2-cp310-cp310-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

spectrofast-0.3.2-cp39-cp39-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.9Windows x86-64

spectrofast-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

spectrofast-0.3.2-cp39-cp39-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file spectrofast-0.3.2.tar.gz.

File metadata

  • Download URL: spectrofast-0.3.2.tar.gz
  • Upload date:
  • Size: 997.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for spectrofast-0.3.2.tar.gz
Algorithm Hash digest
SHA256 1b7b235f0d6cc4989c7b201bbae4a7e3edce79cba149915435d00639decbd9a1
MD5 6f5dc480951ebb195b3647ea104c61fb
BLAKE2b-256 1209f123f59e329e8c52c21efbf5e774c487d6a1014aa936ea490de664278676

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2.tar.gz:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7ab541fe251d3fd1128ec8f186aee252b363218678e68306777f940426b47a3e
MD5 382db2a481166499ff290879f42968af
BLAKE2b-256 7a5c3ca658edbaab0aedbf28cb3aa2b29d7b771a4129237aa2cf6c194f979eac

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp313-cp313-win_amd64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 445d0a2edb0fc57d14b311023bccbd77f8aec627b6f190c896a5f5e949b15fc4
MD5 522fe075c303ea4b3878c19f26876a97
BLAKE2b-256 8c0f67cd985f85a872afbc02e5a1dcb214f513b018343c8500e1b4a013b6c92e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cdbd48213c86d2188678c503fd793b2756abd7ecfee20c6c89de144a5db8be44
MD5 022a0a15171f5d4fadefd8b2714fc1f5
BLAKE2b-256 33c4d62083f0914e51cbc70a24d53c20cb41605e6e614e7c8b37f029cea4abaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 421e1e77324e3d7221c1921b3d726e17525f789b3833239cedc9f5b7e7e8bfe4
MD5 9c00d4ef147f63fba5d3ba534624e04b
BLAKE2b-256 32dc391e6387aa175074923113f1ac8a06c511582e07a7cccf4bf8f23e9f5f8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp312-cp312-win_amd64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9dedf3a3a2afc2f40769eff1424a4e3ae20f69fb5ba61e33f2f17230f8b49a2
MD5 82987265ba2bb9a00a2b695c6a6cdfa9
BLAKE2b-256 9a57e921a96e3d81e46e88c17d4931e69f9704bcc7e4d0c8775a32e9d52dd8b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ca62fd9580e939952276b25dc7a39ea6651bddab2286e92cdb3c0cd50e43e0a2
MD5 6757b7c3e2da583c255e468c858b22d7
BLAKE2b-256 97786f0057c34723e9d9b0a17a6e7b74875c495214073ec9b9b598334dddc301

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fc92363ed677446b3c8021c1d570145ad3595777e8823e731bf7d5c91e611271
MD5 de970ff9413b82ea7a0722e7f172c0c2
BLAKE2b-256 f69e99d4a1d1c902f955727a693339beb30cff7e1a4b7611e4187847ddae8116

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp311-cp311-win_amd64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c006c07f4935151b8d51f7315fbcca396284a70936fdf0468abddaf5251f8ea8
MD5 153aa4faf016852b06778389469c0ab3
BLAKE2b-256 3b8209f52f2ab5ba426145ec5ab0260f669f6d0a3701235292bfd294397092be

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad6aafbc59bd5c1f9cb47f452b4e7b60fd7a2b98bcf681b7a7b3c3ac1bf47a90
MD5 32cff5bbcaafc3929f556f67ae58675b
BLAKE2b-256 fd82e6fb3cc859bd25aea6de00be7443cfb1a193b73705882f1ea56b7ec5a31b

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0da27789838bd978e95fed7644181cabff17e21bea588dda81c5123e85030601
MD5 1a6cbc026198ece076ee52a5fb929b73
BLAKE2b-256 9a4ac5f816673d02ab9c450248208a06780fb3a4b898035ed9f5b045eda0cd0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp310-cp310-win_amd64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e3c60b39828d9628e25eeb673dbe508a79bf9ca3858f178d82b7191f885d14b6
MD5 13c3021156cfcc74a88fbc4316b5b758
BLAKE2b-256 8bf8fa9a9f981ebb15b18f3d60d8fc9a47dae8dadf2ce8909eb149bb27e9663d

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0766864e2c2adda2c3f4dfc5151df96d058654d32ff1847d7b8f54fd4479045
MD5 e1755d78e090bcf9584060261109ffd9
BLAKE2b-256 94d64d8709cf9d7b7c23fc1dfbd059f19987ccda7bbfad5d03c9d6681e4a00eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: spectrofast-0.3.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for spectrofast-0.3.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 228421617aec3b3a0f063b26c3357e73e3330a1842b3dc3c19f0449b0c6027fd
MD5 dcdcb56c6741178dc74a32b272b67d64
BLAKE2b-256 e9aa5b1c8523926172ab2d9b4476dd26f1793164b910b1ff26cf8582a492fa26

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp39-cp39-win_amd64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ec3817020328d29474c64001d95199f8deab884a8ea7999934ed1dd388584161
MD5 fc90cbafaa30c28d7b91dec64761982d
BLAKE2b-256 7bf8aae0822f9cc93d73c005c0c0b4b5abc451ff656095a01bbb1d73a896fb96

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectrofast-0.3.2-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3304dc96c4fe03cda7ed30a117b2c0fb58499d2e651b684b1f290eba460cc73e
MD5 578aa910f6feee350b29e6b4cab47e80
BLAKE2b-256 305d62e927587fbe8faa22d444dbef82efa1724644b9eea77a12086f1556aa37

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.2-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: build.yml on Europium-152/spectro-fast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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