Skip to content

Constants & Parameters

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.

ConstantValueUnitDescription
DOWNLINK_FREQ_HZ2,287,500,000HzDownlink carrier: spacecraft to ground (2287.5 MHz)
UPLINK_FREQ_HZ2,106,406,250HzUplink carrier: ground to spacecraft (2106.40625 MHz)
COHERENT_RATIO(240, 221)Coherent turnaround ratio: Tx = Rx x 240/221
VCO_REFERENCE_HZ19,062,500HzMaster oscillator reference (19.0625 MHz)

IMPL_SPEC section 2.3.

ConstantValueUnitDescription
PM_PEAK_DEVIATION_RAD0.133radPeak phase deviation (7.6 degrees)
PM_SENSITIVITY_RAD_PER_V0.033rad/VPM sensitivity at 1 kHz
FM_VCO_SENSITIVITY_HZ_PER_V1,500,000Hz/VFM VCO sensitivity (1.5 MHz peak / V peak)
FM_MODULATION_BW_HZ1,500,000HzFM modulation bandwidth (5 Hz to 1.5 MHz)

IMPL_SPEC section 4.2.

ConstantValueUnitDescription
PCM_SUBCARRIER_HZ1,024,000HzPCM telemetry subcarrier (1.024 MHz, BPSK modulated)
VOICE_SUBCARRIER_HZ1,250,000HzVoice subcarrier (1.25 MHz, FM modulated)
EMERGENCY_KEY_HZ512,000HzEmergency keyed carrier (512 kHz)
ConstantValueUnitDescription
PCM_BPF_LOW_HZ949,000HzLower edge of PCM bandpass filter
PCM_BPF_HIGH_HZ1,099,000HzUpper edge of PCM bandpass filter
PCM_BPF_BW_HZ150,000HzPCM bandpass filter bandwidth (derived: HIGH - LOW)
ConstantValueUnitDescription
VOICE_FM_DEVIATION_HZ29,000HzVoice FM deviation (+/-29 kHz)
VOICE_AUDIO_LOW_HZ300HzVoice audio passband lower edge
VOICE_AUDIO_HIGH_HZ3,000HzVoice audio passband upper edge

IMPL_SPEC section 2.2.

ConstantValueUnitDescription
UPLINK_VOICE_SUBCARRIER_HZ30,000HzUplink voice subcarrier (30 kHz FM)
UPLINK_DATA_SUBCARRIER_HZ70,000HzUplink data subcarrier (70 kHz FM)

IMPL_SPEC section 5.5.

ConstantValueUnitDescription
MASTER_CLOCK_HZ512,000HzCTE 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.

ConstantValueUnitDescription
PCM_HIGH_BIT_RATE51,200bpsHigh bit rate (51.2 kbps NRZ, MSB first)
PCM_HIGH_CLOCK_DIVIDER10Master clock divisor: 512 kHz / 10
PCM_HIGH_WORD_RATE6,400words/sWord rate at high bit rate
PCM_HIGH_WORDS_PER_FRAME128wordsWords per frame at high rate
PCM_HIGH_FRAMES_PER_SEC50fpsFrame rate at high bit rate
PCM_HIGH_FRAME_PERIOD_US19,968usFrame period in microseconds
ConstantValueUnitDescription
PCM_LOW_BIT_RATE1,600bpsLow bit rate (1.6 kbps)
PCM_LOW_CLOCK_DIVIDER320Master clock divisor: 512 kHz / 320
PCM_LOW_WORD_RATE200words/sWord rate at low bit rate
PCM_LOW_WORDS_PER_FRAME200wordsWords per frame at low rate
PCM_LOW_FRAMES_PER_SEC1fpsFrame rate at low bit rate
ConstantValueUnitDescription
PCM_WORD_LENGTH8bitsBits per telemetry word
PCM_SYNC_WORD_LENGTH32bitsSync pattern length (4 words)
PCM_SYNC_A_LENGTH5bitsSelectable A field width
PCM_SYNC_CORE_LENGTH15bitsFixed core pattern width (complemented on odd frames)
PCM_SYNC_B_LENGTH6bitsSelectable B field width
PCM_SYNC_FRAME_ID_LENGTH6bitsFrame ID field width (encodes 1-50)
ConstantValueUnitDescription
SUBFRAME_FRAMES50framesFrames per subframe (high rate)
SUBFRAME_PERIOD_S1.0sSubframe period

These are the patchboard-configurable values used as defaults. On real hardware, these were set by wiring jumpers on the PCM encoder.

ConstantValue (binary)Value (decimal)Description
DEFAULT_SYNC_A10101215-bit A field
DEFAULT_SYNC_CORE1110011010111002940415-bit fixed core (even-frame value)
DEFAULT_SYNC_B110100526-bit B field

IMPL_SPEC section 5.3.

ConstantValueUnitDescription
ADC_BITS8bitsADC resolution
ADC_ZERO_CODE1Code for 0V input (00000001)
ADC_FULLSCALE_CODE254Code for 4.98V input (11111110)
ADC_OVERFLOW_CODE255Code for >5V input (11111111)
ADC_FULLSCALE_VOLTAGE4.98VFull-scale input voltage
ADC_STEP_MV19.7mVVoltage per least-significant bit
ADC_LOW_LEVEL_GAIN125Gain 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.

ConstantValueUnitDescription
SCO_DEVIATION_PERCENT7.5%Deviation as percentage of center frequency (+/-)
SCO_INPUT_RANGE_V(0.0, 5.0)VDC input voltage range
SCO_OUTPUT_LEVEL_V0.707VPeak output level into 5.11 kOhm

SCO_FREQUENCIES is a dict mapping channel number to center frequency:

SCO ChannelCenter Frequency (Hz)Deviation +/- (Hz)Low Freq (Hz)High Freq (Hz)
114,5001,087.513,412.515,587.5
222,0001,650.020,350.023,650.0
330,0002,250.027,750.032,250.0
440,0003,000.037,000.043,000.0
552,5003,937.548,562.556,437.5
670,0005,250.064,750.075,250.0
795,0007,125.087,875.0102,125.0
8125,0009,375.0115,625.0134,375.0
9165,00012,375.0152,625.0177,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.

ConstantValueUnitDescription
AGC_PORT_BASE19697TCP port base for yaAGC socket connections
AGC_MAX_CLIENTS10Maximum concurrent client connections

Channels are defined in octal in the original AGC documentation. The constants store decimal equivalents.

ConstantOctalDecimalDescription
AGC_CH_INLINK04537Uplink data input (ground to AGC)
AGC_CH_OUTLINK05747Downlink data output (AGC to ground)
AGC_CH_DNTM103428Telemetry word 1 (high byte)
AGC_CH_DNTM203529Telemetry word 2 (low byte)
AGC_CH_OUT00108Relay rows
AGC_CH_DSALMOUT0119DSKY alarms
AGC_CH_CHAN1301311Radar activity
AGC_CH_CHAN3003024Status/alarm bits
AGC_CH_CHAN3303327AGC 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)
})
ConstantValueUnitDescription
AGC_DOWNLINK_BUFFER_WORDS40015-bit wordsSize of one complete downlink data snapshot

From DecodeDigitalDownlink.c in the Virtual AGC project:

ConstantValueDescription
DL_CM_POWERED_LIST0CM Powered Flight
DL_LM_ORBITAL_MANEUVERS1LM Orbital Maneuvers
DL_CM_COAST_ALIGN2CM Coast/Alignment
DL_LM_COAST_ALIGN3LM Coast/Alignment
DL_LM_DESCENT_ASCENT7LM Descent/Ascent
DL_LM_LUNAR_SURFACE_ALIGN8LM Lunar Surface Alignment
DL_CM_ENTRY_UPDATE9CM Entry Update

ConstantValueUnitDescription
SAMPLE_RATE_BASEBAND5,120,000HzBaseband rate: 10x master clock (5.12 MHz)
SAMPLE_RATE_RF10,240,000HzRF 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.

ConstantValueUnitDescription
RX_PLL_BW_HZ318HzPLL bandwidth at threshold
RX_STATIC_PHASE_ERROR_DEG6.0degreesMaximum static phase error
RX_AGC_RANGE_DB80dBAGC dynamic range (-132 to -52 dBm)
RX_AGC_TIME_CONSTANT_S5.7sAGC time constant
RX_THRESHOLD_DBM-132.5dBmReceiver sensitivity threshold

IMPL_SPEC section 2.3 and 3.1.

ConstantValueUnitDescription
TX_POWER_MW300mWTransmitter power (250-400 mW typical)
TX_IMPEDANCE_OHM50OhmOutput impedance
ConstantValueUnitDescription
TWT_LOW_POWER_W5WTWT low power mode
TWT_HIGH_POWER_W20WTWT high power mode
TWT_WARMUP_S90sTWT warmup time