B-Netz: Fixup of metering pulse

This commit is contained in:
Andreas Eversberg 2017-10-16 13:48:39 -04:00
parent 2c4d0ee687
commit 5e14471eb6
3 changed files with 9 additions and 6 deletions

View File

@ -55,7 +55,7 @@ static int new_callref = 0x40000000;
#define TRENN_COUNT 4 /* min. 350 ms disconnect "Trennsignal" */
#define TRENN_COUNT_NA 96 /* 12 s disconnect "Trennsignal" if no answer */
#define METERING_DURATION 0.2 /* duration of metering pulse */
#define METERING_DURATION 0.140 /* duration of metering pulse (according to FTZ 1727 Pfl 32 Clause 3.2.6.6.1) */
#define METERING_START 1.0 /* start metering 1 second after call start */
const char *bnetz_state_name(enum bnetz_state state)

View File

@ -47,7 +47,8 @@
#define MAX_MODULATION 3000.0
#define DBM0_DEVIATION 2800.0 /* deviation of dBm0 at 1 kHz */
#define TX_PEAK_FSK (4000.0 / 2000.0 * 1000.0 / DBM0_DEVIATION)
#define TX_PEAK_METER (3000.0 / 2900.0 * 1000.0 / DBM0_DEVIATION) /* FIXME: really 3KHz deviation??? */
#define TX_PEAK_METER (2000.0 / 2900.0 * 1000.0 / DBM0_DEVIATION) /* FIXME: what is the metering pulse deviation??? we use half of the 4kHz deviation, so we can still use -6dB of the speech level */
#define DAMPEN_METER 0.5 /* use -6dB to dampen speech while sending metering pulse (according to FTZ 1727 Pfl 32 Clause 3.2.6.6.5) */
#define MAX_DISPLAY 1.4 /* something above dBm0 */
#define BIT_RATE 100.0
#define BIT_ADJUST 0.5 /* full adjustment on bit change */
@ -284,7 +285,9 @@ static void metering_tone(bnetz_t *bnetz, sample_t *samples, int length)
phase = bnetz->meter_phase65536;
for (i = 0; i < length; i++) {
*samples++ += dsp_metering[(uint16_t)phase];
/* Add metering pulse, also dampen audio level by 6 dB */
*samples = (*samples) * DAMPEN_METER + dsp_metering[(uint16_t)phase];
samples++;
phase += phaseshift;
if (phase >= 65536)
phase -= 65536;

View File

@ -57,9 +57,9 @@ void print_help(const char *arg0)
printf(" (Kanal kleiner Leistung).\n");
printf(" -M --gebuehrenimpuls <secods> | -<seconds> | 0\n");
printf(" Send metering pulses every given number of seconds or 0 to turn off.\n");
printf(" Pulses will only be sent on outgoing calls and only if mobile station\n");
printf(" supports it and only for outgoing calls. Use negative value to force\n");
printf(" metering pulses for all phones and all calls. (default = %d)\n", metering);
printf(" Pulses will be sent on outgoing calls only and only if mobile station\n");
printf(" requests it. Use negative value to force metering pulses for all calls.\n");
printf(" (default = %d)\n", metering);
printf(" -P --paging tone | notone | positive | negative | <file>=<on>:<off>\n");
printf(" Send a tone, give a signal or write to a file when switching to\n");
printf(" channel 19. (paging the phone).\n");