summaryrefslogtreecommitdiff
path: root/controller/fw
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-09 13:53:56 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-09 13:53:56 +0100
commit5997a24fcb28b07936f03a1f7c792c31b86451cc (patch)
treec0f7a39b11b993fd2fdfe29899174035c80afc24 /controller/fw
parent000ced2b546e73c8b1e8a2b870173f5c2a5b5ca0 (diff)
downloadmaster-thesis-5997a24fcb28b07936f03a1f7c792c31b86451cc.tar.gz
master-thesis-5997a24fcb28b07936f03a1f7c792c31b86451cc.tar.bz2
master-thesis-5997a24fcb28b07936f03a1f7c792c31b86451cc.zip
DSSS sequence matcher works
Diffstat (limited to 'controller/fw')
-rw-r--r--controller/fw/src/dsss_demod.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/controller/fw/src/dsss_demod.c b/controller/fw/src/dsss_demod.c
index 2f6af44..a561436 100644
--- a/controller/fw/src/dsss_demod.c
+++ b/controller/fw/src/dsss_demod.c
@@ -58,12 +58,6 @@ void dsss_demod_init(struct dsss_demod_state *st) {
#ifdef SIMULATION
void dsss_demod_step(struct dsss_demod_state *st, float new_value, uint64_t ts, int record_channel) {
- //bool debug = false;
- bool debug = (record_channel == -1)
- && (ts > 1000)
- && (ts % DSSS_CORRELATION_LENGTH == DSSS_CORRELATION_LENGTH-1);
-
- if (debug) DEBUG_PRINT("Iteration %zd: signal=%f", ts, new_value);
#else
void dsss_demod_step(struct dsss_demod_state *st, float new_value) {
#endif
@@ -77,9 +71,6 @@ void dsss_demod_step(struct dsss_demod_state *st, float new_value) {
for (size_t i=0; i<DSSS_GOLD_CODE_COUNT; i++)
st->correlation[i][st->correlation_wpos] = gold_correlate_step(i, st->signal, st->signal_wpos, false);
- debug_print_vector("correlation",
- DSSS_GOLD_CODE_COUNT, &st->correlation[0][st->correlation_wpos], DSSS_WAVELET_LUT_SIZE, true, debug);
-
st->correlation_wpos = (st->correlation_wpos + 1) % ARRAY_LENGTH(st->correlation[0]);
float cwt[DSSS_GOLD_CODE_COUNT];
@@ -127,9 +118,6 @@ void dsss_demod_step(struct dsss_demod_state *st, float new_value) {
return;
/* A group ended. Process result. */
- if (record_channel == -1)
- DEBUG_PRINT("GROUP FOUND: %8d len=%3d max=%f ch=%d offx=%d",
- ts, st->group.len, st->group.max, st->group.max_ch, st->group.max_ts);
group_received(st, ts);
/* reset grouping state */
@@ -195,17 +183,12 @@ void matcher_tick(struct matcher_state states[static DSSS_MATCHER_CACHE_SIZE], u
(1.0f - score_depreciation) * states[i].candidate_score;
states[i].candidate_score = 0.0f;
states[i].last_skips += states[i].candidate_skips;
- DEBUG_PRINT("skips %d", states[i].last_skips);
- /*
if (states[i].last_skips > max_skips) {
- states[i].last_phase = -1; / invalidate entry /
+ states[i].last_phase = -1; /* invalidate entry */
- } else
- */
- if (states[i].data_pos == TRANSMISSION_SYMBOLS) {
+ } else if (states[i].data_pos == TRANSMISSION_SYMBOLS) {
/* Frame received completely */
- DEBUG_PRINT("match on index %d phase %d score %.5f", i, states[i].last_phase, states[i].last_score);
handle_dsss_received(states[i].data);
states[i].last_phase = -1; /* invalidate entry */
}