Skip to main content

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 with pip.

pip install intvert

References

[LLL]

Lenstra, A.K., Lenstra, H.W. & Lovász, L. Factoring polynomials with rational coefficients. Math. Ann. 261, 515–534 (1982). https://doi.org/10.1007/BF01457454

[LV]

TODO

[PC]
  1. -C. Pei and K. -W. Chang, “Binary Signal Perfect Recovery From Partial DFT Coefficients,” in IEEE Transactions on Signal Processing, vol. 70, pp. 3848-3861, 2022, doi: 10.1109/TSP.2022.3190615.

Requirements

intvert relies on the following Python packages:
  • numpy for fast array operations

  • gmpy2 for multiple precision floating point operations

  • fpylll for implementations of the LLL lattice basis reduction algorithm

  • sympy for integer factorization

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

intvert-0.0.1.post2.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

intvert-0.0.1.post2-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file intvert-0.0.1.post2.tar.gz.

File metadata

  • Download URL: intvert-0.0.1.post2.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.14

File hashes

Hashes for intvert-0.0.1.post2.tar.gz
Algorithm Hash digest
SHA256 567af7531aa61d522a7a475951e3d2f8a354be627cad856796fe6a5bff601f34
MD5 a0f5679e2239f2103ff2f12176279f77
BLAKE2b-256 eb9c6152e1677f76e229292131df7a7a2dc3918fd8da9994ec690d4b10a64b84

See more details on using hashes here.

File details

Details for the file intvert-0.0.1.post2-py3-none-any.whl.

File metadata

  • Download URL: intvert-0.0.1.post2-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.14

File hashes

Hashes for intvert-0.0.1.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 74cdda0e7ab9aa2d587a3823d0f85a89e4e1c4e8fb48bad3aecbaa17133a86a4
MD5 62288133dc5ada2ea9d0467e2d4a1f5d
BLAKE2b-256 61375a60a795a7d4b5ab7c06e9aa26d9bf9a7eac12c4dd89d2c4bed8280ed6b1

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