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.1.0.tar.gz (986.7 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.1.0-cp313-cp313-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

spectrofast-0.1.0-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.1.0-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.1.0.tar.gz.

File metadata

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

File hashes

Hashes for spectrofast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8d3f2e77288d9dcc495e77b7db71d79be9ddca2711d8e1dda9fa89d2b82407ea
MD5 bcd5b23a0f01f8ca9569b076345fa6e4
BLAKE2b-256 dae945b7c683f8e7fbea29ef7a9a220ad37b44d61681d79d0a0b73cc4dde33e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dd8f7bf8730e71818cf99cb36c6f0f8123e9e5285e5d99be16b24c292f766c91
MD5 78f562f59fab25f3b8b717844acc8507
BLAKE2b-256 aae284d483cac9e2b909da3d057271f0716bc4373c6779c89e5fee966f83d8a0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a62e25960dc02bdfa99f3e222e132a08cef9988294ec6cf6fd9abd158f29b61
MD5 57efa53acd6280b838e843af2a69d008
BLAKE2b-256 0d3fc156eaa8517a8cfe89d996638a9b1455aeebf2533200925d76b66a1fec7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ef6ba66fa892ea0bfcfafd3306784cf3f5cc46126e4e8cf3a759adcf4387ae3
MD5 9eb6ec1b2745703f4acd94b8ee670996
BLAKE2b-256 8f9a8a57301c4b5d2b3567f0fb2763cf9c0d5b20463c4ae3683b8b7367bd5783

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cedd2f2a8b260aa7f315355235e9a6e4e195ebb6ab83a102dbd26eff44a55fde
MD5 fa52d57ddccc8633ff174d5cda510c0e
BLAKE2b-256 35e8e879de5b3c6f6d1f1b0a5cc385c444cefc008251f03f6885e628a67e0679

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7d7c34416a53f9468e8012f4d1ab222112141df4e7dc748aad3668f207034543
MD5 dd6f2cc0afceae135c6cb95bb928d345
BLAKE2b-256 5f7a2dc3f94bcd3066740cbc7f34f14c015858d90473b7c3172cbc1d3485d80e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc6a91ac9353cff471b07c23df3a8a2181f30fa8c9b55ff8d4db7f2d0708ef1a
MD5 042dab042bf0fcea4740daab97496925
BLAKE2b-256 7feaba7212b257e92cd8271bd403205b91d6774fa770611ae49d181a23271195

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fd0f8c4639cbaef3c619afd946e2a702fc8c6596355aac9619b9a584aa427a4f
MD5 c387d8d9d462c7eb9a3fa39f01e575dd
BLAKE2b-256 febd1f36c421f47032537a2e7eab2d9290441891de53e6fb5158161d19c0c5e9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9d6001ff160ffdbc12b284bdde7302b2caabefdd6dc8c947900e60612465117f
MD5 4a83faa41617cb1fc5eac094e7ae77e1
BLAKE2b-256 2b21728a31c7b6c901001a1ae618d014ec99ce1f2685ace88744f1899e0ba8b9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3df50404e6a9ab0db07c671fbdad5c5c48ca6397ef48885a61a2c6a6ac0ecc6a
MD5 05e1cf425af876e9792a92eca3965aae
BLAKE2b-256 953edacc56eebdf1c952e9361c04033819a1678203eecb3f6cfc6d98457a9aaa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 357bc86079a106c22a420e335eaa032cb2658ca56b0b54e5b644b93b3b55c767
MD5 c3ae4c26e6cc59b09e997cd5491fabb4
BLAKE2b-256 8af832af4bdb3dccc0c16471800c6032b644d01cd7a01882c90cbff77ff50094

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da4b79627159704640dd024ddf2ae43b39447f6e3ba002f23f8894817efbd0fd
MD5 cec3ea6e34264ff0f2d380a1c43a7713
BLAKE2b-256 e0c717b17a5b57f65d090bb60d92181ace81d40504a4666ee1a1b3b1f9e6026d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dedd76bea4937553118183e51a7e60a1131aaa43726067745ca2093ffa16ac4c
MD5 94eedea8e014d1b9ac545d3ecad7123e
BLAKE2b-256 17bc6ac2f3dd511d3333e4c2240331c82bc6d69973ad1fee2b60fa593fc2f462

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: spectrofast-0.1.0-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.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 40394e3d80fe84f84077e5e3ed6a093dfc4d2cc363b1638493a51da900e5747e
MD5 c590824d6f27f9a43a3aec67c151d0ff
BLAKE2b-256 67b411474430d140fdcc75d929a8f4337b59a9e7c97e5c293a4fded0972d2efe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 346fd7dac622e1699c9a1a96e3ffed71d75db779f69e4c0ad0201bc57727b903
MD5 63433a81c9c7836b4f83dfd6668adfc7
BLAKE2b-256 5cd6fed22253827242ef713dcc4a3ec38492d15b8f408f9179f5daa689aed508

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a0455cc211258b34addb3d2ccbae3cb0d4be48dceabc47eb2ed3d7b3970e1b1a
MD5 ae9e914a211bde38048599d7cc524994
BLAKE2b-256 57bde9395c2cb81fc9eeb29f64942184772eef20597df66f55e06cb488d18847

See more details on using hashes here.

Provenance

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