# 金码

**金码**（Gold codes）是一族二进制伪随机序列，由罗伯特·戈尔德（Robert Gold）于1967年提出。其生成方式是将两条精心挑选的最大长度序列（m序列）组合起来，使得族中任一成员与其余任一成员之间都具有有界且可预测的互相关。金码在直接序列扩频系统中用作扩频码和识别码，最著名的应用是[全球定位系统](https://www.edgepedia.org/zh/global-positioning-system)（GPS）的C/A码以及码分多址（CDMA）通信。<sup>[1](https://cir.nii.ac.jp/crid/1360292619816079488)</sup><sup> • </sup><sup>[2](https://archive.gps.gov/technical/icwg/IS-GPS-200M.pdf)</sup> 这一名称还被完全独立地用于美国核指挥与控制体系中的**金码**，即总统在下达核打击命令时用来验证自身身份的口令码。<sup>[3](https://ahf.nuclearmuseum.org/ahf/history/nuclear-briefcases/)</sup>

| 关键事实 | 详情 |
|---|---|
| 起源 | 由罗伯特·戈尔德提出，见《用于扩频多路复用的最优二进制序列》，《IEEE信息论汇刊》，第13卷第4期，第619–621页，1967年10月<sup>[1](https://cir.nii.ac.jp/crid/1360292619816079488)</sup> |
| 构造 | 将一个“优选对”m序列（周期N = 2<sup>n</sup> − 1）及其循环移位进行模2（异或）求和；集合G(u, v)包含N + 2条序列<sup>[4](https://www.mathworks.com/help/comm/ref/comm.goldsequence-system-object.html)</sup> |
| 互相关 | 取三个值之一：−t(n)、−1或t(n) − 2，其中n为偶数时t(n) = 1 + 2<sup>(n+1)/2</sup>，n为奇数时t(n) = 1 + 2<sup>(n+2)/2</sup><sup>[4](https://www.mathworks.com/help/comm/ref/comm.goldsequence-system-object.html)</sup> |
| GPS应用 | C/A码是一条1023位的金码，由10级移位寄存器产生的两条1023位码型G1和G2<sub>i</sub>经模2求和而成，时钟频率1.023 MHz，每毫秒重复一次<sup>[2](https://archive.gps.gov/technical/icwg/IS-GPS-200M.pdf)</sup><sup> • </sup><sup>[5](https://help.fieldsystems.trimble.com/tbc/2317.htm)</sup> |
| 集合规模示例 | 当n = 6（码长63）时，共有65条不同的金码，全码最大互相关为17<sup>[6](https://www.cs.cityu.edu.hk/~dapengwu/books/EE/communications/CDMA/CDMA.htm)</sup> |
| 代数性质 | 金码集合是BCH码码字集合的一个子集<sup>[7](https://www.sciencedirect.com/topics/engineering/spread-spectrum-communications)</sup> |
| 核指挥含义 | 金码即美国总统的核认证码，印在一张名为“饼干”的塑料卡上，据报道每日更新<sup>[3](https://ahf.nuclearmuseum.org/ahf/history/nuclear-briefcases/)</sup><sup> • </sup><sup>[8](https://www.nonproliferation.org/wp-content/uploads/2019/02/Finger-on-the-Nuclear-Button.pdf)</sup> |

## 起源

罗伯特·戈尔德在1967年发表于《IEEE信息论汇刊》（第13卷第4期，第619–621页）的一篇通信论文《用于扩频多路复用的最优二进制序列》中介绍了这类序列。<sup>[1](https://cir.nii.ac.jp/crid/1360292619816079488)</sup> 该文针对的是m序列——即由单个线性反馈移位寄存器产生的最大长度序列——的一个实际局限：对于给定的寄存器长度，不同m序列的数量很少，而两条不同m序列之间的互相关可能很大。<sup>[6](https://www.cs.cityu.edu.hk/~dapengwu/books/EE/communications/CDMA/CDMA.htm)</sup> 一个由众多发射机共享频带的系统，需要一大族相互干扰小且可预测的码，戈尔德的构造恰好提供了这一点。戈尔德1968年的后续论文描述了具有三值互相关函数的最大递归序列。<sup>[9](https://www.csauthors.net/robert-gold/)</sup>

## 构造与相关特性

**优选对。** 金码集由两条周期相同的m序列u和v构成，二者周期均为N = 2<sup>n</sup> − 1，称为优选对。要成为优选对，n不能被4整除，且v必须等于u[q]，其中q为奇数，且q = 2<sup>k</sup> + 1或q = 2<sup>2k</sup> − 2<sup>k</sup> + 1。<sup>[4](https://www.mathworks.com/help/comm/ref/comm.goldsequence-system-object.html)</sup> 该集合即为

\[ G(u,v) = \{u,\; v,\; u \oplus v,\; u \oplus Tv,\; u \oplus T^{2}v,\; \ldots,\; u \oplus T^{N-1}v \} \]

其中T为循环左移算子，\( \oplus \)表示模2加法。该集合包含N + 2条周期为N的序列：两条原始m序列，加上N个移位位置各对应的一条码。<sup>[4](https://www.mathworks.com/help/comm/ref/comm.goldsequence-system-object.html)</sup>

**三值互相关。** 其定义性性质是：集合中任意两条序列之间，或它们的移位版本之间的周期互相关只取三个值：−t(n)、−1和t(n) − 2，其中n为偶数时t(n) = 1 + 2<sup>(n+1)/2</sup>，n为奇数时t(n) = 1 + 2<sup>(n+2)/2</sup>。<sup>[4](https://www.mathworks.com/help/comm/ref/comm.goldsequence-system-object.html)</sup> 戈尔德的定理给出了这些值在每个周期内的分布；参数e = gcd(k, n)决定了较大相关幅值出现的频率与其幅度大小之间的权衡。<sup>[10](https://www.eurasip.org/Proceedings/Eusipco/2002/articles/paper604.pdf)</sup> 金码的自相关在零延迟处等于其周期N，非零延迟的旁瓣一般不取±1值，从而给出接收机同步所需的尖锐、狭窄的自相关峰。<sup>[11](https://sepwww.stanford.edu/data/media/public/docs/sep136/claudio1/paper_html/node3.html)</sup><sup> • </sup><sup>[20](https://in.mathworks.com/help/comm/ref/comm.goldsequence-system-object.html)</sup>

**集合规模与相关性的权衡。** 这种构造以峰值互相关的适度上升换取一个大的码族。当n = 6、码长为63时，共有65条不同的金码，全码最大互相关为17；当n = 10（GPS所用长度）时，该族有1025个成员，峰值互相关以2<sup>(n+1)/2</sup> + 1 = 65为界。<sup>[6](https://www.cs.cityu.edu.hk/~dapengwu/books/EE/communications/CDMA/CDMA.htm)</sup><sup> • </sup><sup>[12](https://www.sss-mag.com/pdf/Ss_jme_denayer_intro_print.pdf)</sup> 从代数上看，金码构成[BCH码](https://www.edgepedia.org/zh/bch-code)——一类纠错码——码字集合的一个子集。<sup>[7](https://www.sciencedirect.com/topics/engineering/spread-spectrum-communications)</sup>

## 在GPS中的应用

最清晰的大规模应用是GPS的粗捕获（C/A）码。每颗GPS卫星播发自己独有的1023位金码，即两条1023位线性码型G1和G2<sub>i</sub>的模2和。G1和G2序列来自10级移位寄存器，其多项式为G1 = X<sup>10</sup> + X<sup>3</sup> + 1和G2 = X<sup>10</sup> + X<sup>9</sup> + X<sup>8</sup> + X<sup>6</sup> + X<sup>3</sup> + X<sup>2</sup> + 1，初始化为1111111111，由10.23 MHz的P码时钟派生出的1.023 MHz时钟驱动。<sup>[2](https://archive.gps.gov/technical/icwg/IS-GPS-200M.pdf)</sup> 卫星专属码是通过将G2序列等效延迟整数个码片产生的，在常见的双抽头实现中，这通过将两个寄存器级输出进行模2加法来完成；这种实现只能生成有限的一组有效C/A码。<sup>[2](https://archive.gps.gov/technical/icwg/IS-GPS-200M.pdf)</sup> 在每秒102.3万个码片下，1023码片的序列每毫秒重复一次，每颗卫星独有的序列使接收机能够将其与所有其他卫星区分开来。<sup>[5](https://help.fieldsystems.trimble.com/tbc/2317.htm)</sup><sup> • </sup><sup>[13](https://indico.ictp.it/event/a09138/session/24/contribution/14/material/0/0.pdf)</sup>

由于GPS是一种扩频系统，在其L1 C/A、L1C、L2C和L5信号上播发预定义的重复PRN码，码族必须集中管理。GPS.gov发布这些PRN码的分配表，并将同一码族中的码分配给星基增强系统等增强系统，以防止码重复，并避免使用相关特性差的码干扰接收机性能。<sup>[14](https://www.gps.gov/pseudorandom-noise-code-assignments)</sup>

## 在CDMA中的应用及与其他码族的比较

在直接序列CDMA中，金码用作码片序列，使多个发射机共享同一频带；族成员之间的低互相关限制了多址干扰。<sup>[11](https://sepwww.stanford.edu/data/media/public/docs/sep136/claudio1/paper_html/node3.html)</sup> 实际扩频系统在沃尔什-哈达玛码、m序列、金码和卡萨米码之间进行选择。沃尔什序列是正交的，当所有用户同步时可消除多址干扰，但它们缺乏狭窄的自相关峰，能量只分布在少数几个离散频率分量上，并且在部分序列相关和多径条件下会失去正交性优势。m序列具有近乎理想的自相关，但其互相关往往较大。金码和卡萨米码在精心选取时，自相关和互相关函数接近理想，不过这两个族中的个别成员仍可能表现出较大的互相关。<sup>[6](https://www.cs.cityu.edu.hk/~dapengwu/books/EE/communications/CDMA/CDMA.htm)</sup> 在相同码长M下比较，卡萨米码的峰值互相关更低，而金码的互相关函数更频繁地取最低可能值−1/M。<sup>[15](https://eden.dei.uc.pt/~tbohnert/wimax/ofdm-ebook.pdf)</sup>

## 核指挥与控制中的金码

这一名称还有一个独立且无关的用法，指美国核指挥系统中的**金码**。这是总统在核打击命令执行前向五角大楼证明自身身份所用的认证码。它们写在一张名为“饼干”的塑料卡上，由总统随身携带，没有它总统无法授权打击。<sup>[3](https://ahf.nuclearmuseum.org/ahf/history/nuclear-briefcases/)</sup> 据报道，这张卡是信用卡大小的密封认证系统卡，由[国家安全局](https://www.edgepedia.org/zh/national-security-agency)制造，每日更新。<sup>[8](https://www.nonproliferation.org/wp-content/uploads/2019/02/Finger-on-the-Nuclear-Button.pdf)</sup> 使用时，五角大楼作战室的一名军官发出一个挑战码，总统从卡上读出匹配的码；这些码用于认证命令，而非解锁武器，因为发射人员所需的解锁码保存在军事指挥中心。<sup>[16](https://www.livescience.com/nuclear-codes)</sup><sup> • </sup><sup>[17](https://www.armscontrol.org/act/2018-01/features/strengthening-checks-presidential-nuclear-launch-authority)</sup>

“饼干”与核足球分开随总统行动。核足球是约45磅重的作战计划与通信设备挎包，由一名军事助手携带，这一做法在[古巴导弹危机](https://www.edgepedia.org/zh/cuban-missile-crisis)之后逐渐形成。<sup>[3](https://ahf.nuclearmuseum.org/ahf/history/nuclear-briefcases/)</sup> 该系统曾有过广为人知的疏漏：[吉米·卡特](https://www.edgepedia.org/zh/jimmy-carter)总统曾把“饼干”落在送去干洗的衣服里；1981年，罗纳德·里根总统遇刺未遂后接受手术期间，他的卡与他分离；比尔·克林顿总统曾有一段时间丢失了他的“饼干”。<sup>[18](https://www.armscontrol.org/act/2025-03/features/presidents-and-nuclear-football)</sup> 在现行宪法安排下，总统独享下令使用美国核武器的权力，军方领导人和国会均无权否决这一命令。<sup>[19](https://www.everycrsreport.com/reports/IF10521.html)</sup>

## References

1. [R. Gold (1967). Optimal binary sequences for spread spectrum multiplexing (Corresp.). IEEE Transactions on Information Theory 13(4), 619–621.](https://cir.nii.ac.jp/crid/1360292619816079488)
2. [GPS Interface Specification IS-GPS-200, Revision M (May 2021), C/A-Code Generation.](https://archive.gps.gov/technical/icwg/IS-GPS-200M.pdf)
3. [Nuclear Briefcases, National Museum of Nuclear Science & History.](https://ahf.nuclearmuseum.org/ahf/history/nuclear-briefcases/)
4. [comm.GoldSequence System object reference, MathWorks.](https://www.mathworks.com/help/comm/ref/comm.goldsequence-system-object.html)
5. [Coarse Acquisition (C/A) code, Trimble help.](https://help.fieldsystems.trimble.com/tbc/2317.htm)
6. [Code selection (CDMA course notes), City University of Hong Kong.](https://www.cs.cityu.edu.hk/~dapengwu/books/EE/communications/CDMA/CDMA.htm)
7. [Spread Spectrum Communications overview, ScienceDirect Topics.](https://www.sciencedirect.com/topics/engineering/spread-spectrum-communications)
8. [Finger on the Nuclear Button: The Authority to Use Nuclear Weapons in Nuclear-Armed States, James Martin Center for Nonproliferation Studies.](https://www.nonproliferation.org/wp-content/uploads/2019/02/Finger-on-the-Nuclear-Button.pdf)
9. [Robert Gold author profile, CSAwards.](https://www.csauthors.net/robert-gold/)
10. [Gold sequences and their moments, EURASIP Proceedings EUSIPCO 2002, paper 604.](https://www.eurasip.org/Proceedings/Eusipco/2002/articles/paper604.pdf)
11. [Gold codes, Stanford Exploration Project report 136.](https://sepwww.stanford.edu/data/media/public/docs/sep136/claudio1/paper_html/node3.html)
12. [Spread Spectrum (Denayer), sss-mag.com.](https://www.sss-mag.com/pdf/Ss_jme_denayer_intro_print.pdf)
13. [GPS Receivers, Receiver Signals and Principles of Operation, ICTP lecture notes.](https://indico.ictp.it/event/a09138/session/24/contribution/14/material/0/0.pdf)
14. [Pseudorandom Noise Code Assignments, GPS.gov.](https://www.gps.gov/pseudorandom-noise-code-assignments)
15. [Theory and Applications of OFDM and CDMA (Hanzo et al., Wiley 2005).](https://eden.dei.uc.pt/~tbohnert/wimax/ofdm-ebook.pdf)
16. [What are the nuclear codes? Live Science.](https://www.livescience.com/nuclear-codes)
17. [Bruce Blair (2018). Strengthening Checks on Presidential Nuclear Launch Authority. Arms Control Today.](https://www.armscontrol.org/act/2018-01/features/strengthening-checks-presidential-nuclear-launch-authority)
18. [Presidents and the 'Nuclear Football,' Arms Control Association, March 2025.](https://www.armscontrol.org/act/2025-03/features/presidents-and-nuclear-football)
19. [Authority to Launch Nuclear Forces, Congressional Research Service IF10521.](https://www.everycrsreport.com/reports/IF10521.html)
20. [Comm.goldsequence System Object, in.mathworks.com](https://in.mathworks.com/help/comm/ref/comm.goldsequence-system-object.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 大规模杀伤性武器 › Nuclear weapons design and testing

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/gold-codes

English original: https://www.edgepedia.org/gold-codes
