aboutsummaryrefslogtreecommitdiffstats
path: root/src/anetz
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-01-06 12:22:51 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2017-02-18 21:00:47 +0100
commitc5cf88ce575b4fb35628e30b3a5f2e246f060c8d (patch)
tree7ec799cd074fa6740a50fa2b4c226570408cd4aa /src/anetz
parent9ff8c3bb25422e100801f90c17b9c21118920cfd (diff)
Prepare for SDR: Add bandwidth and deviation info to sender instance
Diffstat (limited to 'src/anetz')
-rw-r--r--src/anetz/dsp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/anetz/dsp.c b/src/anetz/dsp.c
index 41888cd..e47f7f2 100644
--- a/src/anetz/dsp.c
+++ b/src/anetz/dsp.c
@@ -35,12 +35,10 @@
#define PI 3.1415927
/* signaling */
-/* NOTE: The peak deviation is similar for paging tone and signaling tone,
- * so both tones should be equal after pre-emphasis. This is why the paging
- * tones is so much louder.*/
+#define BANDWIDTH 15000.0 /* maximum bandwidth */
#define TX_PEAK_TONE 8192.0 /* peak amplitude for all tones */
+#warning FIXME: only with emphasis, use seperate option for volume, override by sdr
#define TX_PEAK_PAGE 32766.0 /* peak amplitude paging tone */
-// FIXME: what is the allowed deviation of tone?
#define CHUNK_DURATION 0.010 /* 10 ms */
// FIXME: how long until we detect a tone?
@@ -94,6 +92,10 @@ int dsp_init_sender(anetz_t *anetz, int page_sequence)
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "Init DSP for 'Sender'.\n");
+ /* set deviation and modulation parameters */
+ anetz->sender.bandwidth = BANDWIDTH;
+ anetz->sender.sample_deviation = 11000.0 / (double)TX_PEAK_TONE;
+
anetz->page_sequence = page_sequence;
audio_init_loss(&anetz->sender.loss, LOSS_INTERVAL, anetz->sender.loss_volume, LOSS_TIME);