Rename 'compander' to 'compandor'
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
#define PI M_PI
|
||||
|
||||
/* signalling */
|
||||
#define TX_AUDIO_0dBm0 32767 /* works quite well */
|
||||
#define COMPANDOR_0DB 32767 /* works quite well */
|
||||
#define TX_PEAK_FSK 10000.0 /* peak amplitude of signalling FSK */
|
||||
#define TX_PEAK_SUPER 1000.0 /* peak amplitude of supervisory signal */
|
||||
#define BIT_RATE 1200 /* baud rate */
|
||||
@@ -85,7 +85,7 @@ int dsp_init_sender(nmt_t *nmt)
|
||||
int i;
|
||||
|
||||
/* attack (3ms) and recovery time (13.5ms) according to NMT specs */
|
||||
init_compander(&nmt->cstate, 8000, 3.0, 13.5, TX_AUDIO_0dBm0);
|
||||
init_compandor(&nmt->cstate, 8000, 3.0, 13.5, COMPANDOR_0DB);
|
||||
|
||||
if ((nmt->sender.samplerate % (BIT_RATE * STEPS_PER_BIT))) {
|
||||
PDEBUG(DDSP, DEBUG_ERROR, "Sample rate must be a multiple of %d bits per second.\n", BIT_RATE * STEPS_PER_BIT);
|
||||
@@ -449,7 +449,7 @@ void sender_receive(sender_t *sender, int16_t *samples, int length)
|
||||
int count;
|
||||
|
||||
count = samplerate_downsample(&nmt->sender.srstate, samples, length, down);
|
||||
if (nmt->compander)
|
||||
if (nmt->compandor)
|
||||
expand_audio(&nmt->cstate, down, count);
|
||||
if (nmt->dsp_mode == DSP_MODE_DTMF)
|
||||
dtmf_tone(&nmt->dtmf, down, count);
|
||||
|
@@ -273,13 +273,13 @@ static const char *param_line_signal(uint64_t value, int ndigits, enum nmt_direc
|
||||
desc = "Acknowledge MFT converter in";
|
||||
break;
|
||||
case 5:
|
||||
desc = "Switch compander in";
|
||||
desc = "Switch compandor in";
|
||||
break;
|
||||
case 6:
|
||||
desc = "Address complete";
|
||||
break;
|
||||
case 7:
|
||||
desc = "Switch compander out";
|
||||
desc = "Switch compandor out";
|
||||
break;
|
||||
case 9:
|
||||
desc = "Ringing order";
|
||||
|
@@ -42,7 +42,7 @@ enum nmt_chan_type chan_type[MAX_SENDER] = { CHAN_TYPE_CC_TC };
|
||||
int ms_power = 1; /* 1..3 */
|
||||
char traffic_area[3] = "";
|
||||
char area_no = 0;
|
||||
int compander = 1;
|
||||
int compandor = 1;
|
||||
int supervisory = 0;
|
||||
|
||||
void print_help(const char *arg0)
|
||||
@@ -64,8 +64,8 @@ void print_help(const char *arg0)
|
||||
printf(" Use 'list' to get a list of available short country code names\n");
|
||||
printf(" -a --area-number <area no> | 0\n");
|
||||
printf(" Give area number 1..4 or 0 for no area number. (default = '%d')\n", area_no);
|
||||
printf(" -C --compander 1 | 0\n");
|
||||
printf(" Make use of the compander to reduce noise during call. (default = '%d')\n", compander);
|
||||
printf(" -C --compandor 1 | 0\n");
|
||||
printf(" Make use of the compandor to reduce noise during call. (default = '%d')\n", compandor);
|
||||
printf(" -0 --supervisory 1..4 | 0\n");
|
||||
printf(" Use supervisory signal 1..4 to detect loss of signal from mobile\n");
|
||||
printf(" station, use 0 to disable. (default = '%d')\n", supervisory);
|
||||
@@ -83,7 +83,7 @@ static int handle_options(int argc, char **argv)
|
||||
{"ms-power", 1, 0, 'P'},
|
||||
{"area-number", 1, 0, 'a'},
|
||||
{"traffic-area", 1, 0, 'y'},
|
||||
{"compander", 1, 0, 'C'},
|
||||
{"compandor", 1, 0, 'C'},
|
||||
{"supervisory", 1, 0, '0'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
@@ -165,7 +165,7 @@ error_ta:
|
||||
skip_args += 2;
|
||||
break;
|
||||
case 'C':
|
||||
compander = atoi(optarg);
|
||||
compandor = atoi(optarg);
|
||||
skip_args += 2;
|
||||
break;
|
||||
case '0':
|
||||
@@ -258,7 +258,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* create transceiver instance */
|
||||
for (i = 0; i < num_kanal; i++) {
|
||||
rc = nmt_create(kanal[i], (loopback) ? CHAN_TYPE_TEST : chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, ms_power, nmt_digits2value(traffic_area, 2), area_no, compander, supervisory, loopback);
|
||||
rc = nmt_create(kanal[i], (loopback) ? CHAN_TYPE_TEST : chan_type[i], sounddev[i], samplerate, cross_channels, rx_gain, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, ms_power, nmt_digits2value(traffic_area, 2), area_no, compandor, supervisory, loopback);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "Failed to create transceiver instance. Quitting!\n");
|
||||
goto fail;
|
||||
|
@@ -283,7 +283,7 @@ static void nmt_timeout(struct timer *timer);
|
||||
static void nmt_go_idle(nmt_t *nmt);
|
||||
|
||||
/* Create transceiver instance and link to a list. */
|
||||
int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compander, int supervisory, int loopback)
|
||||
int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, int loopback)
|
||||
{
|
||||
nmt_t *nmt;
|
||||
int rc;
|
||||
@@ -342,7 +342,7 @@ int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev,
|
||||
nmt->sysinfo.ms_power = ms_power;
|
||||
nmt->sysinfo.traffic_area = traffic_area;
|
||||
nmt->sysinfo.area_no = area_no;
|
||||
nmt->compander = compander;
|
||||
nmt->compandor = compandor;
|
||||
nmt->supervisory = supervisory;
|
||||
|
||||
/* go into idle state */
|
||||
@@ -778,10 +778,10 @@ static void tx_mo_complete(nmt_t *nmt, frame_t *frame)
|
||||
if (nmt->tx_frame_count == 1)
|
||||
PDEBUG(DNMT, DEBUG_INFO, "Send 'addess complete'.\n");
|
||||
} else {
|
||||
if (nmt->compander) {
|
||||
if (nmt->compandor) {
|
||||
set_line_signal(nmt, frame, 5);
|
||||
if (nmt->tx_frame_count == 5)
|
||||
PDEBUG(DNMT, DEBUG_INFO, "Send 'compander in'.\n");
|
||||
PDEBUG(DNMT, DEBUG_INFO, "Send 'compandor in'.\n");
|
||||
} else
|
||||
frame->index = NMT_MESSAGE_6;
|
||||
if (nmt->tx_frame_count == 9) {
|
||||
@@ -946,9 +946,9 @@ static void tx_mt_complete(nmt_t *nmt, frame_t *frame)
|
||||
{
|
||||
set_line_signal(nmt, frame, 5);
|
||||
++nmt->tx_frame_count;
|
||||
if (nmt->compander) {
|
||||
if (nmt->compandor) {
|
||||
if (nmt->tx_frame_count == 1)
|
||||
PDEBUG(DNMT, DEBUG_INFO, "Send 'compander in'.\n");
|
||||
PDEBUG(DNMT, DEBUG_INFO, "Send 'compandor in'.\n");
|
||||
} else
|
||||
frame->index = NMT_MESSAGE_6;
|
||||
if (nmt->tx_frame_count == 5) {
|
||||
@@ -1492,7 +1492,7 @@ void call_rx_audio(int callref, int16_t *samples, int count)
|
||||
|
||||
if (nmt->dsp_mode == DSP_MODE_AUDIO || nmt->dsp_mode == DSP_MODE_DTMF) {
|
||||
int16_t up[(int)((double)count * nmt->sender.srstate.factor + 0.5) + 10];
|
||||
if (nmt->compander)
|
||||
if (nmt->compandor)
|
||||
compress_audio(&nmt->cstate, samples, count);
|
||||
count = samplerate_upsample(&nmt->sender.srstate, samples, count, up);
|
||||
jitter_save(&nmt->sender.audio, up, count);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "../common/sender.h"
|
||||
#include "../common/compander.h"
|
||||
#include "../common/compandor.h"
|
||||
#include "../common/dtmf.h"
|
||||
|
||||
enum dsp_mode {
|
||||
@@ -72,7 +72,7 @@ const char *nmt_dir_name(enum nmt_direction dir);
|
||||
typedef struct nmt {
|
||||
sender_t sender;
|
||||
nmt_sysinfo_t sysinfo;
|
||||
compander_t cstate;
|
||||
compandor_t cstate;
|
||||
dtmf_t dtmf;
|
||||
|
||||
/* sender's states */
|
||||
@@ -90,7 +90,7 @@ typedef struct nmt {
|
||||
int mt_channel; /* channel to use */
|
||||
|
||||
/* features */
|
||||
int compander; /* if compander shall be used */
|
||||
int compandor; /* if compandor shall be used */
|
||||
int supervisory; /* if set, use supervisory signal 1..4 */
|
||||
|
||||
/* dsp states */
|
||||
@@ -138,7 +138,7 @@ const char *chan_type_long_name(enum nmt_chan_type chan_type);
|
||||
double nmt_channel2freq(int channel, int uplink);
|
||||
void nmt_country_list(void);
|
||||
uint8_t nmt_country_by_short_name(const char *short_name);
|
||||
int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compander, int supervisory, int loopback);
|
||||
int nmt_create(int channel, enum nmt_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, int loopback);
|
||||
void nmt_destroy(sender_t *sender);
|
||||
void nmt_receive_frame(nmt_t *nmt, const char *bits, double quality, double level, double frames_elapsed);
|
||||
const char *nmt_get_frame(nmt_t *nmt);
|
||||
|
Reference in New Issue
Block a user