id: apollo_pcm_frame_sync label: Apollo PCM Frame Sync category: '[Apollo USB]' flags: [python] parameters: - id: bit_rate label: Bit Rate (bps) dtype: int default: '51200' options: ['51200', '1600'] option_labels: ['High (51.2 kbps)', 'Low (1.6 kbps)'] - id: max_bit_errors label: Max Sync Bit Errors dtype: int default: '3' inputs: - label: in domain: stream dtype: byte outputs: - label: frames domain: message templates: imports: from apollo import pcm_frame_sync make: >- apollo.pcm_frame_sync.pcm_frame_sync( bit_rate=${bit_rate}, max_bit_errors=${max_bit_errors}) documentation: |- Apollo PCM Frame Synchronizer Acquires the 32-bit frame sync pattern from an NRZ bit stream and outputs complete PCM frames as PDU messages. The sync word format is: [5-bit A][15-bit core][6-bit B][6-bit frame ID] The 15-bit core is complemented on odd-numbered frames. The correlator checks against both patterns simultaneously using Hamming distance. State machine: SEARCH -> VERIFY -> LOCKED (back to SEARCH on N misses). Parameters: bit_rate: 51200 (128 words/frame, 50 fps) or 1600 (200 words/frame, 1 fps) max_bit_errors: Hamming distance threshold for sync detection (default 3) Output PDU metadata: frame_id: Frame number within subframe (1-50) odd_frame: True if odd frame (complemented core) sync_confidence: Number of correct sync bits (out of 32) timestamp: System time at frame detection file_format: 1