Algorithm Search⌘K

Algorithmadvanced

Tong-Xu-Kailath blind identification

Also called second-order statistics blind identification.

Estimates an oversampled FIR channel, up to a phase, from the output correlations at lags 0 and 1 by whitening and a shift. It is exact when the subchannels have no common zero.

Time
O(K P^2 N^2 + P^3 N^3) worst
Space
O(P^2 N^2) extra
Where
K = the number of samples; L = the number of channel taps; N = the window length in symbols; P = the number of subchannels
Properties
blinddeterministicneeds known orderneeds white inputofflinesecond order statistics
Origin
Lang Tong, Guanghan Xu, Thomas Kailath, 1991

Tong-Xu-Kailath identification estimates a channel with one input and P≥2P \ge 2 outputs, such as a receiver that takes PP samples per symbol, from two correlation matrices of the received signal: the lag-0 matrix R(0)R(0) and the lag-1 matrix R(1)R(1) of a stacked window. It removes the noise, whitens the signal part of R(0)R(0), and uses R(1)R(1), which is the whitened channel times a shift, to read off the channel one tap at a time. The result is exact, up to a phase, when the subchannels have no common zero, the input is white with known power, and the statistics are exact. This was the first proof that second-order statistics are enough for blind equalization once the signal is oversampled, which is impossible at one sample per symbol. It differs from subspace identification, which uses only the noise subspace of R(0)R(0), needs no whitening and works for any input covariance of full rank. TXK uses the signal subspace and the lag-1 shift, and needs a white input. Both need the channel length and differ from CMA, which uses fourth-order statistics and adapts online.

In plain words

If a receiver takes two samples per symbol, it sees the same symbols through two different channels. The method measures how the received samples are correlated with each other, both within one window and between one window and the next. From the first measurement it builds a transform that makes the signal look like plain uncorrelated symbols. The second measurement, after the transform, shows how each symbol moves one step through the window. Following this step from the first symbol reveals the channel, one echo after another. It fails only if all the channels share a common zero, because then a different channel gives the same correlations.

The problem

The received vectors are y[k]=∑l=0L−1h(l) a[k−l]+w[k]∈CPy[k] = \sum_{l=0}^{L-1} h(l)\, a[k-l] + w[k] \in \mathbb{C}^P, with independent symbols of unit power and white noise of power σ2\sigma^2 on each output. The window Y[k]=(y[k];…;y[k−N+1])Y[k] = (y[k]; \ldots; y[k-N+1]) has length PNPN and equals HNs[k]H_N s[k] plus noise, where s[k]=(a[k],…,a[k−N−L+2])s[k] = (a[k], \ldots, a[k-N-L+2]) and HNH_N is the block Toeplitz matrix with block (i,m)(i, m) equal to h(m−i)h(m-i). Let d=N+L−1d = N + L - 1 and let JJ be the d×dd \times d shift with ones just below the diagonal. Then

R(0)=E[Y[k]Y[k]H]=HNHNH+σ2I,R(1)=E[Y[k]Y[k−1]H]=HNJHNH+σ2(JN⊗IP),R(0) = E[Y[k] Y[k]^H] = H_N H_N^H + \sigma^2 I, \qquad R(1) = E[Y[k] Y[k-1]^H] = H_N J H_N^H + \sigma^2 (J_N \otimes I_P),

where JNJ_N is the N×NN \times N shift. The noise term in R(1)R(1) appears because consecutive windows overlap in N−1N - 1 samples. The input is estimates of R(0)R(0) and R(1)R(1), the noise power σ2\sigma^2 (or an estimate), PP, LL and N≥LN \ge L. The output is h^=ejθh\hat h = e^{j\theta} h.

The algorithm

  1. TXK-IDENTIFY(R(0), R(1), σ², P, L, N)
  2. 1A0 ← R(0) - σ² I; A1 ← R(1) - σ² (J_N ⊗ I_P)
  3. 2(U, Λ) ← the d = N + L - 1 largest eigenpairs of A0
  4. 3F ← Λ^(-1/2) U^H ▷ whitening, d × PN
  5. 4M ← F A1 F^H ▷ d × d, equals V J V^H
  6. 5v ← the unit eigenvector of M M^H for its smallest eigenvalue
  7. 6for l ← 0 to L - 1 do
  8. 7h(l) ← block 0 of U Λ^(1/2) v
  9. 8v ← M v
  10. 9return h

Line L1 removes the noise from both correlations. Line L2 keeps the signal subspace: A0=HNHNHA_0 = H_N H_N^H has rank dd. Line L3 builds a whitening matrix FF, so that V=FHNV = F H_N is a d×dd \times d unitary matrix. Line L4 maps the lag-1 correlation through FF, which gives M=VJVHM = V J V^H. Since JTJ^T has the null vector e0e_0, line L5 finds v=ejθVe0v = e^{j\theta} V e_0, the whitened first column of HNH_N. Lines L6 to L8 walk down the columns: Mlv=ejθVelM^l v = e^{j\theta} V e_l, and UΛ1/2VelU \Lambda^{1/2} V e_l is column ll of HNH_N, whose first block is h(l)h(l). If σ2\sigma^2 is unknown, the code estimates it as the mean of the PN−dPN - d smallest eigenvalues of R(0)R(0).

Example

A hand case. Two subchannels h1=(1,0.5)h_1 = (1, 0.5) and h2=(0.5,1)h_2 = (0.5, 1), so h(0)=(1,0.5)h(0) = (1, 0.5), h(1)=(0.5,1)h(1) = (0.5, 1), L=2L = 2, and N=2N = 2, d=3d = 3. Without noise,

A0=(1.2510.50.2511.2510.50.511.2510.250.511.25),A1=(0.50.250010.5001.2510.50.2511.2510.5).A_0 = \begin{pmatrix} 1.25 & 1 & 0.5 & 0.25 \\ 1 & 1.25 & 1 & 0.5 \\ 0.5 & 1 & 1.25 & 1 \\ 0.25 & 0.5 & 1 & 1.25 \end{pmatrix}, \qquad A_1 = \begin{pmatrix} 0.5 & 0.25 & 0 & 0 \\ 1 & 0.5 & 0 & 0 \\ 1.25 & 1 & 0.5 & 0.25 \\ 1 & 1.25 & 1 & 0.5 \end{pmatrix}.

The eigenvalues of A0A_0 are 0,0.329,1.25,3.4210, 0.329, 1.25, 3.421, so line L2 keeps the last three. The rest of the run gives h^=−(1,0.5,0.5,1)\hat h = -(1, 0.5, 0.5, 1): the channel with the phase π\pi. Because the input has unit power, the gain is exact; only the phase is unknown. The same output comes from R(0)R(0) with σ2=0.3\sigma^2 = 0.3 added on the diagonal and R(1)R(1) with 0.30.3 added on its block subdiagonal.

From samples. For h1=(1,0.5+0.2j,−0.3)h_1 = (1, 0.5 + 0.2j, -0.3), h2=(0.4j,1,0.6)h_2 = (0.4j, 1, 0.6), K=3000K = 3000 QPSK symbols, noise of power 0.010.01 per output and an estimated σ2\sigma^2, the largest entry error after the best phase is 1.21.2 percent of ∥h∥\|h\| for N=3N = 3 and N=4N = 4 (seed 1, a measurement). With exact statistics it is below 10−1410^{-14}.

A common zero. Let both subchannels contain the factor 1−0.5z−11 - 0.5 z^{-1}: hp=(1−0.5z−1) qp(z)h_p = (1 - 0.5 z^{-1})\, q_p(z) with q1=(1,0.3)q_1 = (1, 0.3), q2=(0.2,1)q_2 = (0.2, 1). Replace the factor by −0.5+z−1-0.5 + z^{-1}, which has the same magnitude on the unit circle. The two channels differ, but their R(0)R(0) and R(1)R(1) agree to 10−1610^{-16}, so no method that uses these statistics can tell them apart.

Correctness

Claim. Assume that the subchannels have no common zero, h(0)≠0h(0) \ne 0, h(L−1)≠0h(L-1) \ne 0, N≥LN \ge L, the input is white with unit power, and the statistics are exact. Then lines L1 to L9 return ejθhe^{j\theta} h. This is a theorem.

Key steps. First, HNH_N has full column rank dd; this needs the no-common-zero condition, and for P=2P = 2 it is Lemma 1 of the subspace page's proof. So A0=UΛUHA_0 = U \Lambda U^H with dd positive eigenvalues, and V=FHNV = F H_N satisfies VVH=Λ−1/2UHA0UΛ−1/2=IV V^H = \Lambda^{-1/2} U^H A_0 U \Lambda^{-1/2} = I, so VV is unitary. Second, the input correlation at lag 1 is JJ, so M=VJVHM = V J V^H, and MHx=0M^H x = 0 exactly when VHxV^H x is a multiple of e0e_0. Third, MlVe0=VJle0=VelM^l V e_0 = V J^l e_0 = V e_l, and UΛ1/2Vel=UUHHNel=HNelU \Lambda^{1/2} V e_l = U U^H H_N e_l = H_N e_l, whose block 0 is h(l)h(l). The proofs folder has the details.

The condition is also necessary. If the subchannels share a zero, flipping it to its reciprocal conjugate in every subchannel changes hh but, with a white input, keeps R(m)R(m) for every lag mm. The example above shows this. So no method can identify such a channel from second-order statistics.

What it needs. The white input with known power is part of the model: with a colored input, R(1)R(1) has HNRa(1)HNHH_N R_a(1) H_N^H in place of HNJHNHH_N J H_N^H, and the shift structure breaks. The channel length LL must be right, for the rank dd in line L2.

Proof: With exact correlations, a white input of unit power and subchannels with no common zero, the TXK steps return the channel up to a phasefull

Setting. The window Y[k]=HNs[k]+n[k]Y[k] = H_N s[k] + n[k] has length PNPN, where HNH_N is the PN×dPN \times d block Toeplitz matrix with block (i,m)(i, m) equal to h(m−i)h(m - i), d=N+L−1d = N + L - 1, and s[k]=(a[k],a[k−1],…,a[k−d+1])s[k] = (a[k], a[k-1], \ldots, a[k-d+1]). The symbols are independent with Ea=0E a = 0 and E∣a∣2=1E|a|^2 = 1. The noise n[k]n[k] stacks w[k],…,w[k−N+1]w[k], \ldots, w[k-N+1], white with power σ2\sigma^2 on each output and independent of the symbols. JJ is the d×dd \times d matrix with Ji,j=1J_{i, j} = 1 if i=j+1i = j + 1 and 00 otherwise, and JNJ_N is the same for size NN. Indices start at 0, and eje_j is unit vector jj.

Lemma 1 (the correlations). R(0)=HNHNH+σ2IR(0) = H_N H_N^H + \sigma^2 I and R(1)=HNJHNH+σ2(JN⊗IP)R(1) = H_N J H_N^H + \sigma^2 (J_N \otimes I_P).

Proof. E[s[k]i s[k]j‾]=E[a[k−i] a[k−j]‾]=δijE[s[k]_i\, \overline{s[k]_j}] = E[a[k-i]\, \overline{a[k-j]}] = \delta_{ij}, so E[s[k]s[k]H]=IE[s[k] s[k]^H] = I. For lag 1, E[s[k]i s[k−1]j‾]=E[a[k−i] a[k−1−j]‾]E[s[k]_i\, \overline{s[k-1]_j}] = E[a[k-i]\, \overline{a[k-1-j]}], which is 1 if i=j+1i = j + 1 and 0 otherwise, so E[s[k]s[k−1]H]=JE[s[k] s[k-1]^H] = J. For the noise, block (i,j)(i, j) of E[n[k]n[k−1]H]E[n[k] n[k-1]^H] is E[w[k−i] w[k−1−j]H]E[w[k-i]\, w[k-1-j]^H], which is σ2IP\sigma^2 I_P if i=j+1i = j + 1 and 0 otherwise; this is σ2(JN⊗IP)\sigma^2 (J_N \otimes I_P). The cross terms vanish by independence and zero means. □\square

So line L1 gives A0=HNHNHA_0 = H_N H_N^H and A1=HNJHNHA_1 = H_N J H_N^H exactly.

Lemma 2 (rank). If the subchannels have no common zero, h(0)≠0h(0) \ne 0, h(L−1)≠0h(L-1) \ne 0 and N≥L−1N \ge L - 1, then HNH_N has full column rank dd.

For P=2P = 2 this is Lemma 1 in the proof on the subspace identification page, which is complete. For P>2P > 2, a common zero of all subchannels is the only obstruction; this is the result of Tong, Xu and Kailath (1994) and Moulines and others (1995), cited and not proved here. If two of the PP subchannels already have no common zero, the P=2P = 2 proof applies to their rows, and the full matrix, which has more rows, has full column rank as well.

Theorem. Under the conditions of Lemma 2, lines L1 to L9 return h^=ejθh\hat h = e^{j\theta} h for some real θ\theta.

Proof. By Lemma 2, A0=HNHNHA_0 = H_N H_N^H is positive semidefinite with rank dd, and its range equals the range of HNH_N. Line L2 takes A0=UΛUHA_0 = U \Lambda U^H with UU of size PN×dPN \times d, orthonormal columns, and Λ\Lambda diagonal and positive. Then UUHU U^H is the orthogonal projector onto the range of HNH_N, so UUHHN=HNU U^H H_N = H_N.

Step 1: V is unitary. Let F=Λ−1/2UHF = \Lambda^{-1/2} U^H (line L3) and V=FHNV = F H_N, a d×dd \times d matrix. Then

VVH=Λ−1/2UHHNHNHUΛ−1/2=Λ−1/2UH(UΛUH)UΛ−1/2=I.V V^H = \Lambda^{-1/2} U^H H_N H_N^H U \Lambda^{-1/2} = \Lambda^{-1/2} U^H (U \Lambda U^H) U \Lambda^{-1/2} = I.

A square matrix with VVH=IV V^H = I is unitary.

Step 2: M. Line L4 gives M=FA1FH=FHNJHNHFH=VJVHM = F A_1 F^H = F H_N J H_N^H F^H = V J V^H.

Step 3: the null vector. MMH=VJJTVHM M^H = V J J^T V^H, and JJTJ J^T is diagonal with entries (0,1,…,1)(0, 1, \ldots, 1): row 0 of JJ is zero and every other row has a single 1. So the eigenvalues of MMHM M^H are 00 once and 11 with multiplicity d−1d - 1, and the eigenvector for 00 is Ve0V e_0. Line L5 returns v=ejθVe0v = e^{j\theta} V e_0 for some θ\theta, since a unit eigenvector of a simple eigenvalue is fixed up to a unit scalar.

Step 4: the walk. Jel=el+1J e_l = e_{l+1} for l<d−1l < d - 1, so MlVe0=VJlVHVe0=VJle0=VelM^l V e_0 = V J^l V^H V e_0 = V J^l e_0 = V e_l for l≤d−1l \le d - 1. Since L≤dL \le d, after ll passes through line L8, v=ejθVelv = e^{j\theta} V e_l for l=0,…,L−1l = 0, \ldots, L - 1.

Step 5: back to the channel. UΛ1/2Vel=UΛ1/2Λ−1/2UHHNel=UUHHNel=HNelU \Lambda^{1/2} V e_l = U \Lambda^{1/2} \Lambda^{-1/2} U^H H_N e_l = U U^H H_N e_l = H_N e_l, which is column ll of HNH_N. Block 0 of that column is h(l−0)=h(l)h(l - 0) = h(l). So line L7 sets h^(l)=ejθh(l)\hat h(l) = e^{j\theta} h(l) for every ll. □\square

The unknown noise power. If σ2\sigma^2 is not given, the code takes the mean of the PN−dPN - d smallest eigenvalues of R(0)R(0). By Lemma 1 and Lemma 2, R(0)R(0) has exactly PN−dPN - d eigenvalues equal to σ2\sigma^2 and dd eigenvalues larger than σ2\sigma^2, so the estimate is exact with exact statistics.

Necessity of the condition. Suppose every subchannel has the factor (1−z0z−1)(1 - z_0 z^{-1}), with z0≠0z_0 \ne 0 and ∣z0∣≠1|z_0| \ne 1, and let h′h' be the channel in which this factor is replaced by (−zˉ0+z−1)(-\bar z_0 + z^{-1}) in every subchannel. On the unit circle ∣−zˉ0+e−jω∣=∣1−z0e−jω∣|{-\bar z_0} + e^{-j\omega}| = |1 - z_0 e^{-j\omega}|, so the matrix spectrum ∑l∑l′h(l)h(l′)He−jω(l−l′)\sum_l \sum_{l'} h(l) h(l')^H e^{-j\omega (l - l')} of h′h' equals that of hh. With a white input, the output correlation at every lag is a Fourier coefficient of that spectrum, so R(m)R(m) is the same for hh and h′h' at every lag mm. The two channels are not related by a scalar, so no method based on second-order statistics can identify the channel. The test test_a_common_zero_flipped_by_an_allpass_gives_the_same_statistics checks this for z0=0.5z_0 = 0.5.

Remark on the white input. If E[s[k]s[k]H]=Ra≠IE[s[k] s[k]^H] = R_a \ne I or the lag-1 input correlation is not JJ, then Step 1 gives VVH=Λ−1/2UHHNRaHNHUΛ−1/2V V^H = \Lambda^{-1/2} U^H H_N R_a H_N^H U \Lambda^{-1/2} in place of the identity, and Step 3 fails. The input model is part of the method.

Complexity

Estimating R(0)R(0) and R(1)R(1) from KK samples costs O(KP2N2)O(K P^2 N^2). The eigenproblem of line L2 costs O(P3N3)O(P^3 N^3). Lines L3 to L5 multiply matrices of size at most PNPN, which costs O(P3N3)O(P^3 N^3), and line L5 is an eigenproblem of size d≤PNd \le PN. Lines L6 to L8 cost O(Ld2)O(L d^2). The extra space is O(P2N2)O(P^2 N^2). All counts are in the real RAM.

Properties

  • Blind and second order. It needs only R(0)R(0), R(1)R(1) and the input power, not the alphabet.
  • Only a phase is unknown. With a white input of known power, the gain of hh is found exactly; only ejθe^{j\theta} remains.
  • Batch. It needs enough samples to estimate the correlations.
  • Needs a white input. The shift structure in line L4 depends on it.
  • Works for nonminimum-phase channels. The oversampling breaks the phase ambiguity of symbol-rate second-order statistics.

Variants and improvements

  • The subspace method. Subspace identification uses the noise subspace of R(0)R(0) alone. It does not need a white input or R(1)R(1).
  • Frequency-domain form. The cyclostationary correlation of the oversampled signal gives the same information in the frequency domain; see cyclostationary feature detection for the property used.
  • Using more lags. Using R(m)R(m) for several lags mm, or a least squares fit of the shift structure, reduces the variance.
  • Cross-relation method. The identity hq∗yp=hp∗yqh_q * y_p = h_p * y_q between pairs of outputs gives a least squares estimate directly from the data.
  • Equalization from the estimate. With h^\hat h, an FIR zero-forcing or MMSE fractionally spaced equalizer can be designed directly; with no common zero, an exact FIR zero-forcing equalizer exists.

When to use it

Use it as a direct, closed form way to identify an oversampled channel from short blocks when the input is white and its power is known. It is also the cleanest demonstration that oversampling makes second-order blind identification possible. The subspace method avoids the whitening and the walk of line L8, whose errors grow along the taps, so it is often preferred. CMA is used when the receiver must adapt online.

Pitfalls

  • Leaving out the noise term of R(1) in line L1. Consecutive windows share N−1N - 1 samples, so the noise contributes σ2(JN⊗IP)\sigma^2 (J_N \otimes I_P) to R(1)R(1), not zero. Without this term, the estimate is biased.
  • A wrong rank in line L2. If LL is wrong, dd is wrong, and the whitening keeps a noise direction or drops a signal direction.
  • Nearly common zeros. If the subchannels nearly share a zero, the smallest kept eigenvalue in line L2 is small, Λ−1/2\Lambda^{-1/2} amplifies the estimation error, and the result is poor.
  • Errors that grow along the walk in line L8. Each step multiplies by MM, so an error in vv or MM grows over the taps. Late taps are less accurate than early ones.
  • A colored or unknown-power input. The method assumes E[ssH]=IE[s s^H] = I. Scale the data first if the power is known; use the subspace method if the input is colored.

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.

tong_xu_kailath_identification.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/tong-xu-kailath-identification/. The authors are listed in prov/WX9EA1.jsonl.

"""Tong-Xu-Kailath blind identification from the correlations at lags 0 and 1.

The channel has P outputs and L taps: y[k] = sum_l h(l) a[k-l] + w[k], with
h(l) a vector of length P, white symbols of unit power and white noise of
power sigma^2. The stacked channel h = (h(0); ...; h(L-1)) has length P L,
so h[l*P + p] is tap l of subchannel p.

The window Y[k] = (y[k]; ...; y[k-N+1]) is H_N s[k] + noise, with the
block Toeplitz H_N (block (i, m) = h(m - i)) and s[k] = (a[k], ..., a[k-N-L+2]).
Its correlations are
    R(0) = E[Y[k] Y[k]^H]   = H_N H_N^H + sigma^2 I,
    R(1) = E[Y[k] Y[k-1]^H] = H_N J H_N^H + sigma^2 (J_N kron I_P),
where J is the shift with ones just below the diagonal. With no common zero
of the subchannels and N >= L, H_N has full column rank d = N + L - 1. Then
F = Lambda^(-1/2) U^H from the d nonzero eigenpairs of R(0) - sigma^2 I
makes V = F H_N unitary, M = F (R(1) - sigma^2 J_N kron I_P) F^H = V J V^H,
the first column v_0 of V spans the null space of M^H, the next columns are
v_l = M^l v_0, and h(l) is block 0 of U Lambda^(1/2) v_l.
"""

import math


def jacobi_eigh(a: list[list[float]], tol: float = 1e-14, sweeps: int = 100) -> tuple[list[float], list[list[float]]]:
    """Eigenvalues (ascending) and eigenvectors of a real symmetric matrix, by cyclic Jacobi rotations."""
    n = len(a)
    m = [list(map(float, r)) for r in a]
    v = [[1.0 if i == k else 0.0 for k in range(n)] for i in range(n)]
    for _ in range(sweeps):
        off = sum(m[i][k] ** 2 for i in range(n) for k in range(n) if i != k)
        if off <= tol * tol * max(1.0, sum(m[i][i] ** 2 for i in range(n))):
            break
        for p in range(n - 1):
            for q in range(p + 1, n):
                if m[p][q] == 0.0:
                    continue
                theta = (m[q][q] - m[p][p]) / (2.0 * m[p][q])
                t = (1.0 if theta >= 0 else -1.0) / (abs(theta) + math.sqrt(theta * theta + 1.0))
                c = 1.0 / math.sqrt(t * t + 1.0)
                s = t * c
                for r in range(n):
                    mrp, mrq = m[r][p], m[r][q]
                    m[r][p], m[r][q] = c * mrp - s * mrq, s * mrp + c * mrq
                for r in range(n):
                    mpr, mqr = m[p][r], m[q][r]
                    m[p][r], m[q][r] = c * mpr - s * mqr, s * mpr + c * mqr
                for r in range(n):
                    vrp, vrq = v[r][p], v[r][q]
                    v[r][p], v[r][q] = c * vrp - s * vrq, s * vrp + c * vrq
    order = sorted(range(n), key=lambda i: m[i][i])
    return [m[i][i] for i in order], [[v[r][i] for r in range(n)] for i in order]


def hermitian_eigh(a: list[list[complex]]) -> tuple[list[float], list[list[complex]]]:
    """Eigenpairs of a Hermitian matrix, one per eigenvalue, ascending, with orthonormal eigenvectors.

    The real form [[B, -C], [C, B]] of A = B + j C has each eigenvalue twice.
    The pairs are split by Gram-Schmidt: a complex vector is kept only if it
    is not in the span of the vectors kept so far.
    """
    n = len(a)
    big = [[0.0] * (2 * n) for _ in range(2 * n)]
    for i in range(n):
        for k in range(n):
            b, c = complex(a[i][k]).real, complex(a[i][k]).imag
            big[i][k] = b
            big[i + n][k + n] = b
            big[i][k + n] = -c
            big[i + n][k] = c
    vals, vecs = jacobi_eigh(big)
    out_vals, out_vecs = [], []
    for lam, v in zip(vals, vecs):
        u = [complex(v[i], v[i + n]) for i in range(n)]
        for w in out_vecs:
            ip = sum(x.conjugate() * y for x, y in zip(w, u))
            u = [y - ip * x for x, y in zip(w, u)]
        nu = math.sqrt(sum(abs(x) ** 2 for x in u))
        if nu > 0.5 and len(out_vecs) < n:
            out_vals.append(lam)
            out_vecs.append([x / nu for x in u])
    return out_vals, out_vecs


def block_toeplitz(h: list[complex], p: int, n: int) -> list[list[complex]]:
    """The P N by (N + L - 1) matrix H_N, with block (i, m) equal to h(m - i)."""
    taps = len(h) // p
    out = [[0j] * (n + taps - 1) for _ in range(p * n)]
    for i in range(n):
        for l in range(taps):
            for q in range(p):
                out[i * p + q][i + l] = complex(h[l * p + q])
    return out


def correlations(y: list[list[complex]], n: int) -> tuple[list[list[complex]], list[list[complex]]]:
    """Sample estimates of R(0) = E[Y[k] Y[k]^H] and R(1) = E[Y[k] Y[k-1]^H] from the windows of N outputs."""
    wins = [[complex(v) for i in range(n) for v in y[k - i]] for k in range(n - 1, len(y))]
    d = len(wins[0])
    r0 = [[0j] * d for _ in range(d)]
    r1 = [[0j] * d for _ in range(d)]
    for t in range(len(wins)):
        w = wins[t]
        wc = [v.conjugate() for v in w]
        for i in range(d):
            for k in range(d):
                r0[i][k] += w[i] * wc[k]
        if t > 0:
            pc = [v.conjugate() for v in wins[t - 1]]
            for i in range(d):
                for k in range(d):
                    r1[i][k] += w[i] * pc[k]
    k0, k1 = len(wins), len(wins) - 1
    return [[v / k0 for v in r] for r in r0], [[v / k1 for v in r] for r in r1]


def txk_identify(
    r0: list[list[complex]], r1: list[list[complex]], p: int, taps: int, n: int, sigma2: float | None = None
) -> list[complex]:
    """Estimate h (length P L, up to a unit complex scalar) from R(0) and R(1) of windows of N outputs.

    If sigma2 is None, it is estimated as the mean of the P N - (N + L - 1) smallest eigenvalues of R(0).
    """
    d = n + taps - 1
    dim = p * n
    if p < 2 or taps < 1 or n < taps or len(r0) != dim or len(r1) != dim or dim <= d:
        raise ValueError("need P >= 2, N >= L, P N > N + L - 1 and R of size P N")
    if sigma2 is None:
        vals0, _ = hermitian_eigh(r0)
        sigma2 = sum(vals0[: dim - d]) / (dim - d)
    a0 = [[r0[i][k] - (sigma2 if i == k else 0) for k in range(dim)] for i in range(dim)]  # @line L1
    a1 = [[r1[i][k] - (sigma2 if i == k + p else 0) for k in range(dim)] for i in range(dim)]  # @line L1
    vals, vecs = hermitian_eigh(a0)  # @line L2
    lam, us = vals[dim - d :], vecs[dim - d :]  # @line L2
    if min(lam) <= 0:
        raise ValueError("R(0) - sigma^2 I has fewer than N + L - 1 positive eigenvalues")
    f = [[us[r][i].conjugate() / math.sqrt(lam[r]) for i in range(dim)] for r in range(d)]  # @line L3
    fa = [[sum(f[r][i] * a1[i][k] for i in range(dim)) for k in range(dim)] for r in range(d)]  # @line L4
    m = [[sum(fa[r][k] * f[c][k].conjugate() for k in range(dim)) for c in range(d)] for r in range(d)]  # @line L4
    mmh = [[sum(m[r][k] * m[c][k].conjugate() for k in range(d)) for c in range(d)] for r in range(d)]  # @line L5
    v = hermitian_eigh(mmh)[1][0]  # @line L5
    h = []
    for _ in range(taps):  # @line L6
        col = [sum(us[r][i] * math.sqrt(lam[r]) * v[r] for r in range(d)) for i in range(p)]  # @line L7
        h.extend(col)  # @line L7
        v = [sum(m[r][c] * v[c] for c in range(d)) for r in range(d)]  # @line L8
    return h  # @line L9
test_tong_xu_kailath_identification.py 109 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/tong-xu-kailath-identification/. The authors are listed in prov/WX9EA1.jsonl.

import math
import random

import pytest

from tong_xu_kailath_identification import block_toeplitz, correlations, hermitian_eigh, txk_identify


def conv(a, b):
    out = [0j] * (len(a) + len(b) - 1)
    for i, x in enumerate(a):
        for k, y in enumerate(b):
            out[i + k] += x * y
    return out


def stack_subchannels(subs):
    return [complex(subs[p][l]) for l in range(len(subs[0])) for p in range(len(subs))]


def exact_correlations(h, p, n, s2):
    hn = block_toeplitz(h, p, n)
    d, c = len(hn), len(hn[0])
    r0 = [[sum(hn[i][m] * hn[k][m].conjugate() for m in range(c)) + (s2 if i == k else 0) for k in range(d)] for i in range(d)]
    r1 = [[sum(hn[i][m] * hn[k][m - 1].conjugate() for m in range(1, c)) + (s2 if i == k + p else 0) for k in range(d)] for i in range(d)]
    return r0, r1


def phase_aligned_error(he, h):
    # max |e^(j phi) he - h| over the entries, with the best phase phi
    ip = sum(a.conjugate() * b for a, b in zip(he, h))
    ph = ip / abs(ip)
    return max(abs(a * ph - b) for a, b in zip(he, h))


H3 = stack_subchannels([[1, 0.5 + 0.2j, -0.3], [0.4j, 1, 0.6]])


def test_eigensolver_splits_the_pairs() -> None:
    rng = random.Random(2)
    n = 4
    a = [[0j] * n for _ in range(n)]
    for i in range(n):
        a[i][i] = complex(rng.gauss(0, 1))
        for k in range(i + 1, n):
            a[i][k] = complex(rng.gauss(0, 1), rng.gauss(0, 1))
            a[k][i] = a[i][k].conjugate()
    vals, vecs = hermitian_eigh(a)
    assert len(vals) == n
    for lam, v in zip(vals, vecs):
        av = [sum(a[i][k] * v[k] for k in range(n)) for i in range(n)]
        assert max(abs(x - lam * y) for x, y in zip(av, v)) < 1e-10
    for i in range(n):
        for k in range(n):
            ip = sum(x.conjugate() * y for x, y in zip(vecs[i], vecs[k]))
            assert abs(ip - (1 if i == k else 0)) < 1e-10


def test_hand_example() -> None:
    h = stack_subchannels([[1, 0.5], [0.5, 1]])
    r0, r1 = exact_correlations(h, 2, 2, 0.3)
    he = txk_identify(r0, r1, 2, 2, 2, 0.3)
    assert phase_aligned_error(he, h) < 1e-9


def test_exact_statistics_give_the_channel_up_to_a_phase() -> None:
    for n in (3, 4):
        r0, r1 = exact_correlations(H3, 2, n, 0.1)
        assert phase_aligned_error(txk_identify(r0, r1, 2, 3, n, 0.1), H3) < 1e-9
        # the noise power estimated from the smallest eigenvalues of R(0) is exact too
        assert phase_aligned_error(txk_identify(r0, r1, 2, 3, n), H3) < 1e-9


def test_sample_statistics_give_a_small_error() -> None:
    rng = random.Random(1)
    k = 3000
    s = math.sqrt(0.005)
    a = [complex(rng.choice((-1, 1)), rng.choice((-1, 1))) / math.sqrt(2) for _ in range(k)]
    y = [
        [sum(H3[l * 2 + q] * a[t - l] for l in range(3) if t - l >= 0) + complex(rng.gauss(0, s), rng.gauss(0, s)) for q in range(2)]
        for t in range(k)
    ]
    norm = math.sqrt(sum(abs(v) ** 2 for v in H3))
    for n in (3, 4):
        r0, r1 = correlations(y, n)
        assert phase_aligned_error(txk_identify(r0, r1, 2, 3, n), H3) / norm < 0.05


def test_a_common_zero_flipped_by_an_allpass_gives_the_same_statistics() -> None:
    # (1 - 0.5 z^-1) and (-0.5 + z^-1) have the same magnitude on the unit circle
    q1, q2 = [1, 0.3], [0.2, 1]
    ha = stack_subchannels([conv([1, -0.5], q1), conv([1, -0.5], q2)])
    hb = stack_subchannels([conv([-0.5, 1], q1), conv([-0.5, 1], q2)])
    a0, a1 = exact_correlations(ha, 2, 3, 0.1)
    b0, b1 = exact_correlations(hb, 2, 3, 0.1)
    assert max(abs(a0[i][k] - b0[i][k]) for i in range(6) for k in range(6)) < 1e-12
    assert max(abs(a1[i][k] - b1[i][k]) for i in range(6) for k in range(6)) < 1e-12
    assert phase_aligned_error(ha, hb) > 0.1


def test_bad_input() -> None:
    r0, r1 = exact_correlations(H3, 2, 3, 0.1)
    with pytest.raises(ValueError):
        txk_identify(r0, r1, 2, 3, 2)
    with pytest.raises(ValueError):
        txk_identify(r0, r1, 1, 3, 6)

History

Lang Tong, Guanghan Xu and Thomas Kailath presented the method in 1991 and published the full time-domain version in 1994. It showed that, unlike at the symbol rate, second-order statistics of a fractionally sampled output identify the channel, including its phase, if the subchannels have no common zero. It started a line of second-order blind methods, among them the subspace method of Moulines, Duhamel, Cardoso and Mayrargue (1995) and the cross-relation method of Xu, Liu, Tong and Kailath (1995).

References

  1. Lang Tong, Guanghan Xu and Thomas Kailath, Blind identification and equalization based on second-order statistics: a time domain approach, IEEE Transactions on Information Theory 40(2), 1994, pages 340 to 349, the identifiability condition (no common zero of the subchannels) and the identification algorithm from the correlations at lags 0 and 1
  2. Lang Tong, Guanghan Xu and Thomas Kailath, A new approach to blind identification and equalization of multipath channels, Conference Record of the 25th Asilomar Conference on Signals, Systems and Computers, Pacific Grove, 1991, volume 2, pages 856 to 860, the first, conference version of the method; this page relies on the 1994 journal version
  3. Eric Moulines, Pierre Duhamel, Jean-Francois Cardoso and Sylvie Mayrargue, Subspace methods for the blind identification of multichannel FIR filters, IEEE Transactions on Signal Processing 43(2), 1995, pages 516 to 525, the full column rank of the block Toeplitz channel matrix, used here as a lemma
  4. C. Richard Johnson, Jr., Philip Schniter, Thomas J. Endres, James D. Behm, Donald R. Brown and Raul A. Casas, Blind equalization using the constant modulus criterion: a review, Proceedings of the IEEE 86(10), 1998, starting at page 1927, the background on fractionally spaced blind equalization and the role of second-order methods

Where this leads

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