Error-correction Decoding for 2D Convolutional Codes with a Generalized Viterbi Algorithm
Zita Abreu, Elisa Junghans, Julia Lieb, Raquel Pinto
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.
Two-dimensional (2D) convolutional codes are a generalization of one-dimensional (1D) convolutional codes and are naturally suitable for encoding two-dimensional data. Although their theoretical properties are well established, practical applications are limited due to the lack of error-correction decoding algorithms. While the Viterbi algorithm provides an efficient decoding method for 1D convolutional codes, no analogous approach exists for the 2D case. In this paper, we introduce a decoding algorithm for 2D convolutional codes, called the 2D Viterbi algorithm, extending the principles of the classical Viterbi algorithm to the two-dimensional setting. The presented 2D Viterbi algorithm works with linear systems representations of 2D convolutional codes and its complexity depends on the dimension of the corresponding 2D linear system. Hence, we also provide several algorithms to obtain 2D realizations of small dimension.
KeyWords: 2D convolutional code, error-correction decoding, Viterbi algorithm, linear systems representation for 2D convolutional codes, local reachability, local observability
1 Introduction
Two-dimensional (2D) convolutional codes are a natural generalization of convolutional codes, to which we will refer in this paper as one-dimensional (1D) convolutional codes.
2D convolutional codes deal with data represented by two-dimensional sequences and therefore are naturally fitting to deal with two-dimensional information, like pictures, data storage, etc.
The theory of 2D convolutional codes is very well understood and has been investigated by many authors in the last years. These codes have been introduced in [FV94, VF94]. In these papers the algebraic properties of 2D convolutional codes are studied in detail. In [CNPP12], the authors investigated the distance properties of 2D convolutional codes of rate 1/n and obtained an upper bound (called the 2D generalized Singleton bound) for these codes and presented constructions of 2D convolutional codes with optimal distance. In [CNPP16], the authors generalized these concepts and results for 2D convolutional codes of any rate and presented constructions of such codes for certain parameters. In [ANP15], further constructions were presented for a more general set of parameters. Input-state-output representations of 2D systems were studied in [NPP10].
Even though the theory of 2D convolutional codes is very well developed, these codes are not used in practical applications. One of the main reasons is that there exists no decoding algorithm for error-correction with these codes. In [CNPSo16] and in [LP23], decoding algorithms for 2D convolutional codes were presented for an erasure channel, i.e., for a channel in which a symbol arrives correctly or does not arrive at all. However, when we consider channels in which errors occur, there is no procedure to detect and correct errors that appear during the transmission of the information.
The most famous error-correction decoding algorithm for 1D convolutional codes is the Viterbi algorithm. This algorithm decodes a received word after channel transmission by considering all codewords of the code up to a certain length and then selecting the codeword which is closest to the received word. This algorithm applies techniques from dynamic programming to the linear systems representation of the convolutional code. In this paper we define a similar error-correction decoding algorithm for 2D convolutional codes, which we will call the 2D Viterbi algorithm. The computational complexity of this algorithm depends on the dimension of the underlying 2D linear system. Finding a realization for a 2D encoder of minimal dimension is a challenging open problem. However, in this paper, we provide several strategies to obtain 2D realizations of small dimensions.
The paper is organized as follows. Section 2 presents the basic background on 2D convolutional codes including system representations of 2D convolutional codes. In Section 3, we introduce a decoding method for 2D convolutional codes, called the 2D Viterbi algorithm, which extends the ideas of the classical Viterbi algorithm to the two-dimensional case. In Section 4, we analyze the complexity of the 2D Viterbi algorithm and discuss ways to obtain an encoder realization of small dimension in order to decrease this decoding complexity.
2 Two-dimensional convolutional codes
We denote by F any finite field. Two-dimensional convolutional codes deal with data represented by a two-dimensional (2D) compact support sequence
w:N02(i,j)→Fn↦wij.
Such 2D sequences can be written as polynomials in the two indeterminates z1 and z2,
w(z1,z2)=(i,j)∈N02∑wijz1iz2j
with wij∈F. Let us denote by F[z1,z2] the ring of polynomials in z1 and z2.
Definition 2.1. A two-dimensional (2D) (n,k) convolutional code C is a free F[z1,z2]-submodule of F[z1,z2]n of rank k. A matrix G(z1,z2)∈F[z1,z2]n×k whose columns form a basis of C is called an encoder of C and it follows that
Given a polynomial matrix G(z1,z2)∈F[z1,z2]n×k we define the i-th column degree of G(z1,z2) as the maximum degree of the entries of the i-th column of G(z1,z2) where the (total) degree of a polynomial in two indeterminates p(z1,z2)=∑(i,j)∈N02pijz1iz2j, with
pij∈F is defined as usual as deg(p(z1,z2))=max{i+j:pij=0}.
A unimodular matrix U(z1,z2)∈F[z1,z2]k×k is a polynomial matrix that admits a polynomial inverse matrix. U(z1,z2) is unimodular if and only if det(U(z1,z2))∈F∖{0}; see [Lév81]. Two encoders G(z1,z2),G~(z1,z2)∈F[z1,z2]n×k of a 2D convolutional code differ by right multiplication with a unimodular matrix, i.e., G(z1,z2)=G~(z1,z2)U(z1,z2), for some unimodular matrix U(z1,z2)∈F[z1,z2]k×k.
Convolutional codes can be represented by linear systems. A 2D linear system models relations between 2D data. There are several state-space models of a 2D linear system. In the Fornasini-Marchesini state-space model (see [FM86]) the data relation is given by the updating equations
where A1,A2∈Fs×s, B1,B2∈Fs×k, C∈Fn×s, D∈Fn×k, s,n,k∈N0, and the system is denoted by Σ=(A1,A2,B1,B2,C,D). We say that Σ has dimension s. The vectors x(i,j)∈Fs, u(i,j)∈Fk and w(i,j)∈Fn represent the local state, input and output at (i,j), respectively.
We can define sets that partition the plane Z×Z in two regions. The i-th separation set of Z×Z is defined as
Si={(r,t)∈Z×Z:r+t=i}
and the i-th global state as
Xi:Zr→↦Fsx(r,i−r)
constituted by the sequence of local states with support in Si. We call the future of a point (r,t) on Z×Z the set
F(r,t)={(i,j)∈Z×Z:r≤i,t≤j}
and the future region with respect to Si is
FSi=(r,t)∈Si⋃F(r,t).
Given a system Σ=(A1,A2,B1,B2,C,D) and considering X0=0, it follows that for any input u(z1,z2) with support in FS0 the corresponding state is given by
The matrix T(z1,z2)=C(I−A1z1−A2z2)−1(B1z1+B2z2)+D is called the transfer matrix of Σ; see [FM86]. We say that a 2D system Σ=(A1,A2,B1,B2,C,D) is a realization of an encoder G(z1,z2) of a 2D convolutional code C if
G(z1,z2)=C(I−A1z1−A2z2)−1(B1z1+B2z2)+D
and the codewords of C are the outputs of Σ corresponding to the inputs u(z1,z2)∈F[z1,z2]k and X0=0. We call Σ a system representation of C.
In [BFM89], the authors give a construction procedure for a realization of a rational matrix in two indeterminates. Next we give this algorithm that constructs such a realization of an encoder G(z1,z2)∈F[z1,z2]n×k of a 2D convolutional code. For that we consider for any integer ℓ≥1 the constant matrices
Input: G(z1,z2)∈F[z1,z2]n×k with column degrees ν1,ν2,…,νk.
1 Let D:=G(0,0) and G^(z1,z2):=G(z1,z2)−G(0,0).
2 Let
A1:=diag{A1(ν1),A1(ν2),…,A1(νk)},
A2:=diag{A2(ν1),A2(ν2),…,A2(νk)},
B1:=diag{B1(ν1),B1(ν2),…,B1(νk)},
B2:=diag{B2(ν1),B2(ν2),…,B2(νk)}.
3 Let Z(ℓ) be the matrix constituted by the elements z1iz2j of degree smaller than or equal to ℓ and greater than 0 in decreasing lexicographic order 1, i.e.,
and let C∈Fn×(∑i=1k2νi(νi+3)) be such that G^(z1,z2)=CΨ(z1,z2). In case νi=0 for some i, the i-th columns in B1, B2 and Ψ(z1,z2) are equal to zero, and the i-th diagonal blocks A1(νi) and A2(νi) are empty.
Output: Σ=(A1,A2,B1,B2,C,D)
Theorem 2.1. Algorithm 1 gives a realization of G(z1,z2)∈F[z1,z2]n×k.
Proof. The theorem follows from the fact that
Ψ(z1,z2)=(I−A1z1−A2z2)−1(B1z1+B2z2).
Let G(z1,z2)∈F[z1,z2]n×k and let Σ=(A1,A2,B1,B2,C,D) be the realization of G(z1,z2) of dimension s produced by Algorithm 1. It is easy to see that det[I−A1z1−A2z2]=1, which means that I−A1z1−A2z2 is unimodular. Thus, a polynomial input u(z1,z2)∈F[z1,z2]k produces the state x(z1,z2)=(I−A1z1−A2z2)−1(B1z1+B2z2)u(z1,z2) which is also polynomial, i.e., which belongs to F[z1,z2]s. Thus, if G(z1,z2)∈F[z1,z2]n×k is an encoder of a 2D convolutional code and Σ=(A1,A2,B1,B2,C,D) is the realization of G(z1,z2) given by Algorithm 1, we have that
1Given z1i1z2j1 and z1i2z2j2, we say that z1i1z2j1<z1i2z2j2 if i1+j1<i2+j2 or, in case i1+j1=i2+j2, if i1<i2 the codewords of C correspond to the outputs of the system with corresponding inputs and states having finite support in N02.
Another way of seeing the evolution of the trajectories of a 2D system is by considering its global states, inputs and outputs. The i-th global input is defined as
Ui:Zr→↦u(r,i−r)
and the i-th global output as
Wi:Zr→↦w(r,i−r)
constituted by the sequences of local inputs and outputs with support in Si [FM86]. We can represent the i-th global state, input and output states as
Let Σ be a realization of dimension s obtained from Algorithm 1 of an encoder G(z1,z2)∈F[z1,z2]n×k of a 2D convolutional code. Note that the i-th global states, inputs and outputs corresponding to trajectories whose output are the codewords of the code, are polynomials of degree smaller than or equal to i with coefficients in Fs, Fk and Fn, respectively. Let us denote such sets by F[ξ]≤is, F[ξ]≤ik and F[ξ]≤in, respectively.
3 Two-dimensional Viterbi algorithm
Let C be an (n,k) 2D convolutional code and let
r(z1,z2)=(i,j)∈N02∑rijz1iz2j∈F[z1,z2]n
be a received word after channel transmission. In this section, we present a decoding procedure to obtain the closest codeword of C to r(z1,z2), i.e., the codeword w(z1,z2)=∑(i,j)∈N02wijz1iz2j∈C with minimal distance to r(z1,z2), where the distance between w(z1,z2) and r(z1,z2) is defined as
d(w(z1,z2),r(z1,z2))=(i,j)∈N02∑d(wij,rij)
and d(wij,rij) is the Hamming distance between wij and rij, which is the number of positions in which wij and rij differ, or equivalently, the number of nonzero entries of the vector wij−rij (the distance between two words in one indeterminate is defined in the same way). For this scenario we will adapt the Viterbi algorithm [Vit67], which is the most popular error-correction decoding algorithm for 1D convolutional codes.
The Viterbi algorithm works as follows. When a word transmitted through the communication channel is received, the Viterbi algorithm considers all codewords, until a certain length, and compares the received word to each of them. Then it selects a codeword which has minimum distance to the received word.
Let C be a 2D convolutional code, G(z1,z2)∈F[z1,z2]n×k an encoder of C and Σ=(A1,A2,B1,B2,C,D) a realization of dimension s, for example the one given by Algorithm 1, with global updating equations
The evolution of the trajectories of the system (that will generate the codewords of the code) can be represented by a trellis diagram, as follows:
for each i∈N0 consider all the elements of F[ξ]≤is as the nodes at step i;
for each i∈N0, the nodes Xi(ξ)∈F[ξ]≤is and Xi+1(ξ)∈F[ξ]≤i+1s are joined by an arc (starting in Xi(ξ) and ending in Xi+1(ξ)), if there exists Ui(ξ)∈F[ξ]≤ik such that
Xi+1(ξ)=(A1+A2ξ)Xi(ξ)+(B1+B2ξ)Ui(ξ).
The arc (Xi(ξ),Xi+1(ξ)) is labeled with (Ui(ξ),Wi(ξ)), where
Wi(ξ)=CXi(ξ)+DUi(ξ)
is an element of F[ξ]≤in and we say that Xi(ξ) is a predecessor of Xi+1(ξ).
The codewords of C correspond to the paths in the trellis diagram that start at X0(ξ)=0 at step 0 and end at the zero state 0∈F[ξ]≤is at step i, for some i∈N0. If
(U0(ξ),W0(ξ)),(U1(ξ),W1(ξ)),…,(Ui(ξ),Wi(ξ))
is the sequence of the labels of such a path, the corresponding codeword is equal to w(z1,z2)=W0(ξ)+W1(ξ)η+⋯+Wi(ξ)ηi, where
ξ=z1−1z2andη=z1.
Given a received word r(z1,z2)∈F[z1,z2]n and considering the same change of variables ξ=z1−1z2 and η=z1, we can write r(z1,z2) as ∑i∈N0Ri(ξ)ηi, with Ri(ξ)∈F[ξ]≤i. To find the closest codeword to ∑i∈N0Ri(ξ)ηi, the Viterbi algorithm considers at each step i the restriction of the received word to the separation sets S0 to Si (i.e., the word ∑j=0iRj(ξ)ηj). Then, for each state Xi(ξ)∈F[ξ]≤is, it takes all the paths from the zero state X0(ξ)=0∈F[ξ]≤0 to Xi(ξ). For each of these paths with nodes X0(ξ),X1(ξ),…,Xi(ξ), the algorithm considers the corresponding sequence of labels of the arcs (U0(ξ),W0(ξ)),(U1(ξ),W1(ξ)),…,(Ui(ξ),Wi(ξ)) and computes the minimal distance between ∑j=0iWj(ξ)ηj and ∑j=0iRj(ξ)ηj. It sets dˉ equal to the minimum of these distances and sˉp equal to the list of the paths with corresponding distance equal to dˉ (the survivor paths). Then it assigns the label (dˉ,sˉp) to Xi(ξ).
This leads to the following Algorithm 2. A detailed example for this algorithm can be found in the appendix.
Algorithm 2: 2D Viterbi algorithm
Input: A realization Σ=(A1,A2,B1,B2,C,D) of dimension s of an encoder
G(z1,z2) of C and the received word R(ξ,η)=∑i=0NRi(ξ)ηi, with
RN(ξ)=0 where we call N the global degree of R(ξ,η).
Initialization: Set the initial node X0(ξ)=0 and assign to it the label
(d=0,sp=∅). For all i∈N, assign to all Xi(ξ)∈F[ξ]≤is the label (∞,∅). Set
i=0, dmin=∞ and spmin=∅.
1 foreach node Xi+1(ξ)∈F[ξ]≤i+1s do
1.1 foreach predecessor Xi(ξ)∈F[ξ]≤is with label (d,sp) do
compute the sum d+d(Wi(ξ),Ri(ξ)), where (Ui(ξ),Wi(ξ)) is the label of
the arc (Xi(ξ),Xi+1(ξ)) in the trellis
1.2 Determine the minimum of the sums computed in 1.1 and denote it by dˉ,
and let L be the list of the nodes Xi(ξ)∈F[ξ]≤is such that
dˉ=d+d(Wi(ξ),Ri(ξ)), where Xi(ξ) has label (d,sp) and (Ui(ξ),Wi(ξ)) is
the label of the arc (Xi(ξ),Xi+1(ξ)) in the state-transition diagram.
1.3 Set spˉ=∅
1.4 foreach Xi(ξ) in L with label (d,sp) do
if i=0 then
set spˉ={0}
else
set spˉ=∪ℓ∈sp(ℓ,Xi(ξ))∪spˉ, where (ℓ,Xi(ξ)) is the concatenation of
the two vectors ℓ and Xi(ξ)
1.5 Assign to Xi+1(ξ) the label (dˉ,spˉ) ( spˉ is the list of paths from X0(ξ)=0 to
Xi+1(ξ), whose corresponding truncated codewords ∑j≤iWj(ξ)ηj have
minimal distance to ∑j≤iRj(ξ)ηj
1.6 if i≥N and Xi+1(ξ)=0 and dˉ=dmin then
set spmin=spmin∪spˉ
if i≥N and Xi+1(ξ)=0 and dˉ<dmin then
set dmin=dˉ and spmin=spˉ
2 if all the nodes Xi+1(ξ)=0 with label (dˉ,spˉ) are such that dˉ>dmin then
Output: the list cmin of codewords corresponding to the paths in spmin and
the corresponding messages
else
set i=i+1 and go to Step 1
The above algorithm returns cmin, which is the list of the codewords of C with minimal distance to the received word among all the codewords of the code. Since one cannot predict when the algorithm stops, it is usual to not consider all the codewords but only the ones with global degree at most N. The next algorithm is a modified version of Algorithm 2 that considers this restriction. The number of iterations will be N, from i=0 to i=N−1.
Algorithm 3: 2D modified Viterbi algorithm
Input: A realization Σ=(A1,A2,B1,B2,C,D) of dimension s of an encoder
G(z1,z2) of C and the received word R(ξ,η)=∑i=0NRi(ξ)ηi, with
RN(ξ)=0 where we call N the global degree of R(ξ,η).
Initialization: Set the initial node X0(ξ)=0 and assign to it the label
(d=0,sp=∅). For all 1≤i≤N assign to all Xi(ξ)∈F[ξ]≤is the label (∞,∅).
1 for i=0,…,N−1 do
foreach Xi+1(ξ)∈F[ξ]≤i+1s do
1.1 foreach predecessor Xi(ξ)∈F[ξ]≤is with label (d,sp) do
compute the sum d+d(Wi(ξ),Ri(ξ)), where (Ui(ξ),Wi(ξ)) is the
label of the arc (Xi(ξ),Xi+1(ξ)) in the trellis
1.2 Determine the minimum of the sums computed in 1.1 and denote it by dˉ,
and let L be the list of the nodes Xi(ξ)∈F[ξ]≤is such that
dˉ=d+d(Wi(ξ),Ri(ξ)), where Xi(ξ) has label (d,sp) and (Ui(ξ),Wi(ξ))
is the label of the arc (Xi(ξ),Xi+1(ξ)) in the state-transition diagram.
1.3 Set sˉp=∅
1.4 foreach Xi(ξ) in L with label (d,sp) do
if i=0 then
set sˉp={0}
else
set sˉp=∪ℓ∈sp(ℓ,Xi(ξ))∪sˉp, where (ℓ,Xi(ξ)) is the concatenation
of the two vectors ℓ and Xi(ξ)
1.5 Assign to Xi+1(ξ) the label (dˉ,sˉp) (sˉp is the list of paths from X0(ξ)=0
to Xi+1(ξ), whose corresponding truncated codewords ∑j≤iWj(ξ)ηj
have minimal distance to ∑j≤iRj(ξ)ηj
Output: the list cmin of codewords corresponding to the paths in sˉp of the
state XN(ξ)=0 and the corresponding messages.
4 Complexity analysis and methods to obtain realizations of small dimension
In this section we are going to analyze the complexity of the 2D modified Viterbi Algorithm; see Algorithm 3. As the following theorem shows this complexity is strongly related with the dimension of the linear system representation of the code that is used in the decoding algorithm. Therefore, in this section, we also discuss the problem of finding realizations of smallest possible dimension, which we illustrate with several examples.
Theorem 4.1. For an (n,k) 2D convolutional code and a received word of global degree N, the complexity of Algorithm 3 is
O(nN⋅q(s+k)(N+1)−1),
when using a system representation of dimension s.
Proof. For each i∈{0,1,…,N−1}, Algorithm 3 considers the q(i+1)s nodes Xi(ξ)∈F[ξ]≤is. For each of these nodes the algorithm considers q(i+1)k outgoing branches and for each of the predecessors it computes the distance between the Ri(ξ)∈F[ξ]≤in and the corresponding Wi(ξ)∈F[ξ]≤in. Hence, the overall complexity is
Note that N, n, k, q are fixed. However, s depends on the dimension of the used system representation of the code. Therefore, a minimal system representation of the code, i.e., a system representation of minimal dimension among all the system representations of the code, would be desirable. Obtaining such a minimal system representation can be a difficult task. System representations of a code are realizations of encoders of the code. An encoder admits many realizations of different dimensions. The problem of obtaining a realization of minimal dimension among all realizations of an encoder is still an open problem in the 2D case.
A realization of an encoder of a 1D convolutional is minimal if and only if it is reachable and observable. The following definition considers such properties for 2D linear systems.
Definition 4.1. [FM86] Let Σ=(A1,A2,B1,B2,C,D) be a 2D linear system with dimension s. Let
A1r△tA2=0, when either r or t is negative,
A1r△0A2=A1r,A10△tA2=A2t, for r,t≥0,
A1r△tA2=A1(A1r−1△tA2)+A2(A1r△t−1A2), for r,t≥1.
(a) Σ is called locally reachable if the reachability matrix
R=[R1R2R3⋯]isfullrowrank,
where Rk is defined as the block matrix including all columns given by
(A1i−1△jA2)B1+(A1i△j−1A2)B2
with i+j=k, for i,j≥0 and
(b) Σ is called locally observable if the observability matrix
O=O1O2O3⋮is full row rank,
where Ok is defined as the block matrix including all rows given by
C(A1i△jA2)
with i+j=k, for i,j≥0.
However, in contrast to the 1D case, (local) reachability and (local) observability are not sufficient conditions for minimality of 2D linear systems. A characterization of minimal realizations of an encoder of a 2D convolutional code has been an open problem for many years.
In certain cases, a realization of lower dimension can be obtained from another realization satisfying certain conditions. Given a realization Σ=(A1,A2,B1,B2,C,D) of an encoder G(z1,z2) of dimension s and T an invertible s×s matrix it follows that
Σ~=(T−1A1T,T−1A2T,T−1B1,T−1B2,CT,D)
is also a realization of G(z1,z2) of the same dimension. Σ and Σ~ are said to be algebraically equivalent. In the particular case that Σ=(A1,A2,B1,B2,C,D) is the realization of G(z1,z2) given by Algorithm 1, the corresponding reachability matrix has the identity matrix as a submatrix, which means that Σ is locally reachable. Moreover, since A2A1=0, we have that its observability matrix is equal to
O=[CA1iA2j]i,j∈N0,
up to row permutation. If rank O=s, then Σ is also locally observable. If rank O=r<s, then dimkerO=s−r. Let (wr+1,…,ws) be a basis of kerO and T=[w1⋯wrwr+1…ws]∈Fs×s be an invertible matrix, for some w1,…,wr∈Fs. Note that CT=[C10], where C1∈Fn×r. Let x∈kerO, i.e.,
CA1iA2jx=0foralli,j∈N0.(2)
Then, CA1iA2j(A1x)=0 if j≥1 because A2A1=0, and also for j=0 by (2). Thus, O(A1x)=0 and therefore, kerO is A1-invariant. On the other hand, (2) implies that CA1iA2j+1=0 for all i,j∈N0 and therefore, O(A2x)=0 which means that kerO is also A2-invariant. Hence,
T−1A1T=[A11A130A14]
and
T−1A2T=[A21A230A24]
where A11,A21∈Fr×r, A13,A23∈F(s−r)×s and A14,A24∈F(s−r)×(s−r). Thus, we have that
(T−1A1T,T−1A2T,T−1B1,T−1B2,CT,D)
is also a realization of G(z1,z2) and therefore so is (A11,A21,B11,B21,C1,D), where T−1B1=[B11B12] and T−1B2=[B21B22], with B11,B21∈Fr×k and B12,B22∈F(s−r)×k since
Moreover, (A11,A21,B11,B21,C1,D) is locally reachable since its reachability matrix is the submatrix of the matrix T−1R consisting of the first r rows and therefore it is full row rank. Furthermore, OT=[O10], where O1 is the observability matrix of (A11,A21,B11,B21,C1,D). Since the rank of O is r, also the rank of O1 is r and therefore, the system (A11,A21,B11,B21,C1,D) is locally observable.
Thus, given a realization of an encoder G(z1,z2)∈Fn×k[z1,z2] obtained by Algorithm 1 that is not locally observable, one can construct another realization of G(z1,z2) with smaller dimension that is both locally observable and locally reachable. For clarity, this procedure is presented in the following algorithm.
Algorithm 4:
Input: Σ=(A1,A2,B1,B2,C,D) realization of dimension s of
G(z1,z2)∈F[z1,z2]n×k given by Algorithm 1 and O the observability
matrix of Σ of rank r (with r<s).
1 Let T=[w1⋯wrwr+1⋯ws]∈Fs×s be an invertible matrix such
that (wr+1,…,ws) is a basis of ker O.
2 Let
A11:=[Ir0]T−1A1T[Ir0],
A21:=[Ir0]T−1A2T[Ir0],
B11:=[Ir0]T−1B1,
B21:=[Ir0]T−1B2,
C1:=CT[Ir0].
Output: Σ=(A11,A21,B11,B21,C1,D)
We illustrate this way of reducing the dimension of our realization with the following examples, where ei denotes a standard basis column vector of suitable length.
Example 4.1. Consider the generator matrix G(z1,z2)=(z2z1+z2z1)∈F22×1[z1,z2].
With Algorithm 1 we obtain the following realization of dimension 5:
Σ=(A11,A21,B11,B21,C1,D) is a locally reachable and locally observable realization of G(z1,z2) of dimension 3.
Example 4.2. For G(z1,z2)=(z22z1z2z1+z2)∈F22×1[z1,z2], we obtain with Algorithm 1 the 9 dimensional realization Σ=(A1,A2,B1,B2,C,D) with
In the following, we will explain how to obtain a realization with only dimension 3. The only monomials appearing in G(z1,z2) are z22z1, z2z1 and z2. In this particular example, it is sufficient to choose Ψ^(z1,z2)=(z22z1z2z1z2)T to be able to construct the realization Σ=(A^1,A^2,B^1,B^2,C^,D) with
has full rank. In general, it does not always work to just choose the monomials appearing in G(z1,z2) to form Ψ^(z1,z2) but we might need to add some further monomials to this set. In particular, if z1az2b for a+b≥2 is included in this set, then we also need to have either z1a−1z2b or z1az2b−1 included in this set. In this example, this condition is automatically fulfilled by just choosing the monomials appearing in G(z1,z2) and we do not need to add further monomials. However, later in the paper, we illustrate with Example 4.6 a case where additional monomials besides the ones appearing in G(z1,z2) need to be added to the set Ψ^(z1,z2). An algorithm on how to form this set in general and how obtain a realization from it is presented in the following Algorithm 5.
Algorithm 5:
Input: G(z1,z2)∈F[z1,z2]n×k with column degrees ν1,ν2,…,νk
1 Let D:=G(0,0) and G^(z1,z2):=G(z1,z2)−G(0,0).
2 for i=1,…,k do
Let S^i be a minimal set of monomials such that
all monomials that appear in column i are in S^i
for z1az2b∈S^i with a+b≥2 follows
a>0 and z1a−1z2b∈S^i
or
b>0 and z1az2b−1∈S^i.
With Z(νi) from Algorithm 1 define I^i:={j=1,…,2νi(νi+3)∣Zj(νi)∈S^i}
and let Z^(i):=Z(νi)∣I^i be the vector restricted to the entries with indices
in I^i.
3 Define
Ψ^(z1,z2)=diag{Z^(1),Z^(2),…,Z^(k)}
and let C^∈Fn×∣I^i∣ be such that G^(z1,z2)=C^Ψ^(z1,z2).
4 for i=1,…,k do
Let A^1(i)=A^2(i)=0∈Fq∣I^i∣×∣I^i∣ and B^1(i)=B^2(i)=0∈Fq∣I^i∣.
for ℓ=1,…,∣I^i∣ do
Let a,b∈N0 be such that Z^ℓ(i)=z1az2b.
if a=1 and b=0 then
write a 1 in row ℓ of B^1(i)
if a=0 and b=1 then
write a 1 in row ℓ of B^2(i)
if z1a−1z2b∈S^i then
there exists some ℓ^ such that Z^ℓ^(i)=z1a−1z2b
write a 1 at position (ℓ,ℓ^) in A^1(i)
else
there exists some ℓ^ such that Z^ℓ^(i)=z1az2b−1
write a 1 at position (ℓ,ℓ^) in A^2(i)
5 Let
A^1:=diag{A^1(1),A^1(2),…,A^1(k)},
A^2:=diag{A^2(1),A^2(2),…,A^2(k)},
B^1:=diag{B^1(1),B^1(2),…,B^1(k)},
B^2:=diag{B^2(1),B^2(2),…,B^2(k)}.
In case νi=0 for some i, the i-th columns in B^1, B^2 and Ψ^(z1,z2) are equal to
zero, and the i-th diagonal blocks A^1(i) and A^2(i) are empty.
Output: Σ=(A^1,A^2,B^1,B^2,C^,D)
Theorem 4.2. Algorithm 5 gives a locally reachable realization of the encoder G(z1,z2)∈F[z1,z2]n×k.
Proof. We need to show that for each column i=1,…,k of G(z1,z2), the equation
holds. For each j=1,…,∣I^i∣, we have exactly one of the following 4 cases:
Case 1: Z^j(i)=z1
Then, the j-th entry on the left side of equation (3) is equal to z1, and the j-th entry on the right side is also equal to z1.
Case 2: Z^j(i)=z2
Then, the j-th entry on the left side of equation (3) is equal to z2, and the j-th entry on the right side is also equal to z2.
Case 3: Z^j(i)=z1az2b for a+b≥2 and there exists some j^ such that Z^j(i)=z1a−1z2b
Then, the j-th entry on the left side of equation (3) is equal to Z^j(i)−z1Z^j(i)=z1az2b−z1z1a−1z2b=0, and the j-th entry on the right side is also equal to 0.
Case 4: Z^j(i)=z1az2b for a+b≥2 and there exists some j^ such that Z^j(i)=z1az2b−1 and z1a−1z2b∈/S^i
Then, the j-th entry on the left side of equation (3) is equal to Z^j(i)−z2Z^j(i)=z1az2b−z2z1a−1z2b=0, and the j-th entry on the right side is also equal to 0.
Therefore, equation (3) holds, and Algorithm 5 gives a realization of G(z1,z2).
It remains to show that each realization obtained from Algorithm 5 is locally reachable. Because of the block diagonal structure of the matrices A^1,A^2,B^1,B^2 it is enough to show this statement for k=1. We proof it by showing that each non-zero column of A^1 and A^2 is also a column of R, which implies that R contains the identity matrix. Each row of the matrix (A^1,A^2,B^1,B^2) contains exactly one non-zero entry and this entry is equal to 1. Moreover, each column of (A^1,A^2,B^1,B^2) contains at most one non-zero entry. Note that these last two properties already imply that the matrix (A^1,A^2,B^1,B^2) contains the identity matrix.
Consider an arbitrary non-zero column of A^1. The row of its non-zero entry corresponds to a polynomial z1az2b from Ψ^(z1,z2) for which also z1a−1z2b is in Ψ^(z1,z2). Overall, there is a chain of monomials from Ψ^(z1,z2) going from z1az2b to either z1 or z2 where in each step of the chain the exponent of either z1 or z2 is decreased by 1 and if both is possible in Ψ^(z1,z2), then the exponent of z1 is decreased. Each time the exponent of z1 is decreased this corresponds to a 1 in A^1 and each time the exponent of z2 is decreased this corresponds to a 1 in A^2. Overall, if we multiply all the matrices corresponding to such a chain with B^1 if we end with z1 and with B^2 if we end with z2, we obtain the column of Aˆ
1 we started with. For example if Ψ( ˆ z1, z2) = {z
2
2
z1, z3
2
, z2
2
, z2z1, z2}, i.e.,
Aˆ
1 =
0 0 1 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 1
0 0 0 0 0
, Aˆ
2 =
0 0 0 0 0
0 0 1 0 0
0 0 0 0 1
0 0 0 0 0
0 0 0 0 0
, Bˆ
1 = 0, Bˆ
2 = e5,
then the chain z
2
2
z1 → z
2
2 → z2 corresponds to the fact that Aˆ
1Aˆ
2Bˆ
2 is equal to the third
column of Aˆ
Overall, all columns of Aˆ
1 are equal to a summand of
Aˆ
1
i−1△jAˆ
2
Bˆ
1 +
Aˆ
1
i△j−1Aˆ
2
Bˆ
2 for some for i, j ≥ 0, in the above example, i = 1 and j = 2. It
remains to show that all the other summands of such a sum are equal to zero. For
fixed i and j, all summands correspond to possible chains of monomials with the same
starting and end point either z1 or z2. Since Algorithm 5 places 1s in
Aˆ
1 Aˆ
2 Bˆ
1 Bˆ
2
for only one of these paths, all other summands are zero. For the above example this
means that Aˆ
2Aˆ
1Bˆ
2 = 0 (corresponding to the chain z
2
2
z1 → z1z2 → z2) and Aˆ2
2Bˆ
1 = 0
(corresponding to the chain z
2
2
z1 → z1z2 → z1).
This shows that all non-zero columns of Aˆ
1 are also columns of R. With exactly the
same reasoning one can show that all non-zero columns of Aˆ
2 are also columns of R,
which finishes the proof.
If we apply the previous algorithm to the Example 4.1, we get the same realization
as with Algorithm 4.
Example 4.3. As in Example 4.1 we consider G(z1, z2) =
z2z1 + z2
z1
. With Algorithm
5 we obtain:
Ψ( ˆ z1, z2) =
z2z1 z2 z1
T
, Bˆ
2 =
0
1
0
, Bˆ
1 =
0
0
1
Aˆ
1 =
0 1 0
0 0 0
0 0 0
, Aˆ
2 =
0 0 0
0 0 0
0 0 0
, Cˆ =
1 1 0
0 0 1
.
In the following, we present an example where Algorithm 4 and Algorithm 5 give
again realizations of the same dimension but now the realizations itself are different.
Actually, in this example, the realization from Algorithm 5 is not locally observable.
Example 4.4. Consider G(z1, z2) =
z
2
2
z
2
1 + z2 + z1
z
2
2
z1 + z2z1
∈ F
2×1
2
[z1, z2]. Applying Algorithm 1, we obtain the realization (A1, A2, B1, B2, C, D) where
A1 =
The row-span of the observability matrix O is ⟨e3T+e14T,e7T,e10T,e11T,e13T⟩ and therefore, O has rank 5 and kerO=⟨e1,e2,−e3+e14,e4,e5,e6,e8,e9,e12⟩. Applying now Algorithm 4, we consider
i.e., the row-span of O^ is ⟨e1⊤+e5⊤,e2⊤,e3⊤,e4⊤⟩ and hence, O^ is not full rank and the realization is not locally observable.
In the following, we explain a method with which we can further decrease the dimension of the realization. To this end we consider again equation (3) and search for matrices A1, A2, B1, B2, Z of smallest possible size fulfilling this equation such that the entries of Z form a set of polynomials from F[z1,z2] whose F-span includes the set of entries of G(z1,z2) (and A1, A2, B1, B2 have entries from F). For our concrete example the following equation provides such a solution of dimension 4:
Then, we solve the equation G^(z1,z2)=CZ (in our case D=G(0,0)=0, i.e., G^(z1,z2)=G(z1,z2)) for C to obtain
C=(10010110).
Calculating
O=100000⋮011000010001100001,
which is full rank, shows that this realization also is locally observable.
In the following, we will formalize the idea presented at the end of the preceding example.
Lemma 4.1. Let sj be the minimal number of elements of F[z1,z2] needed such that each entry of column j of G(z1,z2)∈Fq[z1,z2]k×n is in the Fq-span of these elements. Then, the dimension of a minimal realization of G(z1,z2) is lower bounded by maxj∈{1,…,k}{sj}.
Proof. Without loss of generality assume D=G(0,0)=0. We have that G(z1,z2)=C(I−A1z1−A2z2)−1(B1z1+B2z2). Each entry in column j of G(z1,z2) is a linear combination (with constant coefficients that are entries of C) of the entries of the j-th column of (I−A1z1−A2z2)−1(B1z1+B2z2).
The method used in the end of the previous example to further reduce the dimension is exactly the search for the minimal number of elements whose F2-span covers all entries of G(z1,z2) such that additionally all of these elements can be obtained as entries of (I−A1z1−A2z2)−1(B1z1+B2z2) for suitable matrices A1,A2,B1,B2. There is no general algorithm telling us how to find such a minimal realization but this has to be considered case by case for each specific example.
Besides reducing the dimension of the previous example in this way, this allows us to also further reduce the dimension of Example 4.1, even if Algorithm 4 and Algorithm 5 gave the same observable realization.
Example 4.5. Considering again G(z1,z2)=(z2z1+z2z1), we observe that using
We conclude this section with the following example that shows that for generator matrices with k>1, the choice of the generator matrix matters for the size of the realization we obtain.
which are generator matrices of the same convolutional code. Applying Algorithm 5 to the matrix G(z1,z2) we obtain a realization of dimension 7, in particular
Ψ^(z1,z2)=(z1z2z12z12z2z2z1z1)T.
However, applying Algorithm 5 to the matrix G~(z1,z2) we obtain a realization of dimension 5 with
The row-span of O is equal to ⟨e3⊤,e1⊤+e2⊤+e4⊤,e2⊤,e5⊤,e1⊤⟩ and hence, O is full rank and this realization is observable.
5 Conclusion
In this paper, we introduced an error-correction decoding method for two-dimensional (2D) convolutional codes, called the 2D Viterbi algorithm, which extends the classical Viterbi algorithm to the two-dimensional setting. Since the computational complexity of the decoding algorithm depends directly on the dimension of the linear systems representation, obtaining realizations of small dimension is essential to keep decoding feasible. We presented several methods to reduce the system dimension but it is still an open problem to find a minimal realization of an encoder. In this context, another problem related to minimality concerns the characterization of encoders that admit minimal dimensional realizations among all encoders of a given code. While this problem has been solved in the one-dimensional case, its extension to the two-dimensional setting is expected to be considerably more challenging, as the minimal realizations of a code will be minimal realizations of certain encoders, thus requiring the determination of minimal realizations for each encoder.
Acknowledgements
The first and fourth author are supported by the Center for Research and Development in Mathematics and Applications (CIDMA) under the Portuguese Foundation for Science and Technology (FCT, https://ror.org/00snfqn58) Multi-Annual Financing Program for R&D Units, grants UID/4106/2025 and UID/PRR/4106/2025. The second and third author are supported by the German research foundation, project number 513811367.
References
[ANP15] P. Almeida, D. Napp, and R. Pinto. From 1d convolutional codes to 2d convolutional codes of rate 1/n. In: Pinto, R., Malonek, P.R., Vettori, P. (eds.) Coding Theory and Applications, CIM Series in Mathematical Sciences, Springer, Cham, Switzerland, 3:25–33, 2015.
[BFM89] M. Bisiacco, E. Fornasini, and G Marchesini. Dynamic regulation of 2D systems: a state-space approach. Linear Algebra and its Applications, 122–124:195–21894, 1989.
[CNPP12] J.-J. Climent, D. Napp, C. Perea, and R. Pinto. A construction of MDS 2D convolutional codes of rate 1/n based on superregular matrices. Linear Algebra and its Applications, 437(3):766–780, 2012.
[CNPP16] J.-J. Climent, D. Napp, C. Perea, and R. Pinto. Maximum distance separable 2D convolutional codes. IEEE Transactions on Information Theory, 62(2):669–680, 2016.
[CNPSo16] J.-J. Climent, D. Napp, R. Pinto, and R. Simões. Decoding of 2D convolutional codes over the erasure channel. Advances in Mathematics of Communication, 10(1):179–193, 2016.
[FM86] E. Fornasini and G. Marchesini. Structure and properties of two-dimensional systems. Multidimensional Systems, Techniques and Applications, 29:37–88, 1986.
[FV94] E. Fornasini and M.E. Valcher. Algebraic aspects of two-dimensional convolutional codes. IEEE Transactions on Information Theory, 40(4):1068–1082, 1994.
[Lév81] B.C. Lévy. 2-D polynomial and rational matrices, and their applications for the modeling of 2-D dynamical systems. PhD dissertation, Stanford University, USA, 1981.
[LP23] J Lieb and R. Pinto. A decoding algorithm for 2D convolutional codes over the erasure channel. Advances in Mathematics of Communications, 17(4):935–959, 2023.
[NPP10] D. Napp, C. Perea, and R. Pinto. Input-state-output representations and constructions of finite support 2D convolutional codes. Advances in Mathematics of Communications, 4(4):533–545, 2010.
[VF94] M.E. Valcher and E. Fornasini. On 2D finite support convolutional codes: an algebraic approach. Multidimensional Systems and Signal Processing, 5:231–243, 1994.
[Vit67] A. Viterbi. Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. IEEE Transactions on Information Theory, 13(2):260–269, 1967.
A Step-by-Step Example of the 2D Viterbi Algorithm (Algorithm 2)
Consider the encoder G(z1,z2)=(1+z1z1+z2)∈F2[z1,z2]2×1, i.e. n=2, k=1, ν1=1. Calculating a realization for G(z1,z2) according to Algorithm 1, one obtains A1=A2=(0000), B1=(10), B2=(01), D=(10) and C=(1101). Easy calculations show that there exists no realization of dimension one. We assume that the codeword
Figure 3: Complete Trellis diagram at stage i = 2.
For i=3, one will get that dˉ is at least 2 for all the possible vertices X4(ξ). This means that the algorithm stops with dmin=1 and spmin={((00),(1ξ),(ξξ2))}. The output is the list of minimal codewords cmin that correspond to the paths in spmin, in this case it is only one path and corresponding codeword. The labels of this path are