File burst_demod_core.h¶
FileList > burst_demod > burst_demod_core.h
Go to the source code of this file
Feedforward BPSK DSSS frame demodulator. More...
#include "clib_common.h"#include "jm_perf.h"#include "ppe/ppe_core.h"#include "fft/fft_core.h"#include "spectral/spectral_core.h"#include <complex.h>
Classes¶
| Type | Name |
|---|---|
| struct | burst_demod_state_t BurstDemod state. Allocate with burst_demod_create() . |
Public Functions¶
| Type | Name |
|---|---|
| burst_demod_state_t * | burst_demod_create (const uint8_t * data_code, size_t data_code_len, size_t spc, double chip_rate, double carrier_hz, double max_rate, size_t payload_len, size_t est_segments) Create a burst demodulator. |
| size_t | burst_demod_demod (burst_demod_state_t * state, const float complex * x, size_t x_len, uint8_t * out, size_t max_out) Demodulate a burst; write the payload bits to out . |
| size_t | burst_demod_demod_max_out (burst_demod_state_t * state) Max output bits = payload_len (caller sizes the buffer). |
| void | burst_demod_destroy (burst_demod_state_t * state) Destroy a demodulator. |
| void | burst_demod_reset (burst_demod_state_t * state) Clear the read-backs (config is preserved). |
| void | burst_demod_set_preamble (burst_demod_state_t * state, const uint8_t * acq_code, size_t acq_code_len, size_t reps) Set the unmodulated acq preamble code + repetition count. |
| void | burst_demod_set_prior (burst_demod_state_t * state, double f0_coarse, size_t start) Seed from acquisition: coarse Doppler + preamble start sample. |
| void | burst_demod_set_sync (burst_demod_state_t * state, const uint8_t * sync, size_t sync_len) Set the known frame-sync word (0/1 symbols). |
Detailed Description¶
The whole post-acquisition payload chain, in C, with no tracking loops:
* preamble estimate — segment-despread the unmodulated, repeated acq preamble into partial correlations and feed them to ppe, giving a coarse (frequency, chirp-rate);
* sample-rate dechirp by (f0, rate) — removes Doppler AND Doppler rate;
* despread the data section with the (short) data code -> soft BPSK symbols;
* frame sync — correlate the symbols against the known sync word; the complex peak gives the frame offset and the residual phase (derotated);
* slice the payload to bits; verify the CRC-16 trailer -> frame_valid.
Seed from acquisition with set_prior(coarse Doppler, preamble start), set_preamble(acq code, reps) and set_sync(sync word), then demod(burst). One max_rate knob spans near-static Doppler (0) to severe LEO chirp. One-shot per burst. Composes ppe (which composes fft + spectral).
burst_demod_state_t *d = burst_demod_create(dcode, 50, 4, 1e6, 0, 0, 256, 10);
burst_demod_set_preamble(d, acode, 500, 5);
burst_demod_set_sync(d, sync, 31);
burst_demod_set_prior(d, f0_coarse, preamble_start);
size_t nbits = burst_demod_demod(d, x, n, bits, 256); // d->frame_valid ...
Public Functions Documentation¶
function burst_demod_create¶
Create a burst demodulator.
burst_demod_state_t * burst_demod_create (
const uint8_t * data_code,
size_t data_code_len,
size_t spc,
double chip_rate,
double carrier_hz,
double max_rate,
size_t payload_len,
size_t est_segments
)
Parameters:
data_codeData spreading code (0/1); copied.data_code_lenData spreading factor (chips/symbol).spcSamples per chip.chip_rateChip rate (Hz).carrier_hzRF carrier (Hz) for code-Doppler scaling; 0 = ignore.max_rateChirp-rate search half-span (cycles/sample^2 at the input rate); 0 = Doppler only (no rate search).payload_lenNumber of payload data symbols (bits) in a frame.est_segmentsPartial correlations per acq period (segmentation for the feedforward estimate; larger tolerates more rate).
Returns:
Heap state, or NULL on bad args / allocation failure.
function burst_demod_demod¶
Demodulate a burst; write the payload bits to out .
size_t burst_demod_demod (
burst_demod_state_t * state,
const float complex * x,
size_t x_len,
uint8_t * out,
size_t max_out
)
Returns:
Number of bits written (0 on failure / too-short burst). The read-back fields (frame_valid, est_*, frame_offset) are updated.
function burst_demod_demod_max_out¶
Max output bits = payload_len (caller sizes the buffer).
function burst_demod_destroy¶
Destroy a demodulator.
Parameters:
stateMay be NULL.
function burst_demod_reset¶
Clear the read-backs (config is preserved).
function burst_demod_set_preamble¶
Set the unmodulated acq preamble code + repetition count.
void burst_demod_set_preamble (
burst_demod_state_t * state,
const uint8_t * acq_code,
size_t acq_code_len,
size_t reps
)
function burst_demod_set_prior¶
Seed from acquisition: coarse Doppler + preamble start sample.
function burst_demod_set_sync¶
Set the known frame-sync word (0/1 symbols).
The documentation for this class was generated from the following file native/inc/burst_demod/burst_demod_core.h