mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-20 12:45:40 -05:00
EDACS Analog Call Dotting Sequence Detection;
This commit is contained in:
@@ -927,6 +927,7 @@ void openAudioInDevice (dsd_opts * opts);
|
|||||||
|
|
||||||
int getDibit (dsd_opts * opts, dsd_state * state);
|
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 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 skipDibit (dsd_opts * opts, dsd_state * state, int count);
|
||||||
void saveImbe4400Data (dsd_opts * opts, dsd_state * state, char *imbe_d);
|
void saveImbe4400Data (dsd_opts * opts, dsd_state * state, char *imbe_d);
|
||||||
|
|||||||
@@ -219,8 +219,7 @@ invert_dibit(int dibit)
|
|||||||
return -1;
|
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
|
// determine dibit state
|
||||||
if ((state->synctype == 6) || (state->synctype == 14)|| (state->synctype == 18) || (state->synctype == 37))
|
if ((state->synctype == 6) || (state->synctype == 14)|| (state->synctype == 18) || (state->synctype == 37))
|
||||||
|
|||||||
@@ -228,8 +228,6 @@ void edacs_analog(dsd_opts * opts, dsd_state * state, int afs, unsigned char lcn
|
|||||||
if (opts->floating_point == 1)
|
if (opts->floating_point == 1)
|
||||||
fprintf (stderr, "Analog Floating Point Output Not Supported");
|
fprintf (stderr, "Analog Floating Point Output Not Supported");
|
||||||
|
|
||||||
if (rms > sql) fprintf (stderr, "\n");
|
|
||||||
|
|
||||||
//Update Ncurses Terminal
|
//Update Ncurses Terminal
|
||||||
if (opts->use_ncurses_terminal == 1)
|
if (opts->use_ncurses_terminal == 1)
|
||||||
ncursesPrinter(opts, state);
|
ncursesPrinter(opts, state);
|
||||||
@@ -244,6 +242,26 @@ void edacs_analog(dsd_opts * opts, dsd_state * state, int afs, unsigned char lcn
|
|||||||
sf_write_short(opts->wav_out_f, analog3, 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");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user