All constants are defined in apollo.constants and trace directly to the 1965 NAA Telecommunication Systems Study Guide (Course A-624) via the IMPLEMENTATION_SPEC.md section references noted in each table.
from apollo.constants import DOWNLINK_FREQ_HZ , PCM_HIGH_BIT_RATE , SCO_FREQUENCIES
IMPL_SPEC section 2.1.
Constant Value Unit Description DOWNLINK_FREQ_HZ2,287,500,000 Hz Downlink carrier: spacecraft to ground (2287.5 MHz) UPLINK_FREQ_HZ2,106,406,250 Hz Uplink carrier: ground to spacecraft (2106.40625 MHz) COHERENT_RATIO(240, 221) — Coherent turnaround ratio: Tx = Rx x 240/221 VCO_REFERENCE_HZ19,062,500 Hz Master oscillator reference (19.0625 MHz)
IMPL_SPEC section 2.3.
Constant Value Unit Description PM_PEAK_DEVIATION_RAD0.133 rad Peak phase deviation (7.6 degrees) PM_SENSITIVITY_RAD_PER_V0.033 rad/V PM sensitivity at 1 kHz FM_VCO_SENSITIVITY_HZ_PER_V1,500,000 Hz/V FM VCO sensitivity (1.5 MHz peak / V peak) FM_MODULATION_BW_HZ1,500,000 Hz FM modulation bandwidth (5 Hz to 1.5 MHz)
IMPL_SPEC section 4.2.
Constant Value Unit Description PCM_SUBCARRIER_HZ1,024,000 Hz PCM telemetry subcarrier (1.024 MHz, BPSK modulated) VOICE_SUBCARRIER_HZ1,250,000 Hz Voice subcarrier (1.25 MHz, FM modulated) EMERGENCY_KEY_HZ512,000 Hz Emergency keyed carrier (512 kHz)
Constant Value Unit Description PCM_BPF_LOW_HZ949,000 Hz Lower edge of PCM bandpass filter PCM_BPF_HIGH_HZ1,099,000 Hz Upper edge of PCM bandpass filter PCM_BPF_BW_HZ150,000 Hz PCM bandpass filter bandwidth (derived: HIGH - LOW)
Constant Value Unit Description VOICE_FM_DEVIATION_HZ29,000 Hz Voice FM deviation (+/-29 kHz) VOICE_AUDIO_LOW_HZ300 Hz Voice audio passband lower edge VOICE_AUDIO_HIGH_HZ3,000 Hz Voice audio passband upper edge
IMPL_SPEC section 2.2.
Constant Value Unit Description UPLINK_VOICE_SUBCARRIER_HZ30,000 Hz Uplink voice subcarrier (30 kHz FM) UPLINK_DATA_SUBCARRIER_HZ70,000 Hz Uplink data subcarrier (70 kHz FM)
IMPL_SPEC section 5.5.
Constant Value Unit Description MASTER_CLOCK_HZ512,000 Hz CTE master clock (512 kHz). All timing derived from this
The master clock divides to produce both bit rates:
High rate: 512 kHz / 10 = 51.2 kHz
Low rate: 512 kHz / 320 = 1.6 kHz
IMPL_SPEC sections 5.1, 5.2.
Constant Value Unit Description PCM_HIGH_BIT_RATE51,200 bps High bit rate (51.2 kbps NRZ, MSB first) PCM_HIGH_CLOCK_DIVIDER10 — Master clock divisor: 512 kHz / 10 PCM_HIGH_WORD_RATE6,400 words/s Word rate at high bit rate PCM_HIGH_WORDS_PER_FRAME128 words Words per frame at high rate PCM_HIGH_FRAMES_PER_SEC50 fps Frame rate at high bit rate PCM_HIGH_FRAME_PERIOD_US19,968 us Frame period in microseconds
Constant Value Unit Description PCM_LOW_BIT_RATE1,600 bps Low bit rate (1.6 kbps) PCM_LOW_CLOCK_DIVIDER320 — Master clock divisor: 512 kHz / 320 PCM_LOW_WORD_RATE200 words/s Word rate at low bit rate PCM_LOW_WORDS_PER_FRAME200 words Words per frame at low rate PCM_LOW_FRAMES_PER_SEC1 fps Frame rate at low bit rate
Constant Value Unit Description PCM_WORD_LENGTH8 bits Bits per telemetry word PCM_SYNC_WORD_LENGTH32 bits Sync pattern length (4 words) PCM_SYNC_A_LENGTH5 bits Selectable A field width PCM_SYNC_CORE_LENGTH15 bits Fixed core pattern width (complemented on odd frames) PCM_SYNC_B_LENGTH6 bits Selectable B field width PCM_SYNC_FRAME_ID_LENGTH6 bits Frame ID field width (encodes 1-50)
Constant Value Unit Description SUBFRAME_FRAMES50 frames Frames per subframe (high rate) SUBFRAME_PERIOD_S1.0 s Subframe period
These are the patchboard-configurable values used as defaults. On real hardware, these were set by wiring jumpers on the PCM encoder.
Constant Value (binary) Value (decimal) Description DEFAULT_SYNC_A1010121 5-bit A field DEFAULT_SYNC_CORE11100110101110029404 15-bit fixed core (even-frame value) DEFAULT_SYNC_B11010052 6-bit B field
IMPL_SPEC section 5.3.
Constant Value Unit Description ADC_BITS8 bits ADC resolution ADC_ZERO_CODE1 — Code for 0V input (00000001) ADC_FULLSCALE_CODE254 — Code for 4.98V input (11111110) ADC_OVERFLOW_CODE255 — Code for >5V input (11111111) ADC_FULLSCALE_VOLTAGE4.98 V Full-scale input voltage ADC_STEP_MV19.7 mV Voltage per least-significant bit ADC_LOW_LEVEL_GAIN125 — Gain multiplier for low-level inputs (0-40 mV range)
The conversion formula is:
voltage = (code - 1) * 4.98 / 253
For low-level inputs (0-40 mV), the amplifier applies x125 gain before digitization. To recover the actual input voltage, divide by 125.
IMPL_SPEC section 4.3. These 9 SCO channels are present only in FM downlink mode.
Constant Value Unit Description SCO_DEVIATION_PERCENT7.5 % Deviation as percentage of center frequency (+/-) SCO_INPUT_RANGE_V(0.0, 5.0) V DC input voltage range SCO_OUTPUT_LEVEL_V0.707 V Peak output level into 5.11 kOhm
SCO_FREQUENCIES is a dict mapping channel number to center frequency:
SCO Channel Center Frequency (Hz) Deviation +/- (Hz) Low Freq (Hz) High Freq (Hz) 1 14,500 1,087.5 13,412.5 15,587.5 2 22,000 1,650.0 20,350.0 23,650.0 3 30,000 2,250.0 27,750.0 32,250.0 4 40,000 3,000.0 37,000.0 43,000.0 5 52,500 3,937.5 48,562.5 56,437.5 6 70,000 5,250.0 64,750.0 75,250.0 7 95,000 7,125.0 87,875.0 102,125.0 8 125,000 9,375.0 115,625.0 134,375.0 9 165,000 12,375.0 152,625.0 177,375.0
All SCOs map 0-5V DC input linearly to the frequency deviation range. 0V corresponds to the low frequency limit, 2.5V to the center, and 5V to the high frequency limit.
IMPL_SPEC section 1.
Constant Value Unit Description AGC_PORT_BASE19697 — TCP port base for yaAGC socket connections AGC_MAX_CLIENTS10 — Maximum concurrent client connections
Channels are defined in octal in the original AGC documentation. The constants store decimal equivalents.
Constant Octal Decimal Description AGC_CH_INLINK045 37 Uplink data input (ground to AGC) AGC_CH_OUTLINK057 47 Downlink data output (AGC to ground) AGC_CH_DNTM1034 28 Telemetry word 1 (high byte) AGC_CH_DNTM2035 29 Telemetry word 2 (low byte) AGC_CH_OUT0010 8 Relay rows AGC_CH_DSALMOUT011 9 DSKY alarms AGC_CH_CHAN13013 11 Radar activity AGC_CH_CHAN30030 24 Status/alarm bits AGC_CH_CHAN33033 27 AGC warning input
AGC_TELECOM_CHANNELS is a frozenset containing the four primary telecom channels used by the bridge filter:
AGC_TELECOM_CHANNELS = frozenset ( {
AGC_CH_INLINK, # 37 (045 octal)
AGC_CH_OUTLINK, # 47 (057 octal)
AGC_CH_DNTM1, # 28 (034 octal)
AGC_CH_DNTM2, # 29 (035 octal)
Constant Value Unit Description AGC_DOWNLINK_BUFFER_WORDS400 15-bit words Size of one complete downlink data snapshot
From DecodeDigitalDownlink.c in the Virtual AGC project :
Constant Value Description DL_CM_POWERED_LIST0 CM Powered Flight DL_LM_ORBITAL_MANEUVERS1 LM Orbital Maneuvers DL_CM_COAST_ALIGN2 CM Coast/Alignment DL_LM_COAST_ALIGN3 LM Coast/Alignment DL_LM_DESCENT_ASCENT7 LM Descent/Ascent DL_LM_LUNAR_SURFACE_ALIGN8 LM Lunar Surface Alignment DL_CM_ENTRY_UPDATE9 CM Entry Update
Constant Value Unit Description SAMPLE_RATE_BASEBAND5,120,000 Hz Baseband rate: 10x master clock (5.12 MHz) SAMPLE_RATE_RF10,240,000 Hz RF rate: 20x master clock (10.24 MHz)
Both rates are integer multiples of the 512 kHz master clock, ensuring clean relationships with all PCM timing.
IMPL_SPEC section 2.2.
Constant Value Unit Description RX_PLL_BW_HZ318 Hz PLL bandwidth at threshold RX_STATIC_PHASE_ERROR_DEG6.0 degrees Maximum static phase error RX_AGC_RANGE_DB80 dB AGC dynamic range (-132 to -52 dBm) RX_AGC_TIME_CONSTANT_S5.7 s AGC time constant RX_THRESHOLD_DBM-132.5 dBm Receiver sensitivity threshold
IMPL_SPEC section 2.3 and 3.1.
Constant Value Unit Description TX_POWER_MW300 mW Transmitter power (250-400 mW typical) TX_IMPEDANCE_OHM50 Ohm Output impedance
Constant Value Unit Description TWT_LOW_POWER_W5 W TWT low power mode TWT_HIGH_POWER_W20 W TWT high power mode TWT_WARMUP_S90 s TWT warmup time