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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

spectrofast-0.2.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.2.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.2.0.tar.gz.

File metadata

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

File hashes

Hashes for spectrofast-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6aa16ba41cdadd23a2f86f768f30b8c063c0ee52aaf4273d0d4165fcc424a8f0
MD5 cd6042b81e447beae38a9fa3ca281bd1
BLAKE2b-256 efce10be5d03dfaa338d25b550844075ed7cd9a3c8238a6d99b2e19297d8258e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2828ee2b6025916686fb05b8c3a228ed61af1175e1cdf91e249ec981c7e72e2d
MD5 cce36f553a4d5a657d0a0d31a136998a
BLAKE2b-256 fee36255814cfa99b67aaf30118337efd9c605fdc1060a80ee7e3ce3321965b9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e404d7f654d3b5c824757bf6c9597b9476dbe8cb0a1593cb61758c56c2498a02
MD5 c67392a0cb511c4c40ddc8ff0ab1b5d9
BLAKE2b-256 d2d479b6aad8ad1d13374cdeb63a3a50cc524a47d222828c4c2ba9e6704cf642

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44823b91f3441a41ff29e17ca4f43fbd3a1dafa6c034a83d69bcd7dc7a5ee233
MD5 0146c5b61d5d6513052e7151510f94fa
BLAKE2b-256 2fbec88da82427ce2962934309ba49a0f4f5c480bc060fbf2d891b8265b888b0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 41bdab3dca625831f870756d57ff5d2032a44e1dce35abac11ed99653580b626
MD5 67909995843b44479fe430192ff27de7
BLAKE2b-256 c29fdf75970b39689014280e839c57f6ed24a3d10dfc20074068ff498b321ba4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b582cb02ec0e47c31629e176ce07d0920726b3e2b8d2d45741563ca98370107d
MD5 f41067484e4b261434306f677515a92c
BLAKE2b-256 24faf8efbff6b88cbd72ad3ec940dd4bfae5f36df0159e4ecfe4d2121529bfd1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 69602e1cb816a20416a430e5152bc610ff886ba5984ec6b20c08be3e98796a76
MD5 b3ad2ee090ee771a32de4656c1103872
BLAKE2b-256 7532d4fcc5c72ffe8e4943a02b31756ea7b890b305fa05db61552358200f6772

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5ca10f99458556c8ea65342f254208847709bdb4951ecc2f90e624f4b876b7e5
MD5 c6550788e237c4923a3f0ce6424be74c
BLAKE2b-256 47d04c1571349f406a6566ee3c1e5854f0e0ae369cafdbbdad2418336b44244d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3fb429b688358d7e0e83bfe2fe12fe898951d2726d6174b5b6f939b6e05744f
MD5 9c253c173b6e939177bdcb469232f160
BLAKE2b-256 dd8b2c5b9e9605143c0297780cfd8a4319dfabb2d4105040e8634a8a085e4955

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 62e11817fcfe6aba89cea5ee9c6d11e5e8af4d450bb43140b6b318b77d77d56e
MD5 92d2e4e256b872e1435d7f1cd24fa821
BLAKE2b-256 376aa05ce9eb2fb97f5ecc1531b9b8999f9edaa5a4fcc42faf1f4dc747dc3866

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5fbd165e1159d0c93a7cbf5d96fd25d1b5301cf6e6232467d17fbf47c7fc209d
MD5 544a357bac6a3d8904197f167a82f670
BLAKE2b-256 64e584b158396d70f624101d45aca90482f2c683552f74ff43a14409d7878100

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 060f97bf245b651e969627c3c481b7e83f21b44c1528ed4faf222bfb36867301
MD5 653b557025e3e3c35ee1f2cc2e510208
BLAKE2b-256 d8d290b479a31412396fa64b507ad778d27176e2da955fd2e393660654210613

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e5a465feb92213acb32e53f4448ad14b15ec64dd4b4625391c1677d93e4ad339
MD5 5b4d13793f069d40f1a3d6fc091cd6c1
BLAKE2b-256 5e6fcfde7ab9841d8abf49bb904e1481c339d45ef3a957bdfd100175c01a8d27

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: spectrofast-0.2.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.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a39c307ce99aceda47ecefb0f653be88a68cf1afc742a199719af222143666a3
MD5 39834aa6165694668c82fe9c8f8020fd
BLAKE2b-256 73b8a2d1b580000b668f6ce811018ac0d8dcb0761c5875c8eed7a18457acd2ad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d68adb9e1201287ca5be53ca88d4c3d73d709e8d3c46f6daf3a0097e20481aa
MD5 fd8481cc1b333301bbf49216acf39a48
BLAKE2b-256 ebad410f793e4e9e6823fdfaef15ee39df8bb39bf04cf7fb78ca2df0af527b25

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for spectrofast-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bab4492b52521647ce34f935735e670f7d255276ee549a208d97bd53e9e5f976
MD5 929bfc651eb3ceb09ce9d05526c351ca
BLAKE2b-256 43217057a784468edee3d7a12b505189ed76460a80f7d448573d597b2c2903ce

See more details on using hashes here.

Provenance

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