Skip to main content

pygabor : Gabor transform toolbox for Python

Contains the following modules for performing time-frequency analysis on discrete signals:

timecausgabor.py: Primitives for computing the time-causal analogue of the Gabor transform

The time-causal analogue of the Gabor transform is obtained by choosing the temporal window function in a time-frequency analysis as the time-causal limit kernel, which provides a theoretically well-founded way to define a time-frequency analysis over a time-causal temporal domain, for which the future cannot be accessed.

Notably, while the current code is written for offline experiments, the underlying approach is fully time-causal and time-recursive, and should therefore be highly suitable for real-time applications.

For examples of how to apply these functions for computing time-causal time-frequency transforms, please see the enclosed Jupyter notebook timecausgabordemo.ipynb.

For more technical descriptions about the respective functions, please see the documentation strings for the respective functions in the source code in timecausgabor.py.

discgabor.py: Primitives for computing the discrete analogue of the Gabor transform

The discrete analogue of the Gabor transform is obtained by choosing the temporal window function in a time-frequency analysis as the discrete analogue of the Gaussian kernel, which provides a theoretically well-founded way to discretize the continuous Gaussian kernel in such a way that the underlying theoretical properties, that make the Gaussian kernel a canonical choice over a non-causal temporal domain, do also hold after the discretization

For reference purpose, this package also provides a possibility to choose the temporal window function as the sampled Gaussian kernel, which may otherwise constitute the most commonly used choice for discretizing the continuous Gaussian kernel

For examples of how to apply these functions for computing non-causal time-frequency transforms, please see the enclosed Jupyter notebook discgabordemo.ipynb.

For more technical descriptions about the respective functions, please see the documentation strings for the respective functions in the source code in discgabor.py.

spectrogram.py: Functions for computing spectrograms based on the above time-frequency analysis methods

Computes combined spectrograms, by applying either the time-causal analogue of the Gabor transform or the discrete analogue of the Gabor transform over a set of logarithmically distributed frequencies.

The current focus of the code is with regard to auditory spectrograms. With minor modifications, the approach is, however, also applicable to computing spectrograms for other application domains.

For examples of how to use these functions for computing different types of time-causal or non-causal spectrograms, please see the enclosed Jupyter notebook spectrogramdemo.ipynb.

For more technical descriptions about the respective functions, please see the documentation strings for the respective functions in the source code in spectrogram.py.

Installation:

This package is available through pip and can installed by

pip install pygabor

This package can also be downloaded directly from GitHub:

git clone git@github.com:tonylindeberg/pygabor.git

Dependencies:

This package depends on the pyscsp and pytempscsp packages, for performing the temporal smoothing in the time-frequency transforms.

The pyscsp and pytempscsp packages are available at PyPi and at GitHub:

pip install pyscsp
git clone git@github.com:tonylindeberg/pyscsp.git
pip install pytempscsp
git clone git@github.com:tonylindeberg/pytempscsp.git

References:

Lindeberg (2025) "A time-causal and time-recursive analogue of the Gabor transform", IEEE Transactions on Information Theory, 71(2): 1450-1480. (OpenAccess) (Defines and describes the time-causal analogue of the Gabor transform, based on using the time-causal limit kernel as the temporal window function for performing time-frequency analysis. A discrete analogue of the Gabor transform is also defined, by discretizing the continuous Gaussian kernel in the regular Gabor transform using the discrete analogue of the Gaussian kernel.)

Lindeberg (2023) "A time-causal and time-recursive scale-covariant scale-space representation of temporal signals and past time", Biological Cybernetics, 117(1-2): 21-59. (Open Access) (Contains an extensive treatment of the time-causal limit kernel, with its relation to defining a temporal scale-space representation at multiple temporal scales, over a time-causal temporal domain.)

Lindeberg (2023) "Discrete approximations of Gaussian smoothing and Gaussian derivatives", Journal of Mathematical Imaging and Vision, 66(5): 759-800. (Open Access) (Contains an extensive treatment of the topic of discretizing the continuous Gaussian kernel over a non-causal discrete domain.)

Lindeberg (1990) "Scale space for discrete signals", IEEE Transactions on Pattern Analysis and Machine Intelligence 12(3): 234--254. (Preprint) (Contains the original definition of the discrete analogue of the Gaussian kernel, which constitutes a canonical choice to discretize the continuous Gaussian kernel over a non-causal discrete domain, in such a way that the properties that make the continuous Gaussian kernel special over a continuous domain do also hold after the discretization.)

Metadata

Release files for pygabor 0.9.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygabor 0.9.7
File Size Uploaded Provenance Actions
pygabor-0.9.7.tar.gz 10.2 kB Without provenance Details for pygabor-0.9.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygabor 0.9.7
File Interpreter ABI Platform Actions
pygabor-0.9.7-py3-none-any.whl Python 3 none any Details for pygabor-0.9.7-py3-none-any.whl

Total release size: 20.9 kB

Release files / pygabor-0.9.7.tar.gz

Download URL pygabor-0.9.7.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e0a7a09a39187e24190b0e5558ef3ffb8b344200e62a159b3777f0cc93ee7cda
BLAKE2b-256 checksum
How to use checksums
e5cba5fb33c216768551e151415e3276667f8a24b50ace8bb4514aaccaa3109b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.5 Darwin/23.6.0

Release files / pygabor-0.9.7-py3-none-any.whl

Download URL pygabor-0.9.7-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acba86106642851849da3ca3b2cfb7780c42e58d9b78070e5b4b0e5907d0f426
BLAKE2b-256 checksum
How to use checksums
e3e204385d1130d36a13f8eee8081ad914c37df5f8d56fa0a70ff5d0fbc507eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.5 Darwin/23.6.0

Security for pygabor 0.9.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page