diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-03-09 13:23:35 +0100 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-03-09 13:23:35 +0100 |
commit | 9debe084fca8992efdf0f08bfed343de0987629e (patch) | |
tree | 8d7088f44752227eb9148c8f42842fb12a24335d /controller/fw/tools | |
parent | b4d5293d045d68822ad5b2d0a7a5f392c596a0ba (diff) | |
download | master-thesis-9debe084fca8992efdf0f08bfed343de0987629e.tar.gz master-thesis-9debe084fca8992efdf0f08bfed343de0987629e.tar.bz2 master-thesis-9debe084fca8992efdf0f08bfed343de0987629e.zip |
demod wip
Diffstat (limited to 'controller/fw/tools')
-rw-r--r-- | controller/fw/tools/dsss_demod_test.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/controller/fw/tools/dsss_demod_test.c b/controller/fw/tools/dsss_demod_test.c index 4370f80..d76a8bd 100644 --- a/controller/fw/tools/dsss_demod_test.c +++ b/controller/fw/tools/dsss_demod_test.c @@ -12,6 +12,16 @@ #include "dsss_demod.h" +void handle_dsss_received(uint8_t data[TRANSMISSION_SYMBOLS]) { + printf("data sequence received: [ "); + for (size_t i=0; i<TRANSMISSION_SYMBOLS; i++) { + printf("%+3d", ((data[i]&1) ? 1 : -1) * (data[i]>>1)); + if (i+1 < TRANSMISSION_SYMBOLS) + printf(", "); + } + printf(" ]\n"); +} + void print_usage() { fprintf(stderr, "Usage: dsss_demod_test [test_data.bin] [optional recording channel number]\n"); } @@ -87,7 +97,7 @@ int main(int argc, char **argv) { fprintf(stderr, "Starting simulation.\n"); struct dsss_demod_state demod; - memset(&demod, 0, sizeof(demod)); + dsss_demod_init(&demod); for (size_t i=0; i<n_samples; i++) { //fprintf(stderr, "Iteration %zd/%zd\n", i, n_samples); dsss_demod_step(&demod, buf_f[i], i, record_channel); |