mirror of https://github.com/lwvmobile/dsd-fme.git
Initialize RRC Input Filter Memory; Misc Work; Change input/output CLI for M17 UDP IP Frames to prevent accidental triggers on input files that are named with m17;
This commit is contained in:
parent
6facababd7
commit
3fbff95b2b
|
|
@ -1360,6 +1360,9 @@ void eot_cc(dsd_opts * opts, dsd_state * state); //end of TX return to CC
|
|||
//Generic Tuning Functions
|
||||
void return_to_cc (dsd_opts * opts, dsd_state * state);
|
||||
|
||||
//initialize static float filter memory
|
||||
void init_rrc_filter_memory();
|
||||
|
||||
//misc audio filtering for analog
|
||||
long int raw_rms(short *samples, int len, int step);
|
||||
void init_audio_filters(dsd_state * state);
|
||||
|
|
|
|||
|
|
@ -712,7 +712,7 @@ openAudioInDevice (dsd_opts * opts)
|
|||
}
|
||||
}
|
||||
|
||||
else if (strncmp(opts->audio_in_dev, "m17", 3) == 0)
|
||||
else if (strncmp(opts->audio_in_dev, "m17udp", 6) == 0)
|
||||
{
|
||||
opts->audio_in_type = 9; //NULL audio device
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#include "dsd.h"
|
||||
|
||||
//M17 Filter -- RRC Alpha = 0.5 S/s 48000 with 81 taps
|
||||
#define M17ZEROS 80
|
||||
float m17gain = 3.16227766f; //sqrt of 10.0f
|
||||
|
|
@ -254,4 +256,13 @@ dsd_input_filter(short sample, int mode)
|
|||
sum += (coeffs[i] * v[i]);
|
||||
|
||||
return (short)(sum / gain); // filtered sample out
|
||||
}
|
||||
|
||||
void init_rrc_filter_memory()
|
||||
{
|
||||
memset (m17xv, 0, 81*sizeof(float));
|
||||
memset (xv, 0, 61*sizeof(float));
|
||||
memset (dxv, 0, 61*sizeof(float));
|
||||
memset (nxv, 0, 135*sizeof(float));
|
||||
memset (dpmrxv, 0, 135*sizeof(float));
|
||||
}
|
||||
|
|
@ -1264,8 +1264,8 @@ usage ()
|
|||
printf (" rtl:dev:freq:gain:ppm:bw:sq:vol for rtl dongle (see below)\n");
|
||||
printf (" tcp for tcp client SDR++/GNURadio Companion/Other (Port 7355)\n");
|
||||
printf (" tcp:192.168.7.5:7355 for custom address and port \n");
|
||||
printf (" m17 for M17 UDP/IP socket bind input (default host 127.0.0.1; default port 17000)\n");
|
||||
printf (" m17:192.168.7.8:17001 for M17 UDP/IP bind input (Binding Address and Port\n");
|
||||
printf (" m17udp for M17 UDP/IP socket bind input (default host 127.0.0.1; default port 17000)\n");
|
||||
printf (" m17udp:192.168.7.8:17001 for M17 UDP/IP bind input (Binding Address and Port\n");
|
||||
printf (" filename.bin for OP25/FME capture bin files\n");
|
||||
printf (" filename.wav for 48K/1 wav files (SDR++, GQRX)\n");
|
||||
printf (" filename.wav -s 96000 for 96K/1 wav files (DSDPlus)\n");
|
||||
|
|
@ -1286,8 +1286,8 @@ usage ()
|
|||
printf (" null for no audio output\n");
|
||||
printf (" udp for UDP socket blaster output (default host 127.0.0.1; default port 23456)\n");
|
||||
printf (" udp:192.168.7.8:23470 for UDP socket blaster output (Target Address and Port\n");
|
||||
printf (" m17 for M17 UDP/IP socket blaster output (default host 127.0.0.1; default port 17000)\n");
|
||||
printf (" m17:192.168.7.8:17001 for M17 UDP/IP blaster output (Target Address and Port\n");
|
||||
printf (" m17udp for M17 UDP/IP socket blaster output (default host 127.0.0.1; default port 17000)\n");
|
||||
printf (" m17udp:192.168.7.8:17001 for M17 UDP/IP blaster output (Target Address and Port\n");
|
||||
printf (" -d <dir> Create mbe data files, use this directory (TDMA version is experimental)\n");
|
||||
printf (" -r <files> Read/Play saved mbe data from file(s)\n");
|
||||
printf (" -g <float> Audio Digital Output Gain (Default: 0 = Auto; )\n");
|
||||
|
|
@ -1683,6 +1683,7 @@ main (int argc, char **argv)
|
|||
initOpts (&opts);
|
||||
initState (&state);
|
||||
init_audio_filters(&state); //audio filters
|
||||
init_rrc_filter_memory(); //initialize input filtering
|
||||
InitAllFecFunction();
|
||||
CNXDNConvolution_init();
|
||||
|
||||
|
|
@ -2904,7 +2905,7 @@ main (int argc, char **argv)
|
|||
openSerial (&opts, &state);
|
||||
}
|
||||
|
||||
if((strncmp(opts.audio_in_dev, "m17", 3) == 0)) //M17 UDP Socket Input
|
||||
if((strncmp(opts.audio_in_dev, "m17udp", 6) == 0)) //M17 UDP Socket Input
|
||||
{
|
||||
fprintf (stderr, "M17 UDP IP Frame Input: ");
|
||||
char * curr;
|
||||
|
|
@ -2924,7 +2925,7 @@ main (int argc, char **argv)
|
|||
fprintf (stderr, "%d \n", opts.m17_portno);
|
||||
}
|
||||
|
||||
if((strncmp(opts.audio_out_dev, "m17", 3) == 0)) //M17 UDP Socket Output
|
||||
if((strncmp(opts.audio_out_dev, "m17udp", 6) == 0)) //M17 UDP Socket Output
|
||||
{
|
||||
fprintf (stderr, "M17 UDP IP Frame Output: ");
|
||||
char * curr;
|
||||
|
|
|
|||
|
|
@ -377,7 +377,8 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
|
|||
sample = dmr_filter(sample);
|
||||
}
|
||||
|
||||
else if (state->lastsynctype == 8 || state->lastsynctype == 9 ||state->lastsynctype == 16 || state->lastsynctype == 17)
|
||||
else if (state->lastsynctype == 8 || state->lastsynctype == 9 || state->lastsynctype == 16 || state->lastsynctype == 17 ||
|
||||
state->lastsynctype == 86 || state->lastsynctype == 87 || state->lastsynctype == 98 || state->lastsynctype == 99)
|
||||
{
|
||||
sample = m17_filter(sample);
|
||||
}
|
||||
|
|
|
|||
13
src/m17.c
13
src/m17.c
|
|
@ -1229,6 +1229,8 @@ float m17_rrc[81] =
|
|||
-0.001940667871554463f, -0.002930279157647190f, -0.003195702904062073f
|
||||
};
|
||||
|
||||
static float mem[81];
|
||||
|
||||
//convert bit array into symbols and RF/Audio
|
||||
void encodeM17RF (dsd_opts * opts, dsd_state * state, uint8_t * input, int type)
|
||||
{
|
||||
|
|
@ -1344,7 +1346,7 @@ void encodeM17RF (dsd_opts * opts, dsd_state * state, uint8_t * input, int type)
|
|||
//version w/ filtering lifted from M17_Implementations / libM17
|
||||
else if (opts->use_cosine_filter == 1)
|
||||
{
|
||||
float mem[81]; memset (mem, 0.0f, 81*sizeof(float));
|
||||
|
||||
float mac = 0.0f;
|
||||
x = 0;
|
||||
for (i = 0; i < 192; i++)
|
||||
|
|
@ -1435,6 +1437,9 @@ void encodeM17RF (dsd_opts * opts, dsd_state * state, uint8_t * input, int type)
|
|||
void encodeM17STR(dsd_opts * opts, dsd_state * state)
|
||||
{
|
||||
|
||||
//initialize RRC memory buffer
|
||||
memset (mem, 0, 81*sizeof(float));
|
||||
|
||||
//set stream type value here so we can change 3200 or 1600 accordingly
|
||||
uint8_t st = 2; //stream type: 0 = res; 1 = data; 2 = voice(3200); 3 = voice(1600) + data;
|
||||
if (state->m17_str_dt == 3) st = 3; //this is set to 3 IF -S user text string is called at CLI
|
||||
|
|
@ -2454,6 +2459,9 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state)
|
|||
void encodeM17BRT(dsd_opts * opts, dsd_state * state)
|
||||
{
|
||||
|
||||
//initialize RRC memory buffer
|
||||
memset (mem, 0, 81*sizeof(float));
|
||||
|
||||
//NOTE: BERT will not use the nucrses terminal,
|
||||
//just strictly for making a BERT test signal
|
||||
|
||||
|
|
@ -2582,6 +2590,9 @@ void encodeM17BRT(dsd_opts * opts, dsd_state * state)
|
|||
void encodeM17PKT(dsd_opts * opts, dsd_state * state)
|
||||
{
|
||||
|
||||
//initialize RRC memory buffer
|
||||
memset (mem, 0, 81*sizeof(float));
|
||||
|
||||
uint8_t nil[368]; //empty array
|
||||
memset (nil, 0, sizeof(nil));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue