Skip to main content

Gabor transform toolbox for Python.

Project description

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.)

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

pygabor-0.9.7.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

pygabor-0.9.7-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file pygabor-0.9.7.tar.gz.

File metadata

  • Download URL: pygabor-0.9.7.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.6.0

File hashes

Hashes for pygabor-0.9.7.tar.gz
Algorithm Hash digest
SHA256 e0a7a09a39187e24190b0e5558ef3ffb8b344200e62a159b3777f0cc93ee7cda
MD5 5fd41a6830d98b5229c840c3b52104af
BLAKE2b-256 e5cba5fb33c216768551e151415e3276667f8a24b50ace8bb4514aaccaa3109b

See more details on using hashes here.

File details

Details for the file pygabor-0.9.7-py3-none-any.whl.

File metadata

  • Download URL: pygabor-0.9.7-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.6.0

File hashes

Hashes for pygabor-0.9.7-py3-none-any.whl
Algorithm Hash digest
SHA256 acba86106642851849da3ca3b2cfb7780c42e58d9b78070e5b4b0e5907d0f426
MD5 5c5092e8e5a363da22ab6eeaf13f0453
BLAKE2b-256 e3e204385d1130d36a13f8eee8081ad914c37df5f8d56fa0a70ff5d0fbc507eb

See more details on using hashes here.

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