Algorithm Search⌘K

Algorithmadvanced

Ungerboeck MLSE receiver

Also called Ungerboeck metric.

Runs maximum likelihood sequence estimation directly on matched filter samples with a modified metric, without a whitening filter.

Time
O(N M^(L-1) (M + L)) worst
Space
O(N M^(L-1)) extra
Where
L = the number of channel taps; M = the alphabet size; N = the number of symbols
Properties
deterministicexact mlneeds channelnot needs whitening
Origin
Gottfried Ungerboeck, 1974

The Ungerboeck receiver is a maximum likelihood sequence detector for channels with intersymbol interference that works on the matched filter outputs zkz_k directly. The matched filter outputs are sufficient statistics, but their noise is colored, so the plain Euclidean metric of the Viterbi equalizer does not apply to them. Forney whitened the noise first with the whitened matched filter. Ungerboeck instead expanded the exact log-likelihood of the received samples. It splits into one term per symbol that uses zkz_k, the channel autocorrelation RmR_m and the L−1L-1 symbols before xkx_k. So the Viterbi algorithm runs on the same trellis with ML−1M^{L-1} states and gives the same decisions, with no spectral factorization and no anticausal filter.

In plain words

The matched filter is the best first step of a receiver, because it keeps everything that matters about the symbols. Its outputs overlap each other, and so does their noise. Forney's receiver removes the overlap in the noise with an extra filter and then measures distances. Ungerboeck's receiver keeps the matched filter outputs as they are. It scores a guessed sequence by how well each guessed symbol correlates with its matched filter output, minus a correction for the energy of the symbol and for its overlap with the symbols just before it. The score is the same as the distance score up to a constant, so both receivers pick the same sequence.

The problem

The input is a known channel h=(h0,…,hL−1)h = (h_0, \ldots, h_{L-1}), an alphabet A\mathcal{A} of MM points, and the samples yk=∑lhlxk−l+wky_k = \sum_l h_l x_{k-l} + w_k for k=0,…,N+L−2k = 0, \ldots, N + L - 2, with xk=0x_k = 0 outside the block of NN symbols and ww white CN(0,N0)\mathcal{CN}(0, N_0). The output is the sequence x^∈AN\hat x \in \mathcal{A}^N that minimizes ∥y−h∗x∥2\|y - h * x\|^2, the maximum likelihood sequence. The receiver may also know some tail symbols at the end of the block.

The algorithm

With zk=∑lhˉl yk+lz_k = \sum_l \bar h_l\, y_{k+l} and Rm=∑ihi+mhˉiR_m = \sum_i h_{i+m} \bar h_i, the identity

∥y∥2−∥y−h∗x∥2=∑k=0N−1(2 Re(xˉkzk)−R0∣xk∣2−2 Re(xˉk∑m=1L−1Rmxk−m))\|y\|^2 - \|y - h * x\|^2 = \sum_{k=0}^{N-1} \Big( 2\,\mathrm{Re}(\bar x_k z_k) - R_0 |x_k|^2 - 2\,\mathrm{Re}\Big(\bar x_k \sum_{m=1}^{L-1} R_m x_{k-m}\Big) \Big)

holds for every yy and xx. The term for kk depends on xkx_k and the state (xk−1,…,xk−L+1)(x_{k-1}, \ldots, x_{k-L+1}), so it is a branch metric. The receiver maximizes the sum.

  1. UNGERBOECK-MLSE(y, h, A)
  2. 1z[k] ← Σ_l conj(h[l]) y[k + l] for k = 0 … N-1 ▷ the matched filter
  3. 2R[m] ← Σ_i h[i + m] conj(h[i]) for m = 0 … L-1 ▷ the autocorrelation
  4. 3metric[s] ← 0 for the start state (all past symbols 0), -∞ for the others
  5. 4for k ← 0 to N - 1
  6. 5for each state s and each symbol a allowed at k
  7. 6λ ← 2 Re(conj(a) z[k]) - R[0] |a|² - 2 Re(conj(a) Σ_{m≥1} R[m] x[k-m](s))
  8. 7if metric[s] + λ > new[next(s, a)] then keep it and set the pointer
  9. 8s ← the state with the largest metric; follow the pointers back
  10. 9return the symbols on the path

Line L1 is the matched filter, sampled at the symbol rate. Line L2 needs only the channel autocorrelation, which an adaptive receiver can estimate directly. Line L6 is the Ungerboeck branch metric: a correlation with the matched filter output, the energy of the symbol, and its correlation with the past symbols of the state. Lines L4 to L7 are the add-compare-select step of the Viterbi algorithm with a maximum in place of a minimum.

Example

Take h=(1,0.5)h = (1, 0.5) and BPSK, so R0=1.25R_0 = 1.25 and R1=0.5R_1 = 0.5, and the branch metric is 2azk−1.25−a xk−12 a z_k - 1.25 - a\, x_{k-1}. The block is x=(+1,−1,−1,+1)x = (+1, -1, -1, +1), the noiseless samples are (1,−0.5,−1.5,0.5,0.5)(1, -0.5, -1.5, 0.5, 0.5), and the received samples are y=(0.9,0.1,−1.2,0.6,0.4)y = (0.9, 0.1, -1.2, 0.6, 0.4). The matched filter gives zk=yk+0.5 yk+1z_k = y_k + 0.5\, y_{k+1}, so z=(0.95,−0.5,−0.9,0.8)z = (0.95, -0.5, -0.9, 0.8). Each cell shows the best metric into the state and the state it came from:

kk zkz_k state +1+1 state −1-1
0 0.95 0.65 from the start -3.15 from the start
1 -0.5 -2.6 from +1+1 1.4 from +1+1
2 -0.9 -0.65 from −1-1 0.95 from −1-1
3 0.8 2.3 from −1-1 -2.5 from +1+1

At k=0k = 0 there is no past symbol, so the metric for a=+1a = +1 is 1.9−1.25=0.651.9 - 1.25 = 0.65. At k=2k = 2, the state +1+1 compares −2.6+(−1.8−1.25−1)=−6.65-2.6 + (-1.8 - 1.25 - 1) = -6.65 from +1+1 with 1.4+(−1.8−1.25+1)=−0.651.4 + (-1.8 - 1.25 + 1) = -0.65 from −1-1. The best final metric is 2.3 in the state +1+1, and the traceback gives x^=(+1,−1,−1,+1)\hat x = (+1, -1, -1, +1). As a check, ∥y∥2=2.78\|y\|^2 = 2.78 and ∥y−h∗x^∥2=0.48\|y - h * \hat x\|^2 = 0.48, and 2.78−0.48=2.32.78 - 0.48 = 2.3. The metrics are not distances: they can be negative and they can fall from one step to the next.

Correctness

Claim. The returned sequence maximizes the Ungerboeck metric, and so it minimizes ∥y−h∗x∥2\|y - h * x\|^2. It is the maximum likelihood sequence, the same as the one the Viterbi equalizer finds after a whitened matched filter.

Key step. Expand ∥y−Hx∥2=∥y∥2−2 Re(xHHHy)+xHHHHx\|y - \mathbf{H}x\|^2 = \|y\|^2 - 2\,\mathrm{Re}(x^H \mathbf{H}^H y) + x^H \mathbf{H}^H \mathbf{H} x. The vector HHy\mathbf{H}^H y is zz, and HHH\mathbf{H}^H \mathbf{H} is the Toeplitz matrix of RR. The quadratic form splits into the diagonal and the pairs (k,k−m)(k, k - m), and each pair gives 2 Re(xˉkRmxk−m)2\,\mathrm{Re}(\bar x_k R_m x_{k-m}). So the metric is a sum of terms that each depend on a symbol and its state, and the trellis search is exact. The proofs folder has the details.

Proof: The Ungerboeck metric differs from the Euclidean metric by a constant, so the Viterbi search on it returns the maximum likelihood sequencefull

The channel taps are h0,…,hL−1h_0, \ldots, h_{L-1}, the block holds NN symbols x0,…,xN−1x_0, \ldots, x_{N-1} with xk=0x_k = 0 outside the block, and the received samples are yk=∑lhlxk−l+wky_k = \sum_l h_l x_{k-l} + w_k for k=0,…,N+L−2k = 0, \ldots, N + L - 2, with ww white CN(0,N0)\mathcal{CN}(0, N_0). Write H\mathbf{H} for the (N+L−1)×N(N + L - 1) \times N full convolution matrix, Hkj=hk−j\mathbf{H}_{kj} = h_{k-j}, so y=Hx+wy = \mathbf{H} x + w. Define

zk=∑l=0L−1hˉl yk+l,Rm=∑ihi+mhˉi,R−m=Rˉm,z_k = \sum_{l=0}^{L-1} \bar h_l\, y_{k+l}, \qquad R_m = \sum_i h_{i+m} \bar h_i, \quad R_{-m} = \bar R_m,

and the increment λk(x)=2 Re(xˉkzk)−R0∣xk∣2−2 Re(xˉk∑m=1L−1Rmxk−m)\lambda_k(x) = 2\,\mathrm{Re}(\bar x_k z_k) - R_0 |x_k|^2 - 2\,\mathrm{Re}\big(\bar x_k \sum_{m=1}^{L-1} R_m x_{k-m}\big).

Lemma 1 (the matched filter). z=HHyz = \mathbf{H}^H y, and HHH\mathbf{H}^H \mathbf{H} is the N×NN \times N Toeplitz matrix with entry (i,j)(i, j) equal to Ri−jR_{i-j}.

Proof. (HHy)i=∑khˉk−iyk=∑lhˉlyi+l=zi(\mathbf{H}^H y)_i = \sum_k \bar h_{k-i} y_k = \sum_l \bar h_l y_{i+l} = z_i, and the index i+l≤N−1+L−1i + l \le N - 1 + L - 1 stays inside the block, so no sample is lost (line L1). The entry (i,j)(i, j) of HHH\mathbf{H}^H \mathbf{H} is ∑khˉk−ihk−j\sum_k \bar h_{k-i} h_{k-j}. With l=k−il = k - i this is ∑lhˉlhl+i−j=Ri−j\sum_l \bar h_l h_{l + i - j} = R_{i-j}, and the sum runs over all ll because H\mathbf{H} keeps every output of the convolution (line L2). □\square

Theorem 1 (the metric identity). For every yy and every x∈CNx \in \mathbb{C}^N,

∑k=0N−1λk(x)=∥y∥2−∥y−Hx∥2.\sum_{k=0}^{N-1} \lambda_k(x) = \|y\|^2 - \|y - \mathbf{H} x\|^2 .

Proof. Expand ∥y−Hx∥2=∥y∥2−2 Re(xHHHy)+xHHHHx\|y - \mathbf{H} x\|^2 = \|y\|^2 - 2\,\mathrm{Re}(x^H \mathbf{H}^H y) + x^H \mathbf{H}^H \mathbf{H} x. By Lemma 1, the middle term is 2 Re∑kxˉkzk2\,\mathrm{Re}\sum_k \bar x_k z_k. The last term is ∑i,jxˉiRi−jxj\sum_{i,j} \bar x_i R_{i-j} x_j. Split it into the diagonal i=ji = j, which gives R0∑k∣xk∣2R_0 \sum_k |x_k|^2 (and R0R_0 is real), and the pairs with i≠ji \ne j. The term for (j,i)(j, i) with j<ij < i is xˉjRj−ixi=xˉiRi−jxj‾\bar x_j R_{j-i} x_i = \overline{\bar x_i R_{i-j} x_j}, so the two terms of each pair add up to 2 Re(xˉiRi−jxj)2\,\mathrm{Re}(\bar x_i R_{i-j} x_j). Group the pairs by the larger index k=ik = i and m=i−j≥1m = i - j \ge 1. Since Rm=0R_m = 0 for m≥Lm \ge L, this gives ∑k2 Re(xˉk∑m=1L−1Rmxk−m)\sum_k 2\,\mathrm{Re}(\bar x_k \sum_{m=1}^{L-1} R_m x_{k-m}). Collect the terms. □\square

Corollary 1 (maximum likelihood). Over any set of candidate sequences, xx maximizes ∑kλk(x)\sum_k \lambda_k(x) if and only if it minimizes ∥y−Hx∥2\|y - \mathbf{H} x\|^2, which is the maximum likelihood rule for white Gaussian noise.

Proof. ∥y∥2\|y\|^2 does not depend on xx. The likelihood is (πN0)−(N+L−1)exp⁡(−∥y−Hx∥2/N0)(\pi N_0)^{-(N+L-1)} \exp(-\|y - \mathbf{H}x\|^2/N_0). □\square

Theorem 2 (the trellis search). ungerboeck_mlse returns a sequence that maximizes ∑kλk\sum_k \lambda_k over An\mathcal{A}^n followed by the known tail.

Proof. The increment λk\lambda_k depends only on xkx_k and the state sk=(xk−1,…,xk−L+1)s_k = (x_{k-1}, \ldots, x_{k-L+1}), where the entries with negative index are 0 (in the code, only the entries with k−l≥0k - l \ge 0 enter the ISI term). So the sum is a sum of branch metrics along a path in the trellis with ML−1M^{L-1} states, and two paths into the same state have the same future increments. The same induction as for the Viterbi equalizer shows that after step kk, metric[s] is the largest partial sum over the allowed paths into ss, and the pointers give such a path (lines L4 to L7). At times k≥nk \ge n, only the tail symbol is allowed. Line L8 takes the best final state and traces back. Corollary 1 ends the proof. □\square

Remark (the noise). The noise in zz is HHw\mathbf{H}^H w, with covariance N0HHHN_0 \mathbf{H}^H \mathbf{H}, which is colored. Theorem 1 does not need white noise in zz: it rewrites the exact likelihood of yy. This is why no whitening filter is needed. The increments are not distances and can be negative, so the search maximizes and starts from 0.

Complexity

The matched filter and the autocorrelation cost O(NL+L2)O(N L + L^2). Each trellis step visits ML−1M^{L-1} states; the ISI sum costs O(L)O(L) per state and the branch metric O(1)O(1) per symbol. So NN symbols cost O(NML−1(M+L))O(N M^{L-1}(M + L)) time in the word RAM, with the metrics as numbers of fixed precision, and O(NML−1)O(N M^{L-1}) space for the pointers. The trellis is the same size as the Forney receiver's, but no root finding and no backward filter are needed.

Properties

  • Exact. Same decisions as the Forney receiver on the same samples, for every noise realization, because the two metrics differ by a constant.
  • No whitening. The noise in zz has the covariance N0HHHN_0 \mathbf{H}^H \mathbf{H}, and the metric accounts for it. A channel with zeros on the unit circle is no problem.
  • Causal. The matched filter output zkz_k needs the samples up to yk+L−1y_{k+L-1}, a fixed delay. No anticausal filter runs over the whole block.
  • Only the autocorrelation. The metric uses zz and RR, not hh itself beyond the matched filter, so a receiver with a continuous-time matched filter only needs RR.
  • Not a distance. The branch metrics are not squared distances and can be negative. Suboptimal searches that compare metrics of paths of different length, or that prune by a threshold, need care.

Variants and improvements

  • Adaptive. Ungerboeck's receiver estimated the matched filter and the autocorrelation adaptively from decisions. Per-survivor processing does the same along each survivor.
  • Reduced state. The metric works with reduced-state sequence estimation, but the ISI from the symbols after xkx_k is in zkz_k through the matched filter, so the minimum-phase prefilter of the Forney form is usually better for reduced-state receivers.
  • Soft outputs. The BCJR algorithm can run on the same branch metrics, divided by N0N_0, for soft outputs.
  • Faster than Nyquist. For faster-than-Nyquist signaling, the matched filter output with its known autocorrelation is the natural model, and the Ungerboeck metric is common there.
  • Time-varying channels. With a channel that changes from symbol to symbol, the metric uses Rk,mR_{k, m}, the correlation of the pulses for xkx_k and xk−mx_{k-m}.

When to use it

Use it in place of the Forney receiver when the matched filter output is already available, when the channel has zeros near or on the unit circle, or when the receiver estimates the autocorrelation more easily than the channel itself. It costs about the same as the Viterbi equalizer. For a DFE or a reduced-state search that decides early, use the whitened matched filter instead, because those receivers need the minimum-phase channel.

Pitfalls

  • Euclidean distance on the matched filter output. Measuring ∣zk−expected∣2|z_k - \text{expected}|^2 looks natural but is not maximum likelihood, because the noise in zz is colored.
  • The factor 2. The ISI term carries the factor 2 because each pair of symbols appears twice in the quadratic form. Dropping it changes the decisions.
  • Conjugates. For complex symbols, R−m=RˉmR_{-m} = \bar R_m, and the metric uses xˉkRmxk−m\bar x_k R_m x_{k-m} with m≥1m \ge 1. A real test channel hides a wrong conjugate.
  • Minimizing instead of maximizing. The metric is a correlation. The Viterbi search must keep the largest one.
  • The ends of the block. zkz_k for the last symbols needs the samples after them, so the receiver must keep the full convolution output of length N+L−1N + L - 1.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

ungerboeck_mlse_receiver.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/ungerboeck-mlse-receiver/. The authors are listed in prov/REAJPJ.jsonl.

"""Ungerboeck's maximum likelihood sequence receiver on matched filter samples.

The channel is y[k] = sum_{l=0}^{L-1} h[l] x[k-l] + w[k] for k = 0..N+L-2, with
x[k] = 0 outside 0..N-1 and w white CN(0, N0). The matched filter gives
z[k] = sum_l conj(h[l]) y[k+l], and R[l] = sum_i h[i+l] conj(h[i]) is the
channel autocorrelation. Then

    ||y||^2 - ||y - h * x||^2 = sum_k ( 2 Re(conj(x[k]) z[k]) - R[0] |x[k]|^2
                                         - 2 Re(conj(x[k]) sum_{l>=1} R[l] x[k-l]) ),

so maximizing the right side is maximum likelihood. Each term depends only on
x[k] and the L-1 symbols before it, so the Viterbi algorithm on the same trellis
as the Forney receiver finds the best sequence. No whitening filter is needed.
"""

import itertools


def matched_filter(y: list[complex], h: list[complex], n: int) -> list[complex]:
    """z[k] = sum_l conj(h[l]) y[k + l] for k = 0..n-1 (samples past the end of y count as 0)."""
    return [sum(complex(h[l]).conjugate() * y[k + l] for l in range(len(h)) if k + l < len(y)) for k in range(n)]


def autocorrelation(h: list[complex]) -> list[complex]:
    """R[l] = sum_i h[i + l] conj(h[i]) for l = 0..L-1."""
    return [sum(complex(h[i + l]) * complex(h[i]).conjugate() for i in range(len(h) - l)) for l in range(len(h))]


def ungerboeck_metric(z: list[complex], r: list[complex], x: list[complex]) -> float:
    """The sum of the Ungerboeck increments for the sequence x (x[k] = 0 for k < 0)."""
    total = 0.0
    for k, a in enumerate(x):
        a = complex(a)
        isi = sum(r[l] * x[k - l] for l in range(1, len(r)) if k - l >= 0)
        total += 2 * (a.conjugate() * z[k]).real - r[0].real * abs(a) ** 2 - 2 * (a.conjugate() * isi).real
    return total


def ungerboeck_mlse(y: list[complex], h: list[complex], alphabet: list[complex], tail: list[complex] | None = None) -> list[complex]:
    """The maximum likelihood sequence from the received block y of length N + L - 1.

    The block holds N symbols. If tail is given, its symbols are the last ones
    and are known, so the result has N - len(tail) symbols.
    """
    taps = len(h)
    mem = taps - 1
    m = len(alphabet)
    tail = list(tail) if tail is not None else []
    total = len(y) - mem
    n = total - len(tail)
    if total < 1 or n < 0:
        raise ValueError("y must hold N + L - 1 samples with N > len(tail)")
    index = {complex(a): i for i, a in enumerate(alphabet)}
    for v in tail:
        if complex(v) not in index:
            raise ValueError("tail symbols must be in the alphabet")
    z = matched_filter(y, h, total)  # @line L1
    r = autocorrelation(h)  # @line L2
    states = m ** mem
    inf = float("inf")
    metric = [-inf] * states
    metric[0] = 0.0  # @line L3
    back = []
    for k in range(total):  # @line L4
        new = [-inf] * states
        ptr = [(-1, -1)] * states
        choices = range(m) if k < n else [index[complex(tail[k - n])]]
        for s in range(states):
            if metric[s] == -inf:
                continue
            # the ISI term from the past symbols in the state; before x[0] they are 0
            isi = 0j
            for l in range(1, min(mem, k) + 1):
                isi += r[l] * alphabet[(s // m ** (l - 1)) % m]
            for i0 in choices:  # @line L5
                a = complex(alphabet[i0])
                lam = 2 * (a.conjugate() * z[k]).real - r[0].real * abs(a) ** 2 - 2 * (a.conjugate() * isi).real  # @line L6
                t = i0 + m * (s % (m ** (mem - 1))) if mem > 0 else 0
                if metric[s] + lam > new[t]:  # @line L7
                    new[t] = metric[s] + lam
                    ptr[t] = (s, i0)
        metric = new
        back.append(ptr)
    s = max(range(states), key=lambda q: metric[q])  # @line L8
    path = []
    for k in range(total - 1, -1, -1):
        prev, i0 = back[k][s]
        path.append(alphabet[i0])
        s = prev
    path.reverse()
    return path[:n]  # @line L9


def convolve(h: list[complex], x: list[complex]) -> list[complex]:
    """The full convolution h * x of length len(x) + len(h) - 1."""
    out = [0j] * (len(x) + len(h) - 1)
    for i, a in enumerate(x):
        for l, v in enumerate(h):
            out[i + l] += v * a
    return out


def brute_force(y: list[complex], h: list[complex], alphabet: list[complex], tail: list[complex] | None = None) -> list[complex]:
    """The sequence that minimizes ||y - h * x||^2, by trying all M^n sequences (for tests)."""
    tail = list(tail) if tail is not None else []
    n = len(y) - (len(h) - 1) - len(tail)
    best, arg = float("inf"), None
    for cand in itertools.product(alphabet, repeat=n):
        out = convolve(h, list(cand) + tail)
        v = sum(abs(a - b) ** 2 for a, b in zip(y, out))
        if v < best:
            best, arg = v, list(cand)
    return arg
test_ungerboeck_mlse_receiver.py 89 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/ungerboeck-mlse-receiver/. The authors are listed in prov/REAJPJ.jsonl.

import math
import random

import pytest

from ungerboeck_mlse_receiver import (
    autocorrelation,
    brute_force,
    convolve,
    matched_filter,
    ungerboeck_metric,
    ungerboeck_mlse,
)


def cn(rng, var):
    s = math.sqrt(var / 2)
    return complex(rng.gauss(0, s), rng.gauss(0, s))


def sq(v):
    return sum(abs(a) ** 2 for a in v)


def test_example_on_the_page() -> None:
    h, y = [1, 0.5], [0.9, 0.1, -1.2, 0.6, 0.4]
    z = matched_filter(y, h, 4)
    assert max(abs(a - b) for a, b in zip(z, [0.95, -0.5, -0.9, 0.8])) < 1e-12
    assert autocorrelation(h) == [1.25, 0.5]
    d = ungerboeck_mlse(y, h, [1, -1])
    assert d == [1, -1, -1, 1]
    assert abs(ungerboeck_metric(z, autocorrelation(h), d) - 2.3) < 1e-12
    assert abs(sq(y) - sq([a - b for a, b in zip(y, convolve(h, d))]) - 2.3) < 1e-12


def test_metric_identity_for_any_y_and_x() -> None:
    rng = random.Random(7601)
    for _ in range(50):
        h = [cn(rng, 1.0) for _ in range(rng.randint(1, 5))]
        n = rng.randint(1, 12)
        x = [cn(rng, 1.0) for _ in range(n)]
        y = [cn(rng, 2.0) for _ in range(n + len(h) - 1)]
        z = matched_filter(y, h, n)
        lhs = ungerboeck_metric(z, autocorrelation(h), x)
        rhs = sq(y) - sq([a - b for a, b in zip(y, convolve(h, x))])
        assert abs(lhs - rhs) < 1e-9


def test_equals_brute_force_bpsk_with_and_without_tail() -> None:
    rng = random.Random(7602)
    for trial in range(16):
        h = [rng.gauss(0, 1) for _ in range(rng.randint(1, 4))]
        tail = [rng.choice((-1, 1)) for _ in range(len(h) - 1)] if trial % 2 else []
        x = [rng.choice((-1, 1)) for _ in range(10)] + tail
        y = [v + rng.gauss(0, 0.8) for v in convolve(h, x)]
        assert ungerboeck_mlse(y, h, [1, -1], tail=tail) == brute_force(y, h, [1, -1], tail=tail)


def test_equals_brute_force_complex_qpsk_and_4pam() -> None:
    rng = random.Random(7603)
    qpsk = [complex(a, b) for a in (-1, 1) for b in (-1, 1)]
    for _ in range(10):
        h = [cn(rng, 1.0) for _ in range(rng.randint(2, 3))]
        x = [rng.choice(qpsk) for _ in range(5)]
        y = [v + cn(rng, 1.0) for v in convolve(h, x)]
        assert ungerboeck_mlse(y, h, qpsk) == brute_force(y, h, qpsk)
    pam = [3, 1, -1, -3]
    for _ in range(3):
        h = [1.0, rng.uniform(-1, 1)]
        x = [rng.choice(pam) for _ in range(5)]
        y = [v + rng.gauss(0, 0.7) for v in convolve(h, x)]
        assert ungerboeck_mlse(y, h, pam) == brute_force(y, h, pam)


def test_noiseless_recovery_on_known_channels() -> None:
    rng = random.Random(7604)
    for h in ([1, 0.5], [0.5, 1], [0.407, 0.815, 0.407], [0.227, 0.460, 0.688, 0.460, 0.227]):
        x = [rng.choice((-1, 1)) for _ in range(300)]
        assert ungerboeck_mlse(convolve(h, x), h, [1, -1]) == x


def test_input_checks() -> None:
    with pytest.raises(ValueError):
        ungerboeck_mlse([1.0], [1, 0.5], [1, -1])
    with pytest.raises(ValueError):
        ungerboeck_mlse([1.0, 2.0, 3.0], [1, 0.5], [1, -1], tail=[2])

History

Forney's receiver of 1972 needed a whitened matched filter in front of the Viterbi algorithm. In 1974, Ungerboeck showed that the Viterbi algorithm can work on the matched filter output with a modified metric, and built an adaptive receiver for carrier-modulated data transmission around it. The two forms were often compared later. They give the same maximum likelihood decisions, but behave differently in reduced-state and soft-output receivers. The Ungerboeck form is also common for faster-than-Nyquist signaling, where the matched filter output and its autocorrelation are known by design.

References

  1. Gottfried Ungerboeck, Adaptive maximum-likelihood receiver for carrier-modulated data-transmission systems, IEEE Transactions on Communications 22(5), 1974, pages 624 to 636, the metric on the matched filter outputs and its Viterbi search
  2. G. David Forney, Jr., Maximum-likelihood sequence estimation of digital sequences in the presence of intersymbol interference, IEEE Transactions on Information Theory 18(3), 1972, pages 363 to 378, the receiver with the whitened matched filter, for comparison
  3. John G. Proakis and Masoud Salehi, Digital Communications, fifth edition, McGraw-Hill, 2008, Section 9.3 (the optimum maximum likelihood receiver for channels with ISI and its metric on the matched filter outputs)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example