Skip to main content

Time Frequency Spectrogram Inversion

Project description

tifresi: Time Frequency Spectrogram Inversion

'tifresi' to be pronounced 'tifreeezy' provide a simple implementation of TF and spectrogam suitable for inversion, i.e. with a high quality phase recovery. The phase recovery algorithm used is PGHI (phase gradient heap integration).


This repository use the ltfatpy packages that requires a few libraries to be installed. The package relies on some library that have to be installed beforehands.

  1. Install fftw3, lapack and cmake
    • On debian based unix system:
    sudo apt-get install libfftw3-dev liblapack-dev cmake
    • On MacOS X using homebrew:
    brew install fftw lapack cmake
    • On MacOS X using port:
    sudo port install fftw-3 fftw-3-single lapack cmake
  2. Install cython (required for installing ltfatpy):
    pip install cython
  3. Install the package from pypi
    pip install tifresi

or from source git clone cd tifresi pip install .


After installation of the requirements, you can check the following notebooks:

  • demo.ipynb illustrates how to construct a spectrogram and invert it.
  • demo-mel.ipynb illustrates how to compute a mel spectrogram with the setting used in this repository.

License & citation

The content of this repository is released under the terms of the MIT license. Please consider citing our papers if you use it.

  title={Adversarial Generation of Time-Frequency Features with application in audio synthesis},
  author={Marafioti, Andr{\'e}s and Perraudin, Nathana{\"e}l and Holighaus, Nicki and Majdak, Piotr},
  booktitle={International Conference on Machine Learning},
  title={A noniterative method for reconstruction of phase from STFT magnitude},
  author={Pr{\uu}{\v{s}}a, Zden{\v{e}}k and Balazs, Peter and S{\o}ndergaard, Peter Lempel},
  journal={IEEE/ACM Transactions on Audio, Speech, and Language Processing},


As a developer, you can test the package using pytest:

pip install pytest

Then run tests using

pytest tifresi

You can also use the source code checker flake8:

pip install flake8

Then run tests using

flake8 .


  • Improve doc
  • Put the documentation on readthedoc or somthing similar

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tifresi, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size tifresi-0.1.4-py3-none-any.whl (19.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size tifresi-0.1.4.tar.gz (15.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page