EDACS Analog Call Dotting Sequence Detection;

This commit is contained in:
lwvmobile
2023-09-04 17:20:42 -04:00
parent 14a87465ce
commit c7537cca96
3 changed files with 22 additions and 4 deletions

View File

@@ -927,6 +927,7 @@ void openAudioInDevice (dsd_opts * opts);
int getDibit (dsd_opts * opts, dsd_state * state);
int get_dibit_and_analog_signal (dsd_opts * opts, dsd_state * state, int * out_analog_signal);
int digitize (dsd_opts* opts, dsd_state* state, int symbol);
void skipDibit (dsd_opts * opts, dsd_state * state, int count);
void saveImbe4400Data (dsd_opts * opts, dsd_state * state, char *imbe_d);

View File

@@ -219,8 +219,7 @@ invert_dibit(int dibit)
return -1;
}
static int digitize (dsd_opts* opts, dsd_state* state, int symbol)
//int digitize (dsd_opts* opts, dsd_state* state, int symbol)
int digitize (dsd_opts* opts, dsd_state* state, int symbol)
{
// determine dibit state
if ((state->synctype == 6) || (state->synctype == 14)|| (state->synctype == 18) || (state->synctype == 37))

View File

@@ -228,8 +228,6 @@ void edacs_analog(dsd_opts * opts, dsd_state * state, int afs, unsigned char lcn
if (opts->floating_point == 1)
fprintf (stderr, "Analog Floating Point Output Not Supported");
if (rms > sql) fprintf (stderr, "\n");
//Update Ncurses Terminal
if (opts->use_ncurses_terminal == 1)
ncursesPrinter(opts, state);
@@ -243,6 +241,26 @@ void edacs_analog(dsd_opts * opts, dsd_state * state, int afs, unsigned char lcn
sf_write_short(opts->wav_out_f, analog2, 960);
sf_write_short(opts->wav_out_f, analog3, 960);
}
//digitize analog samples for a dotting sequence check
unsigned long long int sr = 0;
for (i = 0; i < 960; i+=5) //Samples Per Symbol is 5, so incrememnt every 5
{
sr = sr << 1;
sr += digitize (opts, state, (int)analog1[i]);
}
//debug
// fprintf (stderr, " SR: %016llX", sr);
if (sr == 0xAAAAAAAAAAAAAAAA || sr == 0x5555555555555555)
{
fprintf (stderr, " EDACS DOTTING SEQUENCE: ");
rms = 0; //break while loop by dropping rms value
fprintf (stderr, "\n");
}
if (rms > sql) fprintf (stderr, "\n");
}
}