Algorithm Search⌘K

Algorithmcore

V-BLAST

Also called vertical BLAST, ordered successive interference cancellation.

Detects the spatially multiplexed streams one at a time, the stream with the best post-detection SNR first, nulling the streams not yet detected and cancelling each decision.

Time
O(n^3 m + n^4 + n M) worst
Space
O(n m) extra
Counts
time per vector after setup O(n m + n M) worst
Where
M = the constellation size; m = the number of receive antennas; n = the number of transmitted streams
Properties
deterministicnot exact mlnot linearmmse nulling reaches capacity with codingorder depends only on channelorder maximizes smallest snr
Origin
Peter W. Wolniansky, Gerard J. Foschini, Glen D. Golden, Reinaldo A. Valenzuela, 1998

V-BLAST (vertical Bell Laboratories layered space-time) is the receiver that made spatial multiplexing practical. It solves the MIMO detection problem one stream at a time. At each step it computes the nulling filter of the zero-forcing MIMO detector or the MMSE MIMO detector for the streams not yet detected, picks the stream with the highest post-detection SNR, slices it, and subtracts its contribution from the received vector. Each cancellation removes one interferer, so the later streams see a channel with fewer columns and less noise enhancement. The detector differs from the linear detectors because it uses its own decisions, and from multiuser successive interference cancellation because it chooses the order from the post-detection SNR of the channel matrix, not from the received power of each user. The order maximizes the smallest post-detection SNR over all n!n! orders (a theorem). A wrong decision propagates to the later streams, so V-BLAST is still far from ML at high SNR. D-BLAST uses the same receiver on a diagonal layering that removes the rate loss in slow fading.

In plain words

Several antennas send different symbols at the same time. The receiver first finds the one symbol that it can see most clearly, after it blocks out the others. It decides that symbol. Then it subtracts that symbol from what it received, as if that antenna had never sent anything. Now the problem is smaller, and the next symbol is easier to see. The receiver repeats this until all symbols are decided. Starting with the clearest symbol is important: an early mistake spoils every later step, so the receiver makes its first decisions where a mistake is least likely.

The problem

The model is y=Hx+wy = H x + w. Here H∈Cm×nH \in \mathbb{C}^{m \times n} is the known channel matrix with columns h1,…,hnh_1, \ldots, h_n, x∈Snx \in \mathcal{S}^n holds one point of a constellation S\mathcal{S} of size MM and energy EsE_s per stream, and w∼CN(0,N0I)w \sim \mathcal{CN}(0, N_0 I). ZF nulling needs m≥nm \ge n and full column rank. MMSE nulling works for every mm and needs N0>0N_0 > 0. For a set KK of streams, HKH_K is the matrix of the columns in KK. The output is a decision x^∈Sn\hat x \in \mathcal{S}^n and the order in which the streams were detected.

The algorithm

  1. V-BLAST(y, H, S, a) ▷ a = 0 for ZF nulling, a = N0/Es for MMSE
  2. 1r ← y; K ← {1, ..., n}
  3. 2while K is not empty
  4. 3P ← (H_Kᴴ H_K + a I)⁻¹; W ← P H_Kᴴ
  5. 4k ← the stream in K with the smallest P_kk
  6. 5z ← (row k of W) r ▷ for MMSE, divide by 1 - a P_kk
  7. 6x̂_k ← the point of S nearest to z
  8. 7r ← r - h_k x̂_k
  9. 8K ← K \ {k}
  10. 9return x̂

Line L3 is the nulling filter for the streams still in KK. For ZF (a=0a = 0) the stream kk has the post-detection SNR (Es/N0)/Pkk(E_s / N_0) / P_{kk}, and for MMSE it has the unbiased SINR 1/(aPkk)−11 / (a P_{kk}) - 1, so line L4 picks the stream with the best SNR or SINR in both cases. Line L5 for MMSE removes the bias of the MMSE estimate, as in the MMSE MIMO detector. Line L7 cancels the decided stream. If the decision is right, the new rr equals HK∖kxK∖k+wH_{K \setminus k} x_{K \setminus k} + w, a smaller problem of the same kind. Lines L3 and L4 depend only on HH and aa, so a receiver computes the order and the nulling rows once per channel and reuses them for every received vector of a block.

Example

Take m=n=2m = n = 2, BPSK with S={+1,−1}\mathcal{S} = \{+1, -1\}, Es=1E_s = 1, and the real channel

H=(2111),(HTH)−1=(2−3−35).H = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}, \qquad (H^T H)^{-1} = \begin{pmatrix} 2 & -3 \\ -3 & 5 \end{pmatrix}.

The transmitter sends x=(+1,−1)x = (+1, -1), so Hx=(1,0)H x = (1, 0). The noise is w=(−0.3,0.4)w = (-0.3, 0.4), and the receiver gets y=(0.7,0.4)y = (0.7, 0.4). The plain ZF output is H−1y=(0.3,0.1)H^{-1} y = (0.3, 0.1), which gives (+1,+1)(+1, +1): stream 2 is wrong.

V-BLAST with ZF nulling runs as follows.

  1. Lines L3 and L4: P11=2<P22=5P_{11} = 2 < P_{22} = 5, so stream 1 goes first. Its nulling row is row 1 of H−1H^{-1}, (1,−1)(1, -1), and line L5 gives z=0.7−0.4=0.3z = 0.7 - 0.4 = 0.3, so x^1=+1\hat x_1 = +1.
  2. Line L7: r=y−h1⋅(+1)=(0.7−2,0.4−1)=(−1.3,−0.6)r = y - h_1 \cdot (+1) = (0.7 - 2, 0.4 - 1) = (-1.3, -0.6).
  3. Now K={2}K = \{2\} and P=1/∥h2∥2=1/2P = 1 / \|h_2\|^2 = 1/2. Line L5 gives z=(h2Tr)/2=−1.9/2=−0.95z = (h_2^T r) / 2 = -1.9 / 2 = -0.95, so x^2=−1\hat x_2 = -1.

The decision (+1,−1)(+1, -1) is right, and it is also the ML decision: its metric ∥y−Hx∥2=0.25\|y - H x\|^2 = 0.25 is the smallest of the four candidates (the others give 3.05, 7.85 and 19.45). In units of Es/N0E_s / N_0, the post-detection SNRs of the two steps are 1/2=0.51/2 = 0.5 and ∥h2∥2=2\|h_2\|^2 = 2. The other order would give 1/5=0.21/5 = 0.2 for stream 2 first and then ∥h1∥2=5\|h_1\|^2 = 5. V-BLAST takes the order whose worse step is better, 0.5 against 0.2.

The other order also fails on this yy. Stream 2 first gives z=−0.7+2⋅0.4=0.1z = -0.7 + 2 \cdot 0.4 = 0.1, so x^2=+1\hat x_2 = +1, which is wrong. The cancellation then subtracts the wrong symbol: r=y−h2=(−0.3,−0.6)r = y - h_2 = (-0.3, -0.6), and z=(h1Tr)/5=−0.24z = (h_1^T r) / 5 = -0.24 gives x^1=−1\hat x_1 = -1, which is wrong too. This is error propagation.

Correctness

The proof is in proofs/correctness.md. It shows four things. First, with ZF nulling and no noise, every step sees its stream with no interference, and V-BLAST returns xx (a theorem). Second, the post-detection SNR of a stream can only grow when other streams leave KK, for ZF and for MMSE (a theorem). Third, from this monotonicity, an exchange argument shows that the greedy choice of line L4 maximizes the smallest post-detection SNR or SINR over all n!n! orders, assuming correct earlier decisions (a theorem). Fourth, with MMSE nulling and correct cancellation, ∑klog⁡2(1+SINRk)=log⁡2det⁡(I+(Es/N0)HHH)\sum_k \log_2 (1 + \mathrm{SINR}_k) = \log_2 \det(I + (E_s / N_0) H^H H) in every order, so per-stream coding at these rates reaches the MIMO capacity of the channel (a theorem, Tse and Viswanath, Section 8.3.4).

Proof: V-BLAST is exact without noise, its order maximizes the smallest post-detection SNR, and MMSE nulling with correct cancellation adds up to the capacityfull

The model is y=Hx+wy = H x + w with H∈Cm×nH \in \mathbb{C}^{m \times n}, columns h1,…,hnh_1, \ldots, h_n, x∈Snx \in \mathcal{S}^n with E∣xk∣2=EsE|x_k|^2 = E_s, and w∼CN(0,N0Im)w \sim \mathcal{CN}(0, N_0 I_m). For a set KK of streams and k∈Kk \in K, let HKH_K be the matrix of the columns in KK, let HK∖kH_{K \setminus k} be the same matrix without column kk, and let PK=(HKHHK+aI)−1P^K = (H_K^H H_K + a I)^{-1}, with a=0a = 0 (ZF, which needs HH of full column rank) or a=N0/Es>0a = N_0 / E_s > 0 (MMSE). The entry of PKP^K that belongs to stream kk is written PkkKP^K_{kk}.

All SNR statements below assume that the earlier decisions are right. Then, before the step that detects kk from the set KK, line L7 has left r=HKxK+wr = H_K x_K + w.

Theorem 1 (exact without noise). With ZF nulling and w=0w = 0, V-BLAST returns xx.

Proof. By induction over the steps, the invariant is r=HKxKr = H_K x_K. At the start K={1,…,n}K = \{1, \ldots, n\} and r=y=Hxr = y = H x. At a step with the set KK, the nulling matrix is W=PKHKH=(HKHHK)−1HKHW = P^K H_K^H = (H_K^H H_K)^{-1} H_K^H, so WHK=IW H_K = I and Wr=xKW r = x_K. Row kk gives z=xkz = x_k, a point of S\mathcal{S}, so line L6 returns xkx_k at distance 0. Line L7 then gives r=HKxK−hkxk=HK∖kxK∖kr = H_K x_K - h_k x_k = H_{K \setminus k} x_{K \setminus k}, and line L8 gives the invariant for the new set. □\square

Lemma 2 (the SNR of one step). Let d(k,K)d(k, K) be the post-detection SNR (ZF) or the unbiased SINR (MMSE) of stream kk at the step with the set KK. Then

d(k,K)=EsN0 ∥ΠK∖k⊥hk∥2=Es/N0PkkK(ZF),d(k,K)=hkH(HK∖kHK∖kH+aI)−1hk=1aPkkK−1(MMSE),d(k, K) = \frac{E_s}{N_0} \, \|\Pi_{K \setminus k}^{\perp} h_k\|^2 = \frac{E_s / N_0}{P^K_{kk}} \quad \text{(ZF)}, \qquad d(k, K) = h_k^H \left(H_{K \setminus k} H_{K \setminus k}^H + a I\right)^{-1} h_k = \frac{1}{a P^K_{kk}} - 1 \quad \text{(MMSE)},

where ΠK∖k⊥\Pi_{K \setminus k}^{\perp} is the orthogonal projection onto the complement of the span of the columns in K∖kK \setminus k.

Proof. For ZF, the SNR (Es/N0)/PkkK(E_s / N_0) / P^K_{kk} is Theorem 2 of the ZF MIMO detector applied to HKH_K, and 1/PkkK=∥ΠK∖k⊥hk∥21 / P^K_{kk} = \|\Pi_{K \setminus k}^{\perp} h_k\|^2 is Lemma 3 of the same page. For MMSE, write r=hkxk+vr = h_k x_k + v with v=HK∖kxK∖k+wv = H_{K \setminus k} x_{K \setminus k} + w, whose covariance is EsHK∖kHK∖kH+N0I=Es(HK∖kHK∖kH+aI)E_s H_{K \setminus k} H_{K \setminus k}^H + N_0 I = E_s (H_{K \setminus k} H_{K \setminus k}^H + a I). The largest SINR of a linear estimate of xkx_k is EshkHCov(v)−1hkE_s h_k^H \mathrm{Cov}(v)^{-1} h_k, which gives the first form, and the MMSE MIMO detector reaches it with the unbiased SINR 1/(aPkkK)−11 / (a P^K_{kk}) - 1 (its Theorem 3). □\square

So for both kinds of nulling, d(k,K)d(k, K) falls when PkkKP^K_{kk} grows, and line L4 picks the stream with the largest d(k,K)d(k, K) in KK.

Lemma 3 (fewer interferers never hurt). If k∈K′⊆Kk \in K' \subseteq K, then d(k,K′)≥d(k,K)d(k, K') \ge d(k, K).

Proof. ZF: the span of the columns in K′∖kK' \setminus k is a subspace of the span of the columns in K∖kK \setminus k. The distance from hkh_k to a subspace is at least the distance to a larger subspace, so ∥ΠK′∖k⊥hk∥≥∥ΠK∖k⊥hk∥\|\Pi_{K' \setminus k}^{\perp} h_k\| \ge \|\Pi_{K \setminus k}^{\perp} h_k\|.

MMSE: let A=HK∖kHK∖kH+aIA = H_{K \setminus k} H_{K \setminus k}^H + a I and A′=HK′∖kHK′∖kH+aIA' = H_{K' \setminus k} H_{K' \setminus k}^H + a I. Then A−A′=∑j∈K∖K′hjhjHA - A' = \sum_{j \in K \setminus K'} h_j h_j^H is positive semidefinite, and A′⪰aIA' \succeq a I is positive definite. For positive definite matrices, A⪰A′A \succeq A' implies A′−1⪰A−1A'^{-1} \succeq A^{-1}. So hkHA′−1hk≥hkHA−1hkh_k^H A'^{-1} h_k \ge h_k^H A^{-1} h_k. □\square

Theorem 4 (the order is optimal in the max-min sense). For an order π=(π1,…,πn)\pi = (\pi_1, \ldots, \pi_n) of the streams, let Kt(π)={πt,…,πn}K_t(\pi) = \{\pi_t, \ldots, \pi_n\} and v(π)=min⁡td(πt,Kt(π))v(\pi) = \min_t d(\pi_t, K_t(\pi)), the smallest post-detection SNR or SINR along the order. Let gg be the order chosen by line L4, with any rule for ties. Then v(g)≥v(π)v(g) \ge v(\pi) for every order π\pi.

Proof. By induction on nn. For n=1n = 1 there is only one order. Let n≥2n \ge 2, let π\pi be any order, let N={1,…,n}N = \{1, \ldots, n\}, and let k1=g1k_1 = g_1, a stream with the largest d(k,N)d(k, N). Suppose k1=πjk_1 = \pi_j.

Exchange step. Let π′\pi' be the order that puts k1k_1 first and keeps the other streams in the order of π\pi. Compare the terms of v(π′)v(\pi') with those of v(π)v(\pi):

  • The stream k1k_1 gets d(k1,N)≥d(π1,N)≥v(π)d(k_1, N) \ge d(\pi_1, N) \ge v(\pi), by the choice of k1k_1 and because the first term of π\pi is one of the terms of the minimum.
  • A stream πt\pi_t with t<jt < j is detected from the set Kt(π)∖{k1}K_t(\pi) \setminus \{k_1\} in π′\pi', a subset of Kt(π)K_t(\pi), so by Lemma 3 its term does not fall.
  • A stream πt\pi_t with t>jt > j has the same set Kt(π)K_t(\pi) in both orders, so its term is the same.

So v(π′)≥v(π)v(\pi') \ge v(\pi).

Reduction. After k1k_1, both gg and π′\pi' detect the streams N′=N∖{k1}N' = N \setminus \{k_1\}, and the terms depend only on the sets of remaining streams. This is the same problem for the channel HN′H_{N'} with n−1n - 1 columns, and the remaining part of gg is the order that line L4 chooses for it. By the induction hypothesis, the smallest term of the rest of gg is at least the smallest term of the rest of π′\pi'. So

v(g)=min⁡(d(k1,N),vN′(g))≥min⁡(d(k1,N),vN′(π′))=v(π′)≥v(π).□v(g) = \min\left(d(k_1, N), v_{N'}(g)\right) \ge \min\left(d(k_1, N), v_{N'}(\pi')\right) = v(\pi') \ge v(\pi). \qquad \square

Corollary 5 (no stream is worse than with linear detection). In the order gg, each stream kk has d(k,K)≥d(k,N)d(k, K) \ge d(k, N), the SNR or SINR of the linear ZF or MMSE detector. With ZF nulling in i.i.d. CN(0,1)\mathcal{CN}(0, 1) fading, the first detected stream has an error probability that decays at least as fast as SNR−(m−n+1)\mathrm{SNR}^{-(m - n + 1)}.

Proof. The first part is Lemma 3 with K⊆NK \subseteq N. For the second part, the first stream has the SNR max⁡kd(k,N)≥d(1,N)\max_k d(k, N) \ge d(1, N). By Theorem 4 of the ZF page, (N0/Es) d(1,N)(N_0 / E_s) \, d(1, N) is a sum of m−n+1m - n + 1 independent unit exponentials, so P(d(1,N)<ϵ)≤(ϵN0/Es)m−n+1P(d(1, N) < \epsilon) \le (\epsilon N_0 / E_s)^{m - n + 1}. The same bound then holds for the maximum. Write D=m−n+1D = m - n + 1 and X=(N0/Es)max⁡kd(k,N)X = (N_0 / E_s) \max_k d(k, N), so P(X<ϵ)≤ϵDP(X < \epsilon) \le \epsilon^D. The error probability of a slicer at SNR ss is at most Ce−csC e^{-c s} for constants C,c>0C, c > 0 of the constellation. Averaged over the fading, with ρ=Es/N0\rho = E_s / N_0,

E[Ce−cρX]=C∫0∞P(X<ucρ)e−u du≤C∫0∞(ucρ)De−u du=C D!(cρ)D.□E\left[C e^{-c \rho X}\right] = C \int_0^\infty P\left(X < \frac{u}{c \rho}\right) e^{-u} \, du \le C \int_0^\infty \left(\frac{u}{c \rho}\right)^D e^{-u} \, du = \frac{C \, D!}{(c \rho)^D}. \qquad \square

Theorem 6 (MMSE-SIC adds up to the capacity). With MMSE nulling and correct cancellation, for every order π\pi,

∑t=1nlog⁡2(1+d(πt,Kt(π)))=log⁡2det⁡(I+EsN0HHH).\sum_{t = 1}^{n} \log_2\left(1 + d(\pi_t, K_t(\pi))\right) = \log_2 \det\left(I + \frac{E_s}{N_0} H^H H\right).

Proof. Let K=Kt(π)K = K_t(\pi), k=πtk = \pi_t and D(K)=det⁡(HKHHK+aI)D(K) = \det(H_K^H H_K + a I), with D(∅)=1D(\emptyset) = 1. By the cofactor formula for the inverse, PkkK=D(K∖k)/D(K)P^K_{kk} = D(K \setminus k) / D(K), because the cofactor of the diagonal entry kk of HKHHK+aIH_K^H H_K + a I is the determinant of the matrix without row and column kk, which is HK∖kHHK∖k+aIH_{K \setminus k}^H H_{K \setminus k} + a I. By Lemma 2,

1+d(k,K)=1aPkkK=D(K)a D(K∖k).1 + d(k, K) = \frac{1}{a P^K_{kk}} = \frac{D(K)}{a \, D(K \setminus k)}.

The sets K1(π)=N⊃K2(π)⊃⋯⊃Kn(π)⊃∅K_1(\pi) = N \supset K_2(\pi) \supset \cdots \supset K_n(\pi) \supset \emptyset lose one stream at each step, so the product over tt telescopes:

∏t=1n(1+d(πt,Kt(π)))=D(N)anD(∅)=det⁡(HHHa+I).\prod_{t = 1}^{n} \left(1 + d(\pi_t, K_t(\pi))\right) = \frac{D(N)}{a^n D(\emptyset)} = \det\left(\frac{H^H H}{a} + I\right).

Since 1/a=Es/N01 / a = E_s / N_0, the base 2 logarithm gives the claim. □\square

The right side is the capacity of the channel HH with equal power EsE_s per transmit antenna and no channel knowledge at the transmitter. So if each stream carries a capacity-achieving code of rate log⁡2(1+d(πt,Kt(π)))\log_2(1 + d(\pi_t, K_t(\pi))) and the receiver decodes each stream before it cancels it, the sum rate equals this capacity, which is the statement of Tse and Viswanath, Section 8.3.4. Theorem 6 holds for every order; the order of Theorem 4 matters for uncoded detection, where the weakest step limits the error rate.

Complexity

The direct method of line L3 inverts an j×jj \times j matrix for j=n,n−1,…,1j = n, n - 1, \ldots, 1, at a cost of O(j2m+j3)O(j^2 m + j^3) each, so the setup per channel costs O(n3m+n4)O(n^3 m + n^4) in the real RAM. The square-root algorithm of Hassibi (2000) finds the same order and nulling rows without a new inverse at each step. After the setup, each received vector costs nn inner products of length mm for line L5, nn updates of length mm for line L7 and nn slicings of O(M)O(M) each, so O(nm+nM)O(n m + n M). The extra space is O(nm)O(n m) for the nulling rows. The implementation on this page recomputes the setup on every call, for clarity.

Properties

  • Exact without noise. With ZF nulling and w=0w = 0, every decision is right (theorem).
  • Best order in the max-min sense. Among all n!n! orders, the order of line L4 maximizes the smallest post-detection SNR (ZF) or SINR (MMSE), assuming correct earlier decisions (theorem).
  • Order from the channel only. The order does not depend on yy, so it is computed once per channel.
  • Never worse than linear in SNR. The first stream has the best ZF or MMSE SNR of all streams, and each later stream has an SNR at least as high as with linear detection (theorem, from the monotonicity).
  • Capacity with MMSE and coding. With MMSE nulling, Gaussian codebooks and correct cancellation, the stream rates log⁡2(1+SINRk)\log_2 (1 + \mathrm{SINR}_k) add up to log⁡2det⁡(I+(Es/N0)HHH)\log_2 \det(I + (E_s / N_0) H^H H) (theorem).
  • Error propagation. Uncoded V-BLAST cancels hard decisions, so a wrong early decision makes later decisions more likely wrong.
  • Diversity. In i.i.d. Rayleigh fading with ZF nulling, the first detected stream has at least the diversity m−n+1m - n + 1 of a ZF stream (theorem). Because of error propagation, uncoded V-BLAST does not reach the diversity mm of ML in general (rule).
  • Measured agreement with ML. For 4-QAM with m=n=4m = n = 4, i.i.d. CN(0,1)\mathcal{CN}(0, 1) channel entries and Es/N0=15E_s / N_0 = 15 dB, the test with seed 1405 runs 150 random vectors. ZF V-BLAST agreed with ML on 147 vectors and MMSE V-BLAST on all 150. ZF V-BLAST made 7 symbol errors, and plain ZF made 24 (measurement).

Variants and improvements

  • MMSE nulling. Set a=N0/Esa = N_0 / E_s in line L3. This is often called MMSE V-BLAST or MMSE-SIC. It needs N0N_0. In the 4 by 4, 4-QAM measurement under Properties, it agreed with ML on every vector at 15 dB.
  • Square-root and QR methods. The square-root algorithm of Hassibi (2000) avoids one inverse per step. A QR decomposition with the columns sorted during the factorization gives a near-optimal order for the cost of one QR. With a fixed order, ZF-SIC is the Babai nearest plane rule and the spatial version of the decision feedback equalizer.
  • Coded layers. If each stream carries its own channel code, the receiver decodes a whole stream before it cancels it, which reduces error propagation. With MMSE nulling this reaches the capacity in fast fading (Tse and Viswanath, Section 8.3.4).
  • Diagonal layering. In slow fading a stream that sits on one bad antenna fails. D-BLAST rotates each codeword over all antennas.
  • Several candidates. The K-best detector keeps the KK best partial decisions instead of one, which reduces error propagation at a known cost.

When to use it

Use V-BLAST when the linear detectors lose too much and ML or a sphere search is too expensive, with nn up to about 8 streams. Use MMSE nulling whenever N0N_0 is known. In a coded system, use it with per-stream codes and decode each stream before cancelling. For a near-ML error rate on a square channel at high SNR, use the K-best detector, lattice reduction aided detection, or Schnorr-Euchner enumeration instead.

Pitfalls

  • Wrong order of the bias step. Line L4 compares PkkP_{kk} before the bias removal of line L5. Removing the bias does not change the order, because the unbiased SINR 1/(aPkk)−11 / (a P_{kk}) - 1 also falls with PkkP_{kk}.
  • Picking the stream by its column norm. The stream with the strongest column is not always the one with the best post-detection SNR. In the example, stream 1 has ∥h1∥2=5\|h_1\|^2 = 5 but only the SNR 0.5 after ZF nulling; the right measure is 1/Pkk1 / P_{kk}.
  • Cancelling with the wrong scale. Line L7 subtracts hkx^kh_k \hat x_k with the full column, not with the nulled output zz.
  • Error propagation is not in the SNR. The post-detection SNRs assume correct earlier decisions. The real error rate of later streams is higher.
  • ZF with n>mn > m. The first step has a singular HHHH^H H. Use MMSE nulling, which works for any mm, or transmit fewer streams.
  • Recomputing per vector. Lines L3 and L4 depend only on HH; recomputing them for each received vector multiplies the cost by the block length.

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.

cbb.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Shared helper of the communications pages of https://algorithm.tamnd.com/. The authors are listed in prov/.

"""Complex baseband tools for the communications pages.

Vectors are lists of complex numbers. Matrices are lists of rows. The
functions here are plain building blocks: small linear algebra, convolution,
the DFT as a direct sum, the Gaussian Q function, dB conversion, complex
Gaussian noise and the Wilson score interval. No page algorithm (equalizer,
estimator, synchronizer, detector, precoder, demapper or power allocation)
lives in this file.

Conventions (prompts of the communications area):
- dft is X[k] = sum_n x[n] e^(-j 2 pi k n / N) with no factor; idft has 1/N.
- udft and uidft are the unitary pair, with 1/sqrt(N) on both sides.
- qfunc(x) = 0.5 erfc(x / sqrt(2)); it never computes 1 - Phi(x).
- cn(rng, var) draws CN(0, var): real and imaginary parts are independent
  with variance var / 2 each, so E|w|^2 = var.
"""

import cmath
import math
import random


# ---------------------------------------------------------------- vectors and matrices


def zeros(rows: int, cols: int | None = None) -> list:
    """A zero vector of length rows, or a rows by cols zero matrix."""
    if cols is None:
        return [0j] * rows
    return [[0j] * cols for _ in range(rows)]


def eye(n: int) -> list[list[complex]]:
    """The n by n identity matrix."""
    return [[1 + 0j if i == k else 0j for k in range(n)] for i in range(n)]


def add(a: list, b: list) -> list:
    """Elementwise a + b for two vectors or two matrices of the same shape."""
    if len(a) != len(b):
        raise ValueError("shapes differ")
    if a and isinstance(a[0], list):
        return [add(r, s) for r, s in zip(a, b)]
    return [x + y for x, y in zip(a, b)]


def sub(a: list, b: list) -> list:
    """Elementwise a - b for two vectors or two matrices of the same shape."""
    if len(a) != len(b):
        raise ValueError("shapes differ")
    if a and isinstance(a[0], list):
        return [sub(r, s) for r, s in zip(a, b)]
    return [x - y for x, y in zip(a, b)]


def scale(c: complex, a: list) -> list:
    """The scalar c times a vector or a matrix."""
    if a and isinstance(a[0], list):
        return [scale(c, r) for r in a]
    return [c * x for x in a]


def matmul(a: list[list[complex]], b: list[list[complex]]) -> list[list[complex]]:
    """The matrix product a b."""
    if not a or not b or len(a[0]) != len(b):
        raise ValueError("inner dimensions differ")
    cols = list(zip(*b))
    return [[sum(x * y for x, y in zip(row, col)) for col in cols] for row in a]


def matvec(a: list[list[complex]], x: list[complex]) -> list[complex]:
    """The matrix times vector product a x."""
    if a and len(a[0]) != len(x):
        raise ValueError("inner dimensions differ")
    return [sum(p * q for p, q in zip(row, x)) for row in a]


def herm(a: list) -> list:
    """The conjugate transpose of a matrix. A vector gives its conjugate."""
    if a and isinstance(a[0], list):
        return [[complex(a[i][k]).conjugate() for i in range(len(a))] for k in range(len(a[0]))]
    return [complex(x).conjugate() for x in a]


def dot(x: list[complex], y: list[complex]) -> complex:
    """The inner product x^H y = sum of conj(x_i) y_i."""
    if len(x) != len(y):
        raise ValueError("lengths differ")
    return sum(complex(p).conjugate() * q for p, q in zip(x, y))


def norm2(x: list) -> float:
    """The squared Euclidean norm sum |x_i|^2 (squared Frobenius norm for a matrix)."""
    if x and isinstance(x[0], list):
        return sum(norm2(r) for r in x)
    return sum(abs(v) ** 2 for v in x)


# ---------------------------------------------------------------- linear systems


def _lu(a: list[list[complex]]) -> tuple[list[list[complex]], list[int], int]:
    """LU factorization with partial pivoting. Returns (lu, perm, sign)."""
    n = len(a)
    if any(len(r) != n for r in a):
        raise ValueError("matrix is not square")
    m = [[complex(v) for v in r] for r in a]
    perm = list(range(n))
    sign = 1
    for k in range(n):
        p = max(range(k, n), key=lambda i: abs(m[i][k]))
        if abs(m[p][k]) == 0.0:
            raise ValueError("matrix is singular")
        if p != k:
            m[k], m[p] = m[p], m[k]
            perm[k], perm[p] = perm[p], perm[k]
            sign = -sign
        for i in range(k + 1, n):
            f = m[i][k] / m[k][k]
            m[i][k] = f
            if f != 0:
                rk, ri = m[k], m[i]
                for c in range(k + 1, n):
                    ri[c] -= f * rk[c]
    return m, perm, sign


def _lu_solve(lu: list[list[complex]], perm: list[int], b: list[complex]) -> list[complex]:
    n = len(lu)
    y = [complex(b[perm[i]]) for i in range(n)]
    for i in range(n):
        for c in range(i):
            y[i] -= lu[i][c] * y[c]
    for i in range(n - 1, -1, -1):
        for c in range(i + 1, n):
            y[i] -= lu[i][c] * y[c]
        y[i] /= lu[i][i]
    return y


def solve(a: list[list[complex]], b: list) -> list:
    """Solve a x = b by Gaussian elimination with partial pivoting.

    b is a vector, or a matrix whose columns are right-hand sides.
    Raises ValueError if a is singular.
    """
    lu, perm, _ = _lu(a)
    if b and isinstance(b[0], list):
        cols = [list(c) for c in zip(*b)]
        xs = [_lu_solve(lu, perm, c) for c in cols]
        return [list(r) for r in zip(*xs)]
    if len(b) != len(a):
        raise ValueError("lengths differ")
    return _lu_solve(lu, perm, b)


def inv(a: list[list[complex]]) -> list[list[complex]]:
    """The inverse of a square matrix."""
    return solve(a, eye(len(a)))


def det(a: list[list[complex]]) -> complex:
    """The determinant of a square matrix (0 for a singular matrix)."""
    try:
        lu, _, sign = _lu(a)
    except ValueError as e:
        if "singular" in str(e):
            return 0j
        raise
    d = complex(sign)
    for i in range(len(lu)):
        d *= lu[i][i]
    return d


def cholesky(a: list[list[complex]]) -> list[list[complex]]:
    """The lower triangular L with a = L L^H, for a Hermitian positive definite a.

    Raises ValueError if a is not positive definite (to rounding).
    """
    n = len(a)
    low = zeros(n, n)
    for i in range(n):
        for k in range(i + 1):
            s = complex(a[i][k]) - sum(low[i][c] * low[k][c].conjugate() for c in range(k))
            if i == k:
                if s.real <= 0.0:
                    raise ValueError("matrix is not positive definite")
                low[i][i] = complex(math.sqrt(s.real))
            else:
                low[i][k] = s / low[k][k].real
    return low


# ---------------------------------------------------------------- convolution and the DFT


def conv(a: list[complex], b: list[complex]) -> list[complex]:
    """Linear convolution, of length len(a) + len(b) - 1."""
    if not a or not b:
        return []
    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 cconv(a: list[complex], b: list[complex], n: int | None = None) -> list[complex]:
    """Circular convolution of length n (default: the longer length).

    Both inputs are padded with zeros to length n, or must not be longer than n.
    """
    if n is None:
        n = max(len(a), len(b))
    if len(a) > n or len(b) > n:
        raise ValueError("input longer than n")
    out = [0j] * n
    for i, x in enumerate(a):
        for k, y in enumerate(b):
            out[(i + k) % n] += x * y
    return out


def _twiddles(n: int, sign: int) -> list[complex]:
    return [cmath.exp(sign * 2j * math.pi * t / n) for t in range(n)]


def dft(x: list[complex]) -> list[complex]:
    """X[k] = sum over n of x[n] e^(-j 2 pi k n / N), as a direct O(N^2) sum."""
    n = len(x)
    w = _twiddles(n, -1)
    return [sum(x[t] * w[(k * t) % n] for t in range(n)) for k in range(n)]


def idft(xf: list[complex]) -> list[complex]:
    """x[n] = (1/N) sum over k of X[k] e^(j 2 pi k n / N), the inverse of dft."""
    n = len(xf)
    w = _twiddles(n, 1)
    return [sum(xf[k] * w[(k * t) % n] for k in range(n)) / n for t in range(n)]


def udft(x: list[complex]) -> list[complex]:
    """The unitary DFT: dft(x) / sqrt(N)."""
    s = 1.0 / math.sqrt(len(x)) if x else 1.0
    return [v * s for v in dft(x)]


def uidft(xf: list[complex]) -> list[complex]:
    """The unitary inverse DFT: sqrt(N) idft(X), the inverse of udft."""
    s = math.sqrt(len(xf)) if xf else 1.0
    return [v * s for v in idft(xf)]


# ---------------------------------------------------------------- Q function and dB


def qfunc(x: float) -> float:
    """Q(x) = P(Z > x) for a standard normal Z, computed as 0.5 erfc(x / sqrt(2))."""
    return 0.5 * math.erfc(x / math.sqrt(2.0))


def qinv(p: float) -> float:
    """The x with Q(x) = p, for 0 < p < 1, by bisection on Q (which decreases)."""
    if not 0.0 < p < 1.0:
        raise ValueError("p must be in (0, 1)")
    lo, hi = -40.0, 40.0
    for _ in range(200):
        mid = 0.5 * (lo + hi)
        if qfunc(mid) > p:
            lo = mid
        else:
            hi = mid
        if hi - lo <= 1e-15 * max(1.0, abs(mid)):
            break
    return 0.5 * (lo + hi)


def db(x: float) -> float:
    """10 log10(x), for a ratio of powers or energies."""
    return 10.0 * math.log10(x)


def undb(d: float) -> float:
    """10^(d / 10), the inverse of db."""
    return 10.0 ** (d / 10.0)


# ---------------------------------------------------------------- noise and statistics


def cn(rng: random.Random, var: float) -> complex:
    """One sample of CN(0, var): independent real and imaginary parts of variance var / 2."""
    s = math.sqrt(var / 2.0)
    return complex(rng.gauss(0.0, s), rng.gauss(0.0, s))


def awgn(rng: random.Random, x: list[complex], n0: float) -> list[complex]:
    """x plus independent CN(0, n0) noise on each sample."""
    return [v + cn(rng, n0) for v in x]


def wilson(k: int, n: int, z: float = 3.29) -> tuple[float, float]:
    """The Wilson score interval for k successes in n trials (z = 3.29 is about 0.999 two-sided)."""
    if n <= 0 or not 0 <= k <= n:
        raise ValueError("need 0 <= k <= n and n > 0")
    p = k / n
    z2 = z * z
    den = 1.0 + z2 / n
    mid = (p + z2 / (2 * n)) / den
    half = z * math.sqrt(p * (1 - p) / n + z2 / (4 * n * n)) / den
    return max(0.0, mid - half), min(1.0, mid + half)
constel.py 117 lines
# SPDX-License-Identifier: MIT
# Shared helper of the communications pages of https://algorithm.tamnd.com/. The authors are listed in prov/.

"""Constellations, Gray labels and brute-force maximum likelihood detection.

Each constellation function returns a list of M complex points with unit
average energy, ordered by label: points[i] is the point whose bit label is
the integer i, and bits(i, log2 M) gives that label, most significant bit
first. The labels follow the communications area rules:

- M-PAM: the point with amplitude index m = 0, ..., M-1 (raw amplitude
  M - 1 - 2m, from the most positive) gets the Gray label gray(m).
  So 2-PAM maps bit 0 to +1 and bit 1 to -1.
- Square M-QAM, M = 4^k: the label is the in-phase PAM label followed by the
  quadrature PAM label, each of log2(sqrt(M)) bits.
- M-PSK: the point e^(j(2 pi m / M + phase0)) gets the label gray(m).

PAM points are returned as complex numbers with zero imaginary part.
This file imports nothing from cbb.py. It holds no demapper: soft and
max-log demapping are algorithm pages of their own.
"""

import cmath
import itertools
import math


def gray(n: int) -> int:
    """The binary reflected Gray code of n: n XOR (n >> 1)."""
    return n ^ (n >> 1)


def _gray_inv(g: int) -> int:
    n = 0
    while g:
        n ^= g
        g >>= 1
    return n


def bits(i: int, m: int) -> list[int]:
    """The m bits of the integer i, most significant bit first."""
    if i < 0 or i >= 1 << m:
        raise ValueError("i does not fit in m bits")
    return [(i >> (m - 1 - t)) & 1 for t in range(m)]


def _log2(m: int) -> int:
    if m < 2 or m & (m - 1):
        raise ValueError("M must be a power of two, at least 2")
    return m.bit_length() - 1


def pam(m: int) -> list[complex]:
    """Unit-energy M-PAM, ordered by Gray label."""
    _log2(m)
    s = math.sqrt((m * m - 1) / 3.0)
    return [complex((m - 1 - 2 * _gray_inv(lab)) / s, 0.0) for lab in range(m)]


def qam(m: int) -> list[complex]:
    """Unit-energy square M-QAM (M = 4, 16, 64, ...), ordered by label (in-phase bits first)."""
    k = _log2(m)
    if k % 2:
        raise ValueError("square QAM needs M = 4^k")
    side = 1 << (k // 2)
    s = math.sqrt(2.0 * (m - 1) / 3.0)
    raw = [side - 1 - 2 * _gray_inv(lab) for lab in range(side)]
    return [complex(raw[lab // side], raw[lab % side]) / s for lab in range(m)]


def psk(m: int, phase0: float = 0.0) -> list[complex]:
    """Unit-energy M-PSK with first point at angle phase0, ordered by Gray label."""
    _log2(m)
    return [cmath.exp(1j * (2.0 * math.pi * _gray_inv(lab) / m + phase0)) for lab in range(m)]


def energy(points: list[complex]) -> float:
    """The average energy (1/M) sum |p|^2 of equally likely points."""
    return sum(abs(p) ** 2 for p in points) / len(points)


def ml_detect(y: complex, points: list[complex], h: complex = 1) -> int:
    """The index of the point p that minimizes |y - h p|^2, by brute force (lowest index on a tie)."""
    best, arg = math.inf, -1
    for i, p in enumerate(points):
        d = abs(y - h * p) ** 2
        if d < best:
            best, arg = d, i
    return arg


def ml_vector(y: list[complex], h: list[list[complex]], points: list[complex]) -> list[int]:
    """The index vector that minimizes ||y - H x||^2 over all M^n vectors x, by brute force.

    h is the m by n channel matrix as a list of rows; the result has n indices.
    The first minimizer in lexicographic order of the indices wins a tie.
    """
    n = len(h[0])
    best, arg = math.inf, None
    for idx in itertools.product(range(len(points)), repeat=n):
        x = [points[i] for i in idx]
        d = 0.0
        for yi, row in zip(y, h):
            d += abs(yi - sum(a * b for a, b in zip(row, x))) ** 2
        if d < best:
            best, arg = d, idx
    return list(arg)


def bit_errors(a, b) -> int:
    """The number of differing bits between two integer labels, or summed over two equal-length lists."""
    if isinstance(a, int) and isinstance(b, int):
        return bin(a ^ b).count("1")
    if len(a) != len(b):
        raise ValueError("lengths differ")
    return sum(bit_errors(x, y) for x, y in zip(a, b))
v_blast.py 98 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/v-blast/. The authors are listed in prov/Z0RT80.jsonl.

"""The V-BLAST detector: ordered nulling and cancelling.

The model is y = H x + w with H an m by n complex matrix, x a vector of n
constellation points of energy Es and w ~ CN(0, N0 I). At each step the
detector looks at the streams not yet detected (the set K), computes
P = (H_K^H H_K + a I)^(-1), with a = 0 for ZF nulling and a = N0 / Es for
MMSE nulling, and picks the stream k in K with the smallest P_kk, which is
the stream with the largest post-detection SNR (ZF) or SINR (MMSE). It
nulls the other streams of K with row k of P H_K^H, slices the result,
subtracts h_k times the decision from the received vector and removes k
from K. With a = 0 this is the receiver of Wolniansky, Foschini, Golden and
Valenzuela (1998).
"""

import cbb


def nearest(z: complex, points: list[complex]) -> int:
    """The index of the point nearest to z (the lowest index on a tie)."""
    best, arg = float("inf"), -1
    for i, p in enumerate(points):
        d = abs(z - p) ** 2
        if d < best:
            best, arg = d, i
    return arg


def _columns(h: list[list[complex]], cols: list[int]) -> list[list[complex]]:
    return [[row[c] for c in cols] for row in h]


def _nulling(h: list[list[complex]], cols: list[int], a: float) -> tuple[list[list[complex]], list[list[complex]]]:
    """(P, P H_K^H) for the columns cols of H, with P = (H_K^H H_K + a I)^(-1)."""
    hk = _columns(h, cols)
    hh = cbb.herm(hk)
    g = cbb.matmul(hh, hk)
    for i in range(len(cols)):
        g[i][i] += a
    try:
        p = cbb.inv(g)
    except ValueError:
        raise ValueError("the remaining columns of H are dependent; use MMSE nulling or fewer streams") from None
    return p, cbb.matmul(p, hh)


def vblast_detect(
    y: list[complex],
    h: list[list[complex]],
    points: list[complex],
    n0: float = 0.0,
    es: float = 1.0,
    mmse: bool = False,
) -> tuple[list[int], list[int]]:
    """The V-BLAST decisions and the detection order.

    Returns (indices, order): indices[k] is the point index decided for
    stream k, and order lists the streams in the order they were detected.
    mmse=False gives ZF nulling and needs m >= n; mmse=True needs N0 > 0.
    """
    n = len(h[0])
    if mmse and n0 <= 0:
        raise ValueError("MMSE nulling needs N0 > 0")
    if not mmse and len(h) < n:
        raise ValueError("ZF nulling needs at least as many receive antennas as streams")
    a = n0 / es if mmse else 0.0
    r = [complex(v) for v in y]
    remaining = list(range(n))  # @line L1
    out = [-1] * n
    order = []
    while remaining:  # @line L2
        p, w = _nulling(h, remaining, a)  # @line L3
        i = min(range(len(remaining)), key=lambda t: p[t][t].real)  # @line L4
        k = remaining[i]
        z = sum(c * v for c, v in zip(w[i], r))  # @line L5
        if mmse:
            z /= 1.0 - a * p[i][i].real  # remove the MMSE bias
        out[k] = nearest(z, points)  # @line L6
        s = points[out[k]]
        r = [rv - row[k] * s for rv, row in zip(r, h)]  # @line L7
        remaining.pop(i)  # @line L8
        order.append(k)
    return out, order  # @line L9


def post_detection_snr(h: list[list[complex]], order: list[int], es: float, n0: float, mmse: bool = False) -> list[float]:
    """The SNR (ZF) or unbiased SINR (MMSE) of each step, in detection order, assuming correct earlier decisions."""
    a = n0 / es
    remaining = list(range(len(h[0])))
    out = []
    for k in order:
        p, _ = _nulling(h, remaining, a if mmse else 0.0)
        i = remaining.index(k)
        out.append(1.0 / (a * p[i][i].real) - 1.0 if mmse else (es / n0) / p[i][i].real)
        remaining.pop(i)
    return out
test_v_blast.py 128 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/v-blast/. The authors are listed in prov/Z0RT80.jsonl.

import itertools
import math
import random

import pytest

import cbb
import constel
from v_blast import nearest, post_detection_snr, vblast_detect


def rayleigh(rng, m, n):
    return [[cbb.cn(rng, 1.0) for _ in range(n)] for _ in range(m)]


def sic_fixed_order(y, h, points, order):
    """ZF nulling and cancelling in a given order, without the V-BLAST choice."""
    r = list(y)
    left = list(range(len(h[0])))
    out = [-1] * len(left)
    for k in order:
        hk = [[row[c] for c in left] for row in h]
        w = cbb.solve(cbb.matmul(cbb.herm(hk), hk), cbb.herm(hk))
        i = left.index(k)
        out[k] = nearest(sum(c * v for c, v in zip(w[i], r)), points)
        r = [rv - row[k] * points[out[k]] for rv, row in zip(r, h)]
        left.pop(i)
    return out


def test_example_on_the_page() -> None:
    h = [[2, 1], [1, 1]]
    y = [0.7, 0.4]  # x = (+1, -1) and w = (-0.3, 0.4)
    bpsk = constel.pam(2)
    w = cbb.inv(h)
    z = cbb.matvec(w, y)
    assert abs(z[0] - 0.3) < 1e-12 and abs(z[1] - 0.1) < 1e-12  # ZF decides (+1, +1)
    assert vblast_detect(y, h, bpsk) == ([0, 1], [0, 1])
    assert constel.ml_vector(y, h, bpsk) == [0, 1]
    assert sic_fixed_order(y, h, bpsk, [1, 0]) == [1, 0]  # the other order: two errors
    a, b = post_detection_snr(h, [0, 1], 1.0, 1.0), post_detection_snr(h, [1, 0], 1.0, 1.0)
    assert max(abs(a[0] - 0.5), abs(a[1] - 2.0), abs(b[0] - 0.2), abs(b[1] - 5.0)) < 1e-12


def test_noiseless_recovery_is_exact() -> None:
    rng = random.Random(1401)
    pts = constel.qam(16)
    for _ in range(60):
        n = rng.randint(1, 4)
        m = rng.randint(n, 5)
        h = rayleigh(rng, m, n)
        idx = [rng.randrange(16) for _ in range(n)]
        y = cbb.matvec(h, [pts[i] for i in idx])
        d, order = vblast_detect(y, h, pts)
        assert d == idx and sorted(order) == list(range(n))
        d, _ = vblast_detect(y, h, pts, n0=1e-9, mmse=True)
        assert d == idx


def test_greedy_order_maximizes_the_smallest_snr() -> None:
    # theorem: the V-BLAST order maximizes the minimum post-detection SNR (ZF) or SINR (MMSE)
    rng = random.Random(1402)
    pts = constel.qam(4)
    for _ in range(40):
        n = rng.randint(2, 4)
        m = rng.randint(n, 5)
        h = rayleigh(rng, m, n)
        for mmse in (False, True):
            _, order = vblast_detect([0j] * m, h, pts, n0=0.1, mmse=mmse)
            best = min(post_detection_snr(h, order, 1.0, 0.1, mmse))
            for perm in itertools.permutations(range(n)):
                assert min(post_detection_snr(h, list(perm), 1.0, 0.1, mmse)) <= best * (1 + 1e-9)


def test_mmse_sic_sinrs_add_up_to_the_capacity_in_any_order() -> None:
    # theorem: with MMSE nulling and correct cancellation, sum log2(1 + SINR_k) = log2 det(I + (Es/N0) H^H H)
    rng = random.Random(1403)
    for _ in range(30):
        n = rng.randint(1, 4)
        m = rng.randint(1, 5)
        h = rayleigh(rng, m, n)
        snr = rng.uniform(0.5, 30.0)
        g = cbb.matmul(cbb.herm(h), h)
        cap = math.log2(abs(cbb.det(cbb.add(cbb.eye(n), cbb.scale(snr, g)))))
        order = list(range(n))
        rng.shuffle(order)
        s = post_detection_snr(h, order, 1.0, 1.0 / snr, mmse=True)
        assert abs(sum(math.log2(1 + v) for v in s) - cap) < 1e-9 * (1 + cap)


def test_one_stream_is_maximal_ratio_combining() -> None:
    rng = random.Random(1404)
    h = rayleigh(rng, 4, 1)
    assert abs(post_detection_snr(h, [0], 1.0, 0.5)[0] - cbb.norm2([r[0] for r in h]) / 0.5) < 1e-12


def test_bad_arguments() -> None:
    with pytest.raises(ValueError):
        vblast_detect([0j], [[1, 1]], constel.pam(2))
    with pytest.raises(ValueError):
        vblast_detect([0j, 0j], [[1, 2], [2, 4]], constel.pam(2))
    with pytest.raises(ValueError):
        vblast_detect([0j], [[1]], constel.pam(2), n0=0.0, mmse=True)


def test_most_decisions_match_ml_and_beat_zf() -> None:
    # measured: 4-QAM, m = n = 4, Es/N0 = 15 dB, seed 1405, 150 vectors
    rng = random.Random(1405)
    pts = constel.qam(4)
    n0 = 1 / cbb.undb(15.0)
    agree_zf = agree_mmse = err_vb = err_zf = 0
    for _ in range(150):
        h = rayleigh(rng, 4, 4)
        idx = [rng.randrange(4) for _ in range(4)]
        y = cbb.awgn(rng, cbb.matvec(h, [pts[i] for i in idx]), n0)
        ml = constel.ml_vector(y, h, pts)
        d, _ = vblast_detect(y, h, pts)
        agree_zf += d == ml
        agree_mmse += vblast_detect(y, h, pts, n0=n0, mmse=True)[0] == ml
        err_vb += sum(a != b for a, b in zip(d, idx))
        w = cbb.solve(cbb.matmul(cbb.herm(h), h), cbb.herm(h))
        err_zf += sum(nearest(z, pts) != b for z, b in zip(cbb.matvec(w, y), idx))
    print(agree_zf, agree_mmse, err_vb, err_zf)
    assert agree_zf >= 140 and agree_mmse >= 145
    assert err_vb < err_zf

History

Foschini described the layered space-time architecture with diagonal layers (D-BLAST) in 1996, and showed that its capacity grows linearly with the number of antennas. The diagonal layering was hard to build, so Wolniansky, Foschini, Golden and Valenzuela proposed the simpler vertical version in 1998, with the nulling, ordering and cancelling receiver on this page. Golden, Foschini, Valenzuela and Wolniansky reported the laboratory prototype in Electronics Letters in 1999. Hassibi gave the square-root algorithm in 2000. The view of the receiver as MMSE-SIC that reaches the capacity is part of the textbook treatment of Tse and Viswanath (2005).

References

  1. Peter W. Wolniansky, Gerard J. Foschini, Glen D. Golden and Reinaldo A. Valenzuela, V-BLAST - an architecture for realizing very high data rates over the rich-scattering wireless channel, Proc. URSI International Symposium on Signals, Systems and Electronics, Pisa, 1998, pages 295-300, the detection algorithm (nulling with the rows of the pseudoinverse, the ordering by the smallest row norm and the cancellation)
  2. Glen D. Golden, Gerard J. Foschini, Reinaldo A. Valenzuela and Peter W. Wolniansky, Detection algorithm and initial laboratory results using V-BLAST space-time communication architecture, Electronics Letters 35(1), 14-16, 1999, the recursive detection algorithm and the measured spectral efficiencies
  3. David Tse and Pramod Viswanath, Fundamentals of Wireless Communication, Cambridge University Press, 2005, Section 8.1 (the V-BLAST architecture), Section 8.3.2 (successive cancellation and error propagation) and Section 8.3.4 (MMSE-SIC reaches the capacity)
  4. Babak Hassibi, An efficient square-root algorithm for BLAST, Proc. IEEE ICASSP 2000, pages 737-740, the square-root algorithm that finds the order and the nulling vectors without one matrix inverse per step

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
  • a full proof of time_per_vector_after_setup.worst
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