A package for inversion of integer signals from sampled DFT coefficients.
Project description
intvert is a pure Python package for inversion of 1D and 2D integer arrays from partial DFT samples. This package contains the codebase for the paper [LV]. See the full documentation here.
Examples
An example usage of the sampling and inversion procedures in 2D for a large binary matrix.
>>> import intvert
>>> import numpy as np
>>> import gmpy2
>>>
>>> gen = np.random.default_rng(0)
>>> signal = gen.integers(0, 2, (30, 40)) # generate random binary matrix signal
>>> signal
array([[1, 1, 1, ..., 0, 0, 0],
[0, 0, 0, ..., 1, 1, 0],
[1, 1, 0, ..., 0, 1, 0],
...,
[0, 1, 0, ..., 1, 1, 1],
[1, 1, 1, ..., 0, 0, 1],
[1, 1, 1, ..., 1, 1, 0]], shape=(30, 40))
>>> with gmpy2.get_context() as c: # perform sampling and inversion with increased precision
... c.precision = 100
... sampled = intvert.sample_2D(signal)
... inverted = intvert.invert_2D(signal, beta2=1e20)
...
>>> inverted
array([[1, 1, 1, ..., 0, 0, 0],
[0, 0, 0, ..., 1, 1, 0],
[1, 1, 0, ..., 0, 1, 0],
...,
[0, 1, 0, ..., 1, 1, 1],
[1, 1, 1, ..., 0, 0, 1],
[1, 1, 1, ..., 1, 1, 0]], shape=(30, 40))
>>> np.allclose(signal, inverted) # inverted signal matches signal
True
Installation
intvert may be installed from PyPI with pip.
pip install intvert
References
Arjen K. Lenstra, Hendrik W. Lenstra, and László Lovász. Factoring polynomials with rational coefficients. Mathematische Annalen, 261(4):515–534, December 1982. ISSN 1432-1807. doi: 10.1007/bf01457454. URL: http://dx.doi.org/10.1007/BF01457454.
Howard W. Levinson and Isaac Viviano. Recovery of integer images from limited dft measurements with lattice methods, 2025. URL: https://arxiv.org/abs/2510.11949.
Soo-Chang Pei and Kuo-Wei Chang. Binary signal perfect recovery from partial dft coefficients. IEEE Transactions on Signal Processing, 70:3848–3861, 2022. doi: 10.1109/TSP.2022.3190615. URL: http://dx.doi.org/10.1109/TSP.2022.3190615.
Requirements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file intvert-0.1.0.tar.gz.
File metadata
- Download URL: intvert-0.1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e123243a3646abf61a41de614d0d5f3295f98d27ea356160156b68a607ba8df
|
|
| MD5 |
f14914f25ff3e894d63b645f2e592e58
|
|
| BLAKE2b-256 |
c77cce396b0ceb37cfa5274ed14d74f9ba6b31660413c620fbf662d92ff5ca0f
|
File details
Details for the file intvert-0.1.0-py3-none-any.whl.
File metadata
- Download URL: intvert-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b08c7eb36ec61c24539a2831950a4537f5e084326b3c4a1156afa81c4733b94
|
|
| MD5 |
54d02a80362b37b2776921cf4ea39122
|
|
| BLAKE2b-256 |
dd8355d92aac5ae845215aeda596af7f1b2af598d5174b64b6f7e1cbf74a0ac1
|