intvert.select_coeffs_2D

select_coeffs_2D(M, N, Ls=[])

Selects a set of DFT coefficient frequencies.

Constructs a dictionary mapping divisors of M and N to sets of equivalent DFT coefficient frequencies for an (M,N) integer matrix. The pair of divisors (d1, d2) is mapped to a set of frozensets of DFT frequencies. Each frozenset contains equivalent frequencies pairs (k, l) where the greatest common divisor of k with M is d1 and the greatest common divisor of l with N is d2. The number of frequencies in each frozen set is determined by Ls. If Ls is an integer, the number of frequencies in set of frequencies will be at most Ls. If Ls is a list, Ls[i] is the maximum number of frequencies in selected[d1, d2] if (d1, d2) generates a cyclic subgroup at the i’th level of the cyclic subgroup lattice of \(\mathbb{Z}_M\times\mathbb{Z}_N\).

Parameters:
  • M (int) – First dimension of the integer signal.

  • N (int) – Second dimension of the integer signal.

  • Ls (int or list, optional) – Number of coefficients to include for each class, by default []

Returns:

selected – Dictionary of selected coefficients.

Return type:

Dict[Tuple[int, int], Set[FrozenSet[Tuple[int, int]]]]

See also

get_coeff_classes_2D

structure of full DFT coefficient equivalence classes

sample_2D

use the selected coefficients to sample an integer matrix

select_coeffs_1D

analogous 1D function

Examples

By default, get 1 element of each coefficient class:

>>> intvert.select_coeffs_2D(2, 10)
{(2, 10): {frozenset({(0, 0)})}, (2, 1): {frozenset({(0, 1)})}, (2, 2): {frozenset({(0, 2)})}, (2, 5): {frozenset({(0, 5)})}, (1, 10): {frozenset({(1, 0)})}, (1, 1): {frozenset({(1, 1)})}, (1, 2): {frozenset({(1, 2)})}, (1, 5): {frozenset({(1, 5)})}}

If Ls is an integer, there are up to Ls generators in every lattice class:

>>> intvert.select_coeffs_2D(2, 10, 2)
{(2, 10): {frozenset({(0, 0)})}, (2, 1): {frozenset({(0, 1), (0, 3)})}, (2, 2): {frozenset({(0, 2), (0, 4)})}, (2, 5): {frozenset({(0, 5)})}, (1, 10): {frozenset({(1, 0)})}, (1, 1): {frozenset({(1, 1), (1, 3)})}, (1, 2): {frozenset({(1, 2), (1, 4)})}, (1, 5): {frozenset({(1, 5)})}}

This is realized for the classes generated by (0, 1), (0, 2), (1, 1), and (1, 2). However, there is only one generator (accounting for real DFT symmetry) for the other classes.

If Ls is a list of length 1, all classes on the top level of the lattice may have up to two generators:

>>> intvert.select_coeffs_2D(2, 10, [2])
{(2, 10): {frozenset({(0, 0)})}, (2, 1): {frozenset({(0, 1), (0, 3)})}, (2, 2): {frozenset({(0, 2)})}, (2, 5): {frozenset({(0, 5)})}, (1, 10): {frozenset({(1, 0)})}, (1, 1): {frozenset({(1, 1), (1, 3)})}, (1, 2): {frozenset({(1, 2), (1, 4)})}, (1, 5): {frozenset({(1, 5)})}}