File symsync_core.h¶
FileList > inc > symsync > symsync_core.h
Go to the source code of this file
SymbolSync component API. More...
#include "clib_common.h"#include "dp_state.h"#include "farrow/farrow_core.h"#include "jm_perf.h"#include "loop_filter/loop_filter_core.h"#include "nco/nco_core.h"
Classes¶
| Type | Name |
|---|---|
| struct | symsync_state_t SymbolSync state. |
Public Functions¶
| Type | Name |
|---|---|
| void | symsync_configure (symsync_state_t * state, double bn, double zeta) |
| symsync_state_t * | symsync_create (size_t sps, double bn, double zeta, int order) Create a symsync instance. |
| void | symsync_destroy (symsync_state_t * state) Destroy a symsync instance and release all memory. |
| double | symsync_get_bn (const symsync_state_t * state) |
| double | symsync_get_rate (const symsync_state_t * state) |
| void | symsync_get_state (const symsync_state_t * state, void * blob) |
| double | symsync_get_timing_error (const symsync_state_t * state) |
| void | symsync_init (symsync_state_t * s, size_t sps, double bn, double zeta, int order) Initialise a SymbolSync in place (no allocation). |
| void | symsync_reset (symsync_state_t * state) Reset SymbolSync to its post-create state. |
| void | symsync_set_bn (symsync_state_t * state, double val) |
| int | symsync_set_state (symsync_state_t * state, const void * blob) |
| size_t | symsync_state_bytes (const symsync_state_t * state) |
| JM_FORCEINLINE JM_HOT int | symsync_step (symsync_state_t * s, float complex x, float complex * y_out) Per-sample symbol-timing step (the inline composition API). |
| size_t | symsync_steps (symsync_state_t * state, const float complex * x, size_t x_len, float complex * out, size_t max_out) |
| size_t | symsync_steps_max_out (symsync_state_t * state) |
Macros¶
| Type | Name |
|---|---|
| define | SYMSYNC_STATE_MAGIC [**DP\_FOURCC**](dp__state_8h.md#define-dp_fourcc) ('S','Y','N','C') |
| define | SYMSYNC_STATE_VERSION 1u |
Detailed Description¶
Lifecycle: create -> [step / steps / reset]* -> destroy
Example:
symsync_state_t *obj = symsync_create(4, 0.01, 0.707, 0);
float complex y = symsync_step(obj, 0.0f + 0.0f * I);
symsync_destroy(obj);
Public Functions Documentation¶
function symsync_configure¶
function symsync_create¶
Create a symsync instance.
Parameters:
spssps (default: 4).bnbn (default: 0.01).zetazeta (default: 0.707).orderEnum index; 0=linear…2=cubic.
Returns:
Heap-allocated state, or NULL on allocation failure.
Note:
Caller must call symsync_destroy() when done.
function symsync_destroy¶
Destroy a symsync instance and release all memory.
Parameters:
stateMay be NULL.
function symsync_get_bn¶
function symsync_get_rate¶
function symsync_get_state¶
function symsync_get_timing_error¶
function symsync_init¶
Initialise a SymbolSync in place (no allocation).
The by-value counterpart to symsync_create(): lets a composing object embed a symsync_state_t by value and initialise it without a heap allocation (symsync_state_t holds no heap members — the NCO, Farrow and loop filter are all by value). Mirrors loop_filter_init()/costas_init().
Parameters:
sState to initialise. Must be non-NULL.spsNominal samples per symbol.bnLoop noise bandwidth (normalised to the symbol rate).zetaDamping factor (0.707 = critically damped).orderFarrow interpolator order (0=linear, 1=parabolic, 2=cubic).
function symsync_reset¶
Reset SymbolSync to its post-create state.
Parameters:
stateMust be non-NULL.
function symsync_set_bn¶
function symsync_set_state¶
function symsync_state_bytes¶
function symsync_step¶
Per-sample symbol-timing step (the inline composition API).
JM_FORCEINLINE JM_HOT int symsync_step (
symsync_state_t * s,
float complex x,
float complex * y_out
)
Pushes one input sample into the Farrow history and advances the integer timing NCO. When the NCO crosses its half-scale (mid-symbol) it stores the Gardner mid interpolant; when it wraps (on-time) it forms the on-time interpolant, runs the Gardner TED, steers the NCO frequency, and emits the timing-corrected symbol. Returns 1 and writes y_out on an on-time symbol, else 0. symsync_steps() is exactly this in a loop; a tracking channel inlines it to drive a downstream carrier loop on the recovered symbols.
Parameters:
sState. Must be non-NULL.xOne input sample.y_outReceives the symbol when the return is 1.
Returns:
1 if a symbol was emitted (into y_out), 0 otherwise.
function symsync_steps¶
size_t symsync_steps (
symsync_state_t * state,
const float complex * x,
size_t x_len,
float complex * out,
size_t max_out
)
function symsync_steps_max_out¶
Macro Definition Documentation¶
define SYMSYNC_STATE_MAGIC¶
define SYMSYNC_STATE_VERSION¶
The documentation for this class was generated from the following file native/inc/symsync/symsync_core.h