File correlation_core.h¶
FileList > correlation > correlation_core.h
Go to the source code of this file
Correlation module — public C API.
#include "doppler/clib_common.h"
Public Functions¶
| Type | Name |
|---|---|
| int | dp_correlator_same_code_phase (double a, double b, double code_len) One signal's code phase: 1 when code phases a andb , chips, are within DP_CORRELATOR_SAME_PHASE_CHIPS of each other, circularly over a code ofcode_len chips; else 0. |
Public Functions Documentation¶
function dp_correlator_same_code_phase¶
One signal's code phase: 1 when code phases a andb , chips, are within DP_CORRELATOR_SAME_PHASE_CHIPS of each other, circularly over a code ofcode_len chips; else 0.
The one key the receiver's pick and the pool's duplicate test share, and the one the peak zone is sized from. The receiver's pick drops a peak within it of one already taken or of an excluded phase (rules 1 and 3 of docs/design/async-dsss-receiver.md section 7.2, keyed on code phase alone, never carrier: async-dsss-receiver-measurements.md section 12.14); the pool resets the second of two holders within it of each other; and the zone the receiver asks its search for (dp_correlator_set_peak_zone()) is half of it, so the zone stays inside the key (#3071: a zone as wide as the key masked pairs two lags apart that the key keeps). An example that names which emitter a receiver holds calls this, so it identifies an emitter by exactly the test the pool does. A C caller's example is on DP_CORRELATOR_SAME_PHASE_CHIPS (correlator_core.h).
The distance is |a - b| folded over the code, so phases either side of chip 0 are near: 0.4 and 1022.8 are 0.6 chips apart on a 1023-chip code. The bound is inclusive: phases exactly DP_CORRELATOR_SAME_PHASE_CHIPS apart are one signal. Phases are taken as given, each in [0, code_len); a NaN phase compares as two signals.
Parameters:
aA code phase, chips.bAnother, chips.code_lenThe code's length, chips.
Returns:
1 when a and b are one signal's code phase, else 0.
>>> from doppler.correlation import correlator_same_code_phase
>>> correlator_same_code_phase(100.0, 101.0, 1023.0)
1
>>> correlator_same_code_phase(100.0, 101.5, 1023.0)
0
>>> correlator_same_code_phase(0.4, 1022.8, 1023.0) # across chip 0
1
The documentation for this class was generated from the following file native/inc/doppler/correlation/correlation_core.h