# 分组码

分组码是一种差错控制方法，它将固定长度为k个信息比特的分组映射为更长的n比特码字，使接收端能够检测或纠正传输错误。这种码由长度n、维数k和最小距离d来描述，其码率k/n衡量每个传输比特中承载信息的比例；码率为1/2的码将一半带宽用于冗余。<sup>[1](https://engineering.purdue.edu/~mikedz/ee301/ABC_BlockCodes.pdf)</sup> 分组码是存储格式、深空链路、广播标准以及5G无线通信中数据信道和控制信道的基础。

| 关键事实 | 数值 |
|---|---|
| 产生的码字 | 每k比特消息分组产生n比特；码率R = k/n<sup>[1](https://engineering.purdue.edu/~mikedz/ee301/ABC_BlockCodes.pdf)</sup> |
| 功能 | 检错、纠错或两者的折中<sup>[2](https://www.mathworks.com/help/comm/ug/block-codes.html)</sup> |
| 纠错能力 | t = \( \lfloor (d_{\mathrm{min}} - 1)/2 \rfloor \)个错误；最多检测\( d_{\mathrm{min}} - 1 \)个错误<sup>[3](https://pages.jh.edu/bcooper8/sigma_files/ERROR_CONTROL_CODING/03lbc.pdf)</sup> |
| Singleton界 | k + d ≤ n + 1；满足等号的码为MDS码<sup>[4](https://web.mat.upc.edu/sebastia.xambo/CC/cc.pdf)</sup> |
| 软判决增益 | 在AWGN信道上比硬判决译码约高2 dB<sup>[1](https://engineering.purdue.edu/~mikedz/ee301/ABC_BlockCodes.pdf)</sup> |
| 5G NR中的使用 | 数据信道采用LDPC，控制信道采用极化码<sup>[5](https://arxiv.org/html/2502.11053)</sup> |
| 存储中的应用 | CD、DVD、蓝光光盘和QR码中的Reed–Solomon码<sup>[6](https://www.irishmathsoc.org/bull95/wef/Articles/Coding_History/Coding_History-wef.pdf)</sup> |

## 工作原理

线性分组码是二元域上n维向量空间的一个k维子空间。编码是矩阵乘法：消息行向量D乘以k × n生成矩阵G得到码字C，仅G即可完全刻画该码。<sup>[7](https://web.mit.edu/6.02/www/s2012/handouts/6.pdf)</sup> 每个线性分组码都等价于一个系统码，其中G = [\( I_{\mathrm{k}} \) | P]将n − k个校验比特附加在不变的消息之后；对应的校验矩阵为H = [\( -P^{\mathrm{T}} \) | \( I_{\mathrm{n-k}} \)]，一个向量属于该码当且仅当\( H \cdot c = 0 \)。<sup>[3](https://pages.jh.edu/bcooper8/sigma_files/ERROR_CONTROL_CODING/03lbc.pdf)</sup>

距离决定了码的能力。对于线性码，最小距离\( d_{\mathrm{min}} \)等于所有非零码字中的最小汉明重量。<sup>[3](https://pages.jh.edu/bcooper8/sigma_files/ERROR_CONTROL_CODING/03lbc.pdf)</sup> 距离为\( d_{\mathrm{min}} \)的码可检测所有重量不超过\( d_{\mathrm{min}} - 1 \)的错误图样，并通过最近邻译码纠正\( t = \lfloor (d_{\mathrm{min}} - 1)/2 \rfloor \)个错误；\( d_{\mathrm{min}} = 7 \)的码可纠正3个错误，或者以纠错换检错，最多检测4个错误并纠正2个错误。<sup>[2](https://www.mathworks.com/help/comm/ug/block-codes.html)</sup> Singleton界k + d ≤ n + 1限制了这一折中；满足等号的码称为最大距离可分（MDS）码，距离至少为n − k + 1的Reed–Solomon码就属于这一族。<sup>[4](https://web.mat.upc.edu/sebastia.xambo/CC/cc.pdf)</sup>

## 实现方法

接收端计算接收向量r的伴随式\( s = H \cdot r^{T} \)。伴随式为零意味着未发生（单比特）错误；否则将(n − k)比特的伴随式与存储值匹配，以定位并翻转错误比特。同一陪集中的所有向量共享一个伴随式，因此译码归结为寻找最小重量的陪集首——最可能的错误图样——并将其减去；这等价于标准阵列译码，但所需存储更少。<sup>[7](https://web.mit.edu/6.02/www/s2012/handouts/6.pdf)</sup>

伴随式译码是一种硬判决译码。穷举最大似然译码将r与所有\( 2^{k} \)个码字比较，在翻转概率ε < 1/2的二元对称信道上可简化为最小化汉明距离，但其指数级代价使其不可行。<sup>[7](https://web.mit.edu/6.02/www/s2012/handouts/6.pdf)</sup> 当检测器输出软（可靠性加权）判决时，编码增益通常比硬判决处理提高约2 dB。<sup>[1](https://engineering.purdue.edu/~mikedz/ee301/ABC_BlockCodes.pdf)</sup> 代数BCH和Reed–Solomon译码器计算2t个伴随式项，用Berlekamp算法构建错误定位多项式Λ(z)，并构造求值多项式Ω(z) = Λ(z)·S(z)。<sup>[2](https://www.mathworks.com/help/comm/ug/block-codes.html)</sup> 现代LDPC和极化译码器则采用迭代方式，详见“变体”一节。

## 起源

该领域奠基于[克劳德·香农](https://www.edgepedia.org/zh/claude-shannon)（Claude Shannon）1948年的论文《通信的数学理论》，该文将通信描述为在一处复现另一处选定的消息，并创立了信道容量理论。<sup>[8](https://doi.org/10.1002/j.1538-7305.1948.tb01338.x)</sup> 1950年，R. W. 汉明（R. W. Hamming）发表了《差错检测与差错纠正码》，描述了一类早期有影响力的单错纠正分组码；他在文中指出，他所知的唯一先前发表的纠错工作是[马塞尔·J. E. 戈莱](https://www.edgepedia.org/zh/marcel-j-e-golay)（Marcel J. E. Golay）1949年的短文《数字编码札记》。<sup>[9](https://doi.org/10.1002/j.1538-7305.1950.tb00463.x)</sup>

[BCH码](https://www.edgepedia.org/zh/bch-code)出现在1960年《信息与控制》上R.C. 博斯（R.C. Bose）和D.K. 雷-乔杜里（D.K. Ray-Chaudhuri）的论文《关于一类纠错二元群码》中。<sup>[10](https://doi.org/10.1016/s0019-9958%2860%2990287-4)</sup> 1965年，[G. 戴维·福尼](https://www.edgepedia.org/zh/g-david-forney)（G. David Forney）引入了级联的概念，通常是将内卷积码与外Reed–Solomon分组码级联，并通过解交织来分散突发错误。R. 加拉格尔（R. Gallager）1962年发表在《IEEE信息论汇刊》上的论文《低密度奇偶校验码》引入了LDPC码，这些码在很长一段时间内被忽视，直到20世纪90年代由涡轮码（turbo codes）引发的迭代译码才使其重新受到重视。<sup>[11](https://doi.org/10.1109/tit.1962.1057683)</sup> 涡轮码由克劳德·贝鲁（Claude Berrou）于1993年提出，其仿真性能仅比香农定理预测值差0.7 dB。<sup>[12](https://perso.etis-lab.fr/declercq/Elsevier/Chapter2_TurboLikeConstructions_Benedetto/00turbocodes_structure.pdf)</sup> 极化码的列表译码由伊多·塔尔（Ido Tal）和亚历山大·瓦尔迪（Alexander Vardy）于2012年在arXiv上发表。<sup>[13](https://doi.org/10.48550/arxiv.1206.0050)</sup>

## 变体

**汉明码**对任意m ≥ 2存在，参数为\( n = 2^{m} - 1 \)、\( k = 2^{m} - m - 1 \)、t = 1（\( d_{\mathrm{min}} = 3 \)）；其校验矩阵包含所有非零m比特列，每个这样的码都能纠正所有单比特错误。(15,11)码增加了4个校验比特，而三重重复码则需要22个。<sup>[14](https://www.telecom.tuc.gr/~liavas/Seminars/coding_theory/Docs/2_Linear_Block_Codes.pdf)</sup> 汉明码和戈莱的两个码都是完备码：戈莱发现了一个二元[23, 12, 7]码和一个三元[11, 6, 5]码。<sup>[6](https://www.irishmathsoc.org/bull95/wef/Articles/Coding_History/Coding_History-wef.pdf)</sup>

**BCH和Reed–Solomon码**将汉明构造推广为循环码，提供大范围的块长度、码率和纠错能力。<sup>[1](https://engineering.purdue.edu/~mikedz/ee301/ABC_BlockCodes.pdf)</sup> 长度为\( n = 2^{m} - 1 \)的Reed–Solomon码可纠正⌊(n − k)/2⌋个符号错误，缩短码保持相同的能力，且这些码非常适合突发错误。<sup>[2](https://www.mathworks.com/help/comm/ug/block-codes.html)</sup>

**LDPC码**具有稀疏校验矩阵，通过和积算法等迭代算法以O(n)复杂度译码；设计良好的LDPC码在该算法下接近信道容量。<sup>[15](https://globals.ieice.org/en_transactions/communications/10.1587/transcom.2021EBI0001/_pdf)</sup> **极化码**达到任意二元输入离散无记忆信道的对称容量，在连续消除译码下，码率低于容量时块错误概率上界为\( O(n^{-1/4}) \)，编码和SC译码均以O(n log n)运行。<sup>[16](https://arxiv.org/html/0807.3917v5)</sup>

## 应用

Reed–Solomon码广泛用于CD、DVD、蓝光光盘和QR码，Reed–Solomon码和Reed–Muller码都已搭载于NASA太空探测器。<sup>[6](https://www.irishmathsoc.org/bull95/wef/Articles/Coding_History/Coding_History-wef.pdf)</sup> 深空系统将外(255,223) Reed–Solomon码与内卷积码级联，并采用矩形交织来打散卷积译码器的突发错误事件。<sup>[17](https://tda.jpl.nasa.gov/progress_report/42-133/133K.pdf)</sup> DVB-S2广播使用长度为16200和64800的IRA-LDPC码，具有从1/4到9/10的十一种码率，与一个可纠正最多t个比特错误的BCH码级联，多数情况下t = 12。<sup>[15](https://globals.ieice.org/en_transactions/communications/10.1587/transcom.2021EBI0001/_pdf)</sup> 在5G NR中，LDPC编码承载上下行共享传输信道，数据速率可达20 Gbps，极化码用于控制信道，按3GPP惯例采用CRC辅助的SCL译码。<sup>[5](https://arxiv.org/html/2502.11053)</sup>

## 局限与替代方案

当接收向量是一个不同于发送码字的非零码字时，就发生了不可检测的码错误，因此二元线性码有\( 2^{k} - 1 \)种不可检测的错误图样。<sup>[14](https://www.telecom.tuc.gr/~liavas/Seminars/coding_theory/Docs/2_Linear_Block_Codes.pdf)</sup> 具有突发错误的信道会使只能纠正少量错误的码失效，但交织——按列传输编码块，使一次突发在每个编码块中最多破坏一个比特——能让小型分组码应对突发错误。<sup>[7](https://web.mit.edu/6.02/www/s2012/handouts/6.pdf)</sup> LDPC和涡轮码在高SNR下会出现错误底，这使得普通LDPC不适合需要极低错误率的场合，而CRC-极化码由于其代数结构避免了错误底；极化码则受限于码长。<sup>[18](https://ar5iv.labs.arxiv.org/html/2303.14614)</sup>

与替代方案相比：经典分组译码通常是非迭代的直接计算，计算需求低，而LDPC虽然是分组码，但需要多次廉价的迭代，涡轮码则需要少量昂贵的迭代。<sup>[19](https://www.wasyresearch.com/channel-coding-theory-an-introduction-and-comparison-of-block-convolutional-turbo-and-low-density-parity-check-ldpc-codes/)</sup> 自2023年以来，研究工作转向学习型译码器：基于Transformer的神经译码器，如约尼·舒克伦（Yoni Choukroun）和利奥尔·沃尔夫（Lior Wolf）的纠错码Transformer（2022），致力于码无关的译码，<sup>[20](https://doi.org/10.48550/arxiv.2203.14966)</sup> 而置信传播加有序Tanner森林（BP+OTF）算法目前为电路级噪声下的量子LDPC码提供了近乎线性时间的译码器。<sup>[21](https://www.nature.com/articles/s41534-026-01292-1)</sup>

## References

1. [The ABCs of linear block codes (IEEE Signal Processing Magazine tutorial)](https://engineering.purdue.edu/~mikedz/ee301/ABC_BlockCodes.pdf)
2. [Block Codes, MATLAB & Simulink (Communications Toolbox documentation)](https://www.mathworks.com/help/comm/ug/block-codes.html)
3. [Error Control Coding, Chapter 3: Linear Block Codes (A. Brinton Cooper III, Johns Hopkins, 2003)](https://pages.jh.edu/bcooper8/sigma_files/ERROR_CONTROL_CODING/03lbc.pdf)
4. [A Computational Primer on Block Error-Correcting Codes (Xambó, UPC)](https://web.mat.upc.edu/sebastia.xambo/CC/cc.pdf)
5. [Demystifying 5G Polar and LDPC Codes: A Comprehensive Review and Foundations](https://arxiv.org/html/2502.11053)
6. [Coding Theory: The story of how an engineering problem evolved into a branch of pure mathematics](https://www.irishmathsoc.org/bull95/wef/Articles/Coding_History/Coding_History-wef.pdf)
7. [MIT 6.02 Notes 6: Linear Block Codes, Encoding and Syndrome Decoding](https://web.mit.edu/6.02/www/s2012/handouts/6.pdf)
8. [C. E. Shannon (1948). A Mathematical Theory of Communication. Bell System Technical Journal.](https://doi.org/10.1002/j.1538-7305.1948.tb01338.x)
9. [R. W. Hamming (1950). Error Detecting and Error Correcting Codes. Bell System Technical Journal.](https://doi.org/10.1002/j.1538-7305.1950.tb00463.x)
10. [On a class of error correcting binary group codes (Information and Control, 1960)](https://doi.org/10.1016/s0019-9958%2860%2990287-4)
11. [R. Gallager (1962). Low-density parity-check codes. IEEE Transactions on Information Theory.](https://doi.org/10.1109/tit.1962.1057683)
12. [Turbo-like code structures (book chapter, Benedetto et al.)](https://perso.etis-lab.fr/declercq/Elsevier/Chapter2_TurboLikeConstructions_Benedetto/00turbocodes_structure.pdf)
13. [Tal, Ido, Vardy, Alexander (2012). List Decoding of Polar Codes. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1206.0050)
14. [Linear Block Codes, Telecommunications Laboratory, Technical University of Crete (A. Balatsoukas-Stimming, 2008)](https://www.telecom.tuc.gr/~liavas/Seminars/coding_theory/Docs/2_Linear_Block_Codes.pdf)
15. [A Survey of LDPC Codes: Decoding, Construction, Encoding (IEICE Transactions on Communications, 2021)](https://globals.ieice.org/en_transactions/communications/10.1587/transcom.2021EBI0001/_pdf)
16. [Channel polarization: A method for constructing capacity-achieving codes for symmetric binary-input memoryless channels (Arıkan)](https://arxiv.org/html/0807.3917v5)
17. [Code Performance as a Function of Block Size (JPL TDA Progress Report)](https://tda.jpl.nasa.gov/progress_report/42-133/133K.pdf)
18. [A Golden Decade of Polar Codes: From Basic Principle to 5G Applications](https://ar5iv.labs.arxiv.org/html/2303.14614)
19. [Channel coding theory: An introduction and comparison of block, Convolutional, Turbo and low-density parity-check (LDPC) codes](https://www.wasyresearch.com/channel-coding-theory-an-introduction-and-comparison-of-block-convolutional-turbo-and-low-density-parity-check-ldpc-codes/)
20. [Choukroun, Yoni, Wolf, Lior (2022). Error Correction Code Transformer. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2203.14966)
21. [An almost-linear time decoding algorithm for quantum LDPC codes under circuit-level noise (npj Quantum Information)](https://www.nature.com/articles/s41534-026-01292-1)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/block-code

English original: https://www.edgepedia.org/block-code
