aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-01-07 06:13:31 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2017-01-07 06:28:20 +0100
commitd447be5e265e9afe5b5a67f924b16f71f4faeea5 (patch)
tree0933a70976aaf99dbd751a939d6cc24687402515 /src/test
parent2d0bc92cdef930876d68c46448d84d3c4165129c (diff)
NMT: Rework on FSK process, no more requirement for special sample rates
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_dms.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/test_dms.c b/src/test/test_dms.c
index 677b78e..c047e5a 100644
--- a/src/test/test_dms.c
+++ b/src/test/test_dms.c
@@ -55,12 +55,14 @@ void dms_all_sent(nmt_t *nmt)
}
/* receive bits from DMS */
-void fsk_render_frame(nmt_t *nmt, const char *frame, int length, int16_t *sample)
+int fsk_render_frame(nmt_t *nmt, const char *frame, int length, int16_t *sample)
{
printf("(getting %d bits from DMS layer)\n", length);
memcpy(current_bits, frame, length);
current_bit_count = length;
+
+ return nmt->fsk_samples_per_bit * length;
}
nmt_t *alloc_nmt(void)
@@ -69,8 +71,9 @@ nmt_t *alloc_nmt(void)
nmt = calloc(sizeof(*nmt), 1);
dms_init_sender(nmt);
- nmt->dms.frame_spl = calloc(1000000, 1);
- nmt->samples_per_bit = 40;
+ nmt->fsk_samples_per_bit = 40;
+ nmt->dms.frame_size = nmt->fsk_samples_per_bit * 127 + 10;
+ nmt->dms.frame_spl = calloc(nmt->dms.frame_size, sizeof(nmt->dms.frame_spl[0]));
dms_reset(nmt);