aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmobile
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2019-12-05 08:33:08 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2019-12-08 17:24:36 +0100
commitc2f14834e5ae683cc944c6c0b398d83caed656a9 (patch)
tree7c863073fd3496df828f5719d942e63b7f464463 /src/libmobile
parentc3da4a77d448b3fe7a12379596607942dcd9b4ec (diff)
Rename dbm0 (level) to speech (level)
In mobile communications we use speech level instead of milliwatts. The deviation (FM) is always based on speech level, not on 1 milliwatt.
Diffstat (limited to 'src/libmobile')
-rw-r--r--src/libmobile/sender.c15
-rw-r--r--src/libmobile/sender.h4
2 files changed, 10 insertions, 9 deletions
diff --git a/src/libmobile/sender.c b/src/libmobile/sender.c
index fe2951f..31d1dd0 100644
--- a/src/libmobile/sender.c
+++ b/src/libmobile/sender.c
@@ -281,15 +281,16 @@ void sender_destroy(sender_t *sender)
jitter_destroy(&sender->dejitter);
}
-void sender_set_fm(sender_t *sender, double max_deviation, double max_modulation, double dBm0_deviation, double max_display)
+/* set frequency modulation and parameters */
+void sender_set_fm(sender_t *sender, double max_deviation, double max_modulation, double speech_deviation, double max_display)
{
sender->max_deviation = max_deviation;
sender->max_modulation = max_modulation;
- sender->dBm0_deviation = dBm0_deviation;
+ sender->speech_deviation = speech_deviation;
sender->max_display = max_display;
PDEBUG_CHAN(DSENDER, DEBUG_DEBUG, "Maxium deviation: %.1f kHz, Maximum modulation: %.1f kHz\n", max_deviation / 1000.0, max_modulation / 1000.0);
- PDEBUG_CHAN(DSENDER, DEBUG_DEBUG, "Deviation at dBm0 (audio level): %.1f kHz\n", dBm0_deviation / 1000.0);
+ PDEBUG_CHAN(DSENDER, DEBUG_DEBUG, "Deviation at speech level: %.1f kHz\n", speech_deviation / 1000.0);
}
static void gain_samples(sample_t *samples, int length, double gain)
@@ -361,8 +362,8 @@ cant_recover:
/* do pre emphasis towards radio */
if (inst->pre_emphasis)
pre_emphasis(&inst->estate, samples[i], count);
- /* normal level to frequency deviation of dBm0 */
- gain_samples(samples[i], count, inst->dBm0_deviation);
+ /* normal level to frequency deviation of speech level */
+ gain_samples(samples[i], count, inst->speech_deviation);
/* set paging signal */
paging_signal[i] = inst->paging_signal;
on[i] = inst->paging_on;
@@ -417,8 +418,8 @@ cant_recover:
/* loop through all channels */
for (i = 0, inst = sender; inst; i++, inst = inst->slave) {
- /* frequency deviation of dBm0 to normal level */
- gain_samples(samples[i], count, 1.0 / inst->dBm0_deviation);
+ /* frequency deviation of speech level to normal level */
+ gain_samples(samples[i], count, 1.0 / inst->speech_deviation);
/* rx gain */
if (inst->rx_gain != 1.0)
gain_samples(samples[i], count, inst->rx_gain);
diff --git a/src/libmobile/sender.h b/src/libmobile/sender.h
index 746a1d0..a2721f1 100644
--- a/src/libmobile/sender.h
+++ b/src/libmobile/sender.h
@@ -36,7 +36,7 @@ typedef struct sender {
/* fm levels */
double max_deviation; /* max frequency deviation */
double max_modulation; /* max frequency modulated */
- double dBm0_deviation; /* deviation of 1000 Hz reference tone at dBm0 */
+ double speech_deviation; /* deviation of 1000 Hz reference tone at speech level */
double max_display; /* level of displaying wave form */
/* audio */
@@ -92,7 +92,7 @@ extern int cant_recover;
int sender_create(sender_t *sender, const char *kanal, double sendefrequenz, double empfangsfrequenz, const char *audiodev, int use_sdr, int samplerate, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, const char *read_tx_wave, int loopback, enum paging_signal paging_signal);
void sender_destroy(sender_t *sender);
-void sender_set_fm(sender_t *sender, double max_deviation, double max_modulation, double dBm0_deviation, double max_display);
+void sender_set_fm(sender_t *sender, double max_deviation, double max_modulation, double speech_deviation, double max_display);
int sender_open_audio(int latspl);
int sender_start_audio(void);
void process_sender_audio(sender_t *sender, int *quit, int latspl);