Implement the transmit/generate side as streaming GNU Radio blocks, complementing the existing receive chain. Each block maps to a physical instrument on CuriousMarc's Keysight bench: pcm_frame_source - PCM bit stream generator (sync_block + FrameSourceEngine) nrz_encoder - bits to NRZ waveform (+1/-1) with upsampling bpsk_subcarrier_mod - NRZ x cos(1.024 MHz) BPSK modulator fm_voice_subcarrier_mod - 1.25 MHz FM test tone source pm_mod - phase modulator: exp(j * deviation * input) usb_signal_source - convenience wrapper wiring all blocks together Includes GRC YAML definitions for all blocks under [Apollo USB] category, 49 new tests (271 total, all passing), and a loopback test that validates the full TX->RX round trip including frame recovery with 30 dB AWGN.
53 lines
1.2 KiB
YAML
53 lines
1.2 KiB
YAML
id: apollo_nrz_encoder
|
|
label: Apollo NRZ Encoder
|
|
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: sample_rate
|
|
label: Sample Rate
|
|
dtype: real
|
|
default: '5120000'
|
|
|
|
inputs:
|
|
- label: in
|
|
domain: stream
|
|
dtype: byte
|
|
|
|
outputs:
|
|
- label: out
|
|
domain: stream
|
|
dtype: float
|
|
|
|
templates:
|
|
imports: from apollo.nrz_encoder import nrz_encoder
|
|
make: apollo.nrz_encoder.nrz_encoder(bit_rate=${bit_rate}, sample_rate=${sample_rate})
|
|
|
|
documentation: |-
|
|
Apollo NRZ Encoder
|
|
|
|
Converts a stream of byte values (0 or 1) to a Non-Return-to-Zero
|
|
baseband waveform at the specified sample rate.
|
|
|
|
Mapping:
|
|
bit 1 -> +1.0 (held for bit period)
|
|
bit 0 -> -1.0 (held for bit period)
|
|
|
|
Each bit value is upsampled by samples_per_bit = sample_rate / bit_rate.
|
|
At the default high rate (51.2 kbps, 5.12 MHz), this is 100 samples
|
|
per bit. At low rate (1.6 kbps), it is 3200 samples per bit.
|
|
|
|
This is the transmit-side counterpart to the slicer in bpsk_demod.
|
|
|
|
Parameters:
|
|
bit_rate: PCM bit rate in bps (51200 high, 1600 low)
|
|
sample_rate: Output sample rate in Hz (default 5.12 MHz)
|
|
|
|
file_format: 1
|