File RateConverter_private.h¶
FileList > doppler > RateConverter > RateConverter_private.h
Go to the source code of this file
A matched RateConverter's sizing internals: the lone-symbol eye and the outputs as a linear map. More...
#include "doppler/RateConverter/RateConverter_core.h"#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | dp_rc_pre_t The stages ahead of a matched converter's bank as one filter at its input rate: output q of the last of them issum_j g[j] x[a q + b - j] . |
| struct | dp_rc_reader_t What the output model and the eyes read from a matched converter, built once for a group of reads (#3514). |
Public Functions¶
| Type | Name |
|---|---|
| double | dp_RateConverter_get_lone_eye (const dp_RateConverter_state_t * s) dp_RateConverter_get_data_eye() for a lone symbol: the same sum with no neighbor. |
| int | dp_RateConverter_output_model (const dp_RateConverter_state_t * s, size_t n_out, const double * at, const int * deriv, double phase, int n0, size_t n_sym, double * resp, double * cov, uint32_t * arm, double * es) The converter's outputs as a linear map of the symbols and the noise, from its tables: what a timing detector's statistics are computed from (docs/design/ratesync-timing.md, 9.4). |
| size_t | dp__RateConverter_execute_ctrl_push_pos (dp_RateConverter_state_t * s, float _Complex x, double ctrl, float _Complex * out, double * pos, size_t max_out) dp_RateConverter_execute_ctrl_push_tap() with no taps, also returning where each output sits on the terminal stage's input. |
| double | dp__RateConverter_pre_decim (const dp_RateConverter_state_t * s) The converter inputs one terminal-stage input stands for: the decimation of the integer stages ahead of the terminal resampler, or of the whole plan when it has no fractional tail. |
| void | dp_rc_reader_close (dp_rc_reader_t * r) Release what a reader holds and zero it. A NULL, zeroed or closed reader is a no-op; closing twice is safe. |
| int | dp_rc_reader_open (const dp_RateConverter_state_t * s, int with_noise, dp_rc_reader_t * r) Open a reader on a matched converter with derivative tables. |
| int | dp_rc_reader_output_model (const dp_rc_reader_t * r, size_t n_out, const double * at, const int * deriv, double phase, int n0, size_t n_sym, double * resp, double * cov, uint32_t * arm, double * es) dp_RateConverter_output_model() from an open reader. |
Public Static Functions¶
| Type | Name |
|---|---|
| double | dp__RateConverter_pos_to_input (double pos, double decim, double gd) A dp__RateConverter_execute_ctrl_push_pos() place on the converter's own input clock, where the output's CONTENT sits. |
Detailed Description¶
Kept out of RateConverter_core.h because no caller outside the library needs them: their users are RateSync's sizing and the receivers built on it, in C, and the converter's own tests and validators. A _private.h is not exported from the shared library (check_installed_headers.py); a component reaches it through the static archive, as async_dsss_pool reaches async_dsss_receiver_private.h. A public header, and so an inline function in one, must not include it.
Public Functions Documentation¶
function dp_RateConverter_get_lone_eye¶
dp_RateConverter_get_data_eye() for a lone symbol: the same sum with no neighbor.
The rectangle's optimum arms put a lone symbol at their designed place, so on them it reads only what the group delay's instant differs from that by, the arm truncation: under 0.0005 symbol on 1024 arms, 0.0039 on 64 arms at 16 input samples a symbol and two outputs. The root-raised cosine's is not near zero (+0.026 at span 4): its group delay names the arms' centroid, not the pulse's center.
Parameters:
sMust be non-NULL.
Returns:
As dp_RateConverter_get_data_eye().
function dp_RateConverter_output_model¶
The converter's outputs as a linear map of the symbols and the noise, from its tables: what a timing detector's statistics are computed from (docs/design/ratesync-timing.md, 9.4).
int dp_RateConverter_output_model (
const dp_RateConverter_state_t * s,
size_t n_out,
const double * at,
const int * deriv,
double phase,
int n0,
size_t n_sym,
double * resp,
double * cov,
uint32_t * arm,
double * es
)
Output i sits at[i] symbols after symbol 0's center on the timeline dp_RateConverter_get_data_eye() uses: its instant is the one dp_RateConverter_get_group_delay() names for that place, so the data eye's own output has at = dp_RateConverter_get_data_eye(). phase places symbol 0 on the bank's grid, a fraction of a bank sample; a loop steered across the arms sees every phase, and a caller averages over it. For symbols a_j, j = n0 .. n0 + n_sym - 1, of the transmitted pulse at unit amplitude, and complex white noise of variance s2 a sample at the converter's input, exactly, for every symbol the output reads within the range given. deriv[i] non-zero reads the derivative bank (the paired call's dy) for output i; arm[i] returns the arm it reads, the index of ml_c. *es returns the transmitted symbol's energy in input samples, so Es/N0 gamma means s2 = es / gamma.
Computed per call from the tables, as dp_RateConverter_get_data_eye() is: a sizing call made at create, not on the hot path.
Parameters:
sA matched converter with derivative tables (dp_RateConverter_has_derivative()).n_outOutputs described, > 0.atEach output's place, in symbols after symbol 0's center.derivEach output's bank: 0 the bank, non-zero the derivative bank; NULL for all 0.phaseSymbol 0 on the bank's grid, in [0, 1).n0The first symbol described.n_symSymbols described, > 0.respn_out x n_sym, row-major.covn_out x n_out, row-major.armn_outarm indices; may be NULL.esThe symbol's energy in input samples; may be NULL.
Returns:
DP_OK; DP_ERR_INVALID for a bad argument or a converter with no derivative tables; DP_ERR_MEMORY when memory is refused.
function dp__RateConverter_execute_ctrl_push_pos¶
dp_RateConverter_execute_ctrl_push_tap() with no taps, also returning where each output sits on the terminal stage's input.
size_t dp__RateConverter_execute_ctrl_push_pos (
dp_RateConverter_state_t * s,
float _Complex x,
double ctrl,
float _Complex * out,
double * pos,
size_t max_out
)
out is bit for bit the tap form's from the same state and input. pos[j] is dp_resamp_execute_ctrl_push_pos()'s for the terminal stage: the tick's place in terminal-stage inputs, relative to the one this call offers it, group delay not included. A call whose sample the integer stages swallow emits nothing and writes nothing. A plan with no fractional tail reports -1: its last stage emits on the input that completes it.
dp__RateConverter_pos_to_input() turns it into the converter's own input clock. Kept private: its caller is MpskReceiver's strobe time (doppler#3177), and the place it names is only as good as the group delay that converts it.
Parameters:
sState. Must be non-NULL.xOne input sample.ctrlAs dp_RateConverter_execute_ctrl_push_tap().outTerminal outputs.posTheir places, parallel toout. Must be non-NULL.max_outCapacity ofoutandpos.
Returns:
Number of outputs written.
function dp__RateConverter_pre_decim¶
The converter inputs one terminal-stage input stands for: the decimation of the integer stages ahead of the terminal resampler, or of the whole plan when it has no fractional tail.
Parameters:
sState. Must be non-NULL.
Returns:
The decimation, >= 1.
function dp_rc_reader_close¶
Release what a reader holds and zero it. A NULL, zeroed or closed reader is a no-op; closing twice is safe.
Parameters:
rThe reader; may be NULL.
function dp_rc_reader_open¶
Open a reader on a matched converter with derivative tables.
Parameters:
sThe converter. Must outlive the reader.with_noiseNon-zero to build the noise table the output model reads; the eyes read none.rA zeroed or closed reader.
Returns:
DP_OK; DP_ERR_INVALID for a NULL argument, a reader that is already open (it is left as it was), or a converter with no derivative tables (dp_RateConverter_output_model()'s refusal); DP_ERR_MEMORY when memory is refused. On a refusal r holds nothing and is closed.
function dp_rc_reader_output_model¶
dp_RateConverter_output_model() from an open reader.
int dp_rc_reader_output_model (
const dp_rc_reader_t * r,
size_t n_out,
const double * at,
const int * deriv,
double phase,
int n0,
size_t n_sym,
double * resp,
double * cov,
uint32_t * arm,
double * es
)
The same arguments, checks, outputs and bytes, r in place of the converter. The arguments are checked first, as the one-call function checks them; then whether the reader is current and opened with the noise table. Both refusals are DP_ERR_INVALID, and nothing is written.
Parameters:
rAn open reader.n_outAs dp_RateConverter_output_model().atAs dp_RateConverter_output_model().derivAs dp_RateConverter_output_model().phaseAs dp_RateConverter_output_model().n0As dp_RateConverter_output_model().n_symAs dp_RateConverter_output_model().respAs dp_RateConverter_output_model().covAs dp_RateConverter_output_model().armAs dp_RateConverter_output_model().esAs dp_RateConverter_output_model().
Returns:
DP_OK; DP_ERR_INVALID for a bad argument, a reader that is closed, not current or opened without the noise table; DP_ERR_MEMORY when its scratch is refused, with nothing written.
Public Static Functions Documentation¶
function dp__RateConverter_pos_to_input¶
A dp__RateConverter_execute_ctrl_push_pos() place on the converter's own input clock, where the output's CONTENT sits.
D pos + 1 - G, relative to the input the call offered, with D the decimation ahead of the terminal stage (dp__RateConverter_pre_decim()) and G the group delay (dp_RateConverter_get_group_delay()). On an unsteered stream this is the converter's own contract: output k of a fresh stream carries the input at k / rate - G, which test_RateConverter_core.c holds output by output. Steered, it moves by what the steering has accumulated, which is the point.
Parameters:
posA place from dp__RateConverter_execute_ctrl_push_pos().decimdp__RateConverter_pre_decim(), read once.gddp_RateConverter_get_group_delay(), read once.
Returns:
The content's input-sample time, relative to the offered input.
The documentation for this class was generated from the following file native/inc/doppler/RateConverter/RateConverter_private.h