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.3.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.3-cp313-cp313-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.13Windows x86-64

spectrofast-0.3.3-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.3-cp313-cp313-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

spectrofast-0.3.3-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.3-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

spectrofast-0.3.3-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.3-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

spectrofast-0.3.3-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.3-cp310-cp310-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

spectrofast-0.3.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: spectrofast-0.3.3.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.3.tar.gz
Algorithm Hash digest
SHA256 c84a1b48b46c812dac7d2fe4f4ad9aa0583e46b62c9818de8c1521e130c5903b
MD5 d5a8967b9a2e15d6980721d195c893ff
BLAKE2b-256 32664a1e84d835750d6851a857306ff48d634f5803758526dcb5f72bebc2e281

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3.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.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f6d68b65db496ee8d02d598c6560bcf50f931d7b2d14866bc4ccd452bbb659e7
MD5 0460c8f93c67e9243afde3b0b6d5ec6b
BLAKE2b-256 d2ba776ec63b3785f59af25e265ef323de1c06fa51824ebc68220dc1fca448ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca82894d167302490e156789606372a210984d04d66d8a8c73b638b8efda60d4
MD5 3cd4ac1cb5193a0700bbe9f3176c13bc
BLAKE2b-256 39e26424bdfc4a2f7a401e1129c5883e18c9cf8eeb2d0ab4cd4810fa03a93041

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 501248471cf1263384ead9e8e0acdd4310d293e45736b1c4f641b569645f1946
MD5 e6251f029500129dbd080f5a48b9ea71
BLAKE2b-256 d18f5014e823f72a1246909728a815cc67fc332f376f72404a96738425f1de90

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 911c398a1640258e073ad8f3d8d8df73d8b56fef0670915b5a237701608eedb2
MD5 f300c216ea3d1d73b6858a69a6444aff
BLAKE2b-256 5defc2ac5fd9fea3cb9a2d5169bfa451bdae2a9bdede4b8629354fe821e74f29

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6bb52f7f5b72999931f1cf5755e0187e21efab9d151387c5c98765a626f2e89a
MD5 c1f864794a671e22c3e9c5f73f420379
BLAKE2b-256 4d7bd533b1ce69b35b5831a6d55fa7aefd2a699bc2f7f8c5b532a10b6957e438

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9fecee5f2913aefe48ca52519252ecff35e3798a72d2d91ccae5f9fad05e259f
MD5 6ebd2488d5fea81de26e584cfbb7340f
BLAKE2b-256 7120ca37a38643f47e6044a4fcb5181886266f3bb7ae9b0260995814a646de4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0ab6ff708e5f7e5285bfebd539402721a49d52a95ee048b0b0618761bc344445
MD5 0e3bb767cca0c6c410576a81bef361ad
BLAKE2b-256 bb193b663e8ca16b7e0e6e14a9d2f2c117eeff68f3c1529c7e9e815f88390889

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef6c6780464ce0c5ad53498d698ff4921fe48641b29b6fff1afe6b254a89766e
MD5 46c6576319bf74c5856131182f6af1c5
BLAKE2b-256 a0aa4e10900d745f140512336b14f0cd0f1b3589cc18dbbf20c7a7b5fad91c59

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 618a029f57b05bac4781dabe3dd4351ac17f16b5967c3219bb150a66901ac8f9
MD5 3351ad8aad67d333914c844eb61b2def
BLAKE2b-256 7eae50979f3e1da2db32c8bf3b09a2b197f3101426dcdaeb2dae2146d0e16922

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8408f8e02062a01b1e529bac5b10e94ad92d79c0c4d920d585078df679ddc6ec
MD5 c0424a5b975d9e3c34245b8013016050
BLAKE2b-256 05f928c8ed64f6025b7786ee403687fb98c58c6349800cd5a61b744afb20e1d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02c064105eb3d66bbc38bbcfcff92cc630c4093caa458d8422ee99eecdff03b6
MD5 96f019cc81dfb9902447463be7767b25
BLAKE2b-256 41f99815b65f64bca0cf0ab295e563e94d9d5bebb1c3e42b25f685962b19b718

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80c42511af8cb26216d44f692f476ee23641163e0fd5ad6a885eb1c1626d31c6
MD5 7fdee586b9f108eec31a33b1dee89905
BLAKE2b-256 4306f8899df5224563c4becaebbacea84f3b812adb482067a1b7ad9e74ea3558

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: spectrofast-0.3.3-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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ffb1fc6147354f843c30aa0354393d14eb86344b95753dd393bfb5ec1f983b31
MD5 e6c1811cd5cb2fbf0cb0cdec2aca48ad
BLAKE2b-256 0124238f69055f708c3acd7ee14682366a72522b148246e19107ca5933e948db

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d66bbf4a9e16d1e3a40f63f23983779030ecf0e3baa594259f1cda9f6c0ab8f7
MD5 014c8d675d507eb5fe32581fbd4a8f55
BLAKE2b-256 6ee98a53cfd1bb91bc55e6ca6fd2e0185ea161173111b67a6d2e0efd90f199d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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.3-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spectrofast-0.3.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9fa27df1f7c466413cfad650f2265ac56de40b841c951e27bf589adda19ee632
MD5 c21bb6706f3e5cae34680f26811b37fa
BLAKE2b-256 4cb88620f8c57b64e0c58f5e92d7f8d703b74b7c37d0e008ae2703e06e5deb19

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectrofast-0.3.3-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