P2 4V/2V Deinterleave Fix; Errs now C0 and C1;

This commit is contained in:
lwvmobile 2022-10-25 19:21:57 -04:00
parent 73f0d5df44
commit b4a0e2e9f3
6 changed files with 67 additions and 36 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.[ao]
*.so*
*.dylib
build

View File

@ -1156,7 +1156,7 @@ main (int argc, char **argv)
break;
case 'T': //repurposed to TDMA/NXDN Per Call
sprintf (wav_file_directory, "./WAV"); // /wav, or ./wav
sprintf (wav_file_directory, "./WAV");
wav_file_directory[1023] = '\0';
if (stat(wav_file_directory, &st) == -1)
{
@ -1165,17 +1165,19 @@ main (int argc, char **argv)
mkdir(wav_file_directory, 0700); //user read write execute, needs execute for some reason or segfault
}
fprintf (stderr,"XDMA and NXDN Per Call Wav File Saving Enabled. (NCurses Terminal Only)\n");
sprintf (opts.wav_out_file, "./WAV/DSD-FME-X1.wav"); // foward slash here, on wav_file_directory?
sprintf (opts.wav_out_file, "./WAV/DSD-FME-X1.wav");
sprintf (opts.wav_out_fileR, "./WAV/DSD-FME-X2.wav");
opts.dmr_stereo_wav = 1;
openWavOutFileL (&opts, &state); //testing for now, will want to move to per call later
openWavOutFileR (&opts, &state); //testing for now, will want to move to per call later
openWavOutFileL (&opts, &state);
openWavOutFileR (&opts, &state);
break;
case 'F':
opts.aggressive_framesync = 0;
fprintf (stderr, "%s", KYEL);
fprintf (stderr,"DMR Stereo Aggressive Resync Disabled!\n");
//fprintf (stderr,"DMR Stereo Aggressive Resync Disabled!\n");
fprintf (stderr, "Relax P25 Phase 2 MAC_SIGNAL CRC Checksum Pass/Fail\n");
fprintf (stderr, "Relax DMR CACH/Burst FEC Pass/Fail\n");
fprintf (stderr, "%s", KNRM);
break;

View File

@ -143,9 +143,9 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a
// 0 +P25p1
// 1 -P25p1
state->errs = mbe_eccImbe7200x4400C0 (imbe_fr);
state->errs2 = state->errs;
//state->errs2 = state->errs;
mbe_demodulateImbe7200x4400Data (imbe_fr);
state->errs2 += mbe_eccImbe7200x4400Data (imbe_fr, imbe_d);
state->errs2 = mbe_eccImbe7200x4400Data (imbe_fr, imbe_d);
@ -170,9 +170,9 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a
{
state->errs = mbe_eccImbe7100x4400C0 (imbe7100_fr);
state->errs2 = state->errs;
//state->errs2 = state->errs;
mbe_demodulateImbe7100x4400Data (imbe7100_fr);
state->errs2 += mbe_eccImbe7100x4400Data (imbe7100_fr, imbe_d);
state->errs2 = mbe_eccImbe7100x4400Data (imbe7100_fr, imbe_d);
mbe_convertImbe7100to7200(imbe_d); //needs extra conversion step apparently
mbe_processImbe4400Dataf (state->audio_out_temp_buf, &state->errs, &state->errs2, state->err_str,
@ -203,10 +203,11 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a
}
else if ((state->synctype == 8) || (state->synctype == 9))
{
state->errs = mbe_eccAmbe3600x2450C0 (ambe_fr);
state->errs2 = state->errs;
//state->errs2 = state->errs;
mbe_demodulateAmbe3600x2450Data (ambe_fr);
state->errs2 += mbe_eccAmbe3600x2450Data (ambe_fr, ambe_d);
state->errs2 = mbe_eccAmbe3600x2450Data (ambe_fr, ambe_d);
if ( (state->nxdn_cipher_type == 0x01 && state->R > 0) ||
(state->M == 1 && state->R > 0) )
@ -248,9 +249,9 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a
{
state->errs = mbe_eccAmbe3600x2450C0 (ambe_fr);
state->errs2 = state->errs;
//state->errs2 = state->errs;
mbe_demodulateAmbe3600x2450Data (ambe_fr);
state->errs2 += mbe_eccAmbe3600x2450Data (ambe_fr, ambe_d);
state->errs2 = mbe_eccAmbe3600x2450Data (ambe_fr, ambe_d);
if ( (state->K > 0 && state->dmr_so & 0x40 && state->payload_keyid == 0 && state->dmr_fid == 0x10) ||
(state->K > 0 && state->M == 1) )
@ -343,9 +344,9 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a
{
state->errsR = mbe_eccAmbe3600x2450C0 (ambe_fr);
state->errs2R = state->errsR;
//state->errs2R = state->errsR;
mbe_demodulateAmbe3600x2450Data (ambe_fr);
state->errs2R += mbe_eccAmbe3600x2450Data (ambe_fr, ambe_d);
state->errs2R = mbe_eccAmbe3600x2450Data (ambe_fr, ambe_d);
if ( (state->K > 0 && state->dmr_soR & 0x40 && state->payload_keyidR == 0 && state->dmr_fidR == 0x10) ||
(state->K > 0 && state->M == 1) )

View File

@ -65,16 +65,39 @@ int i = 0;
char versionstr[25];
unsigned long long int call_matrix[33][6];
/*
___)__|_
.-*' '*-,
/ /| |\ \
; /_| |_\ ;
; |\ /| ;
; | ''--...--'' | ;
\ ''---.....--'' /
''*-.,_______,.-*' BOO!
*/
// char * FM_bannerN[9] = {
// " ESC or Arrow Keys For Menu ",
// " ██████╗ ██████╗██████╗  ███████╗███╗ ███╗███████╗ ",
// " ██╔══██╗██╔════╝██╔══██╗   ██╔════╝████╗ ████║██╔════╝ ",
// " ██║ ██║╚█████╗ ██║ ██║   █████╗ ██╔████╔██║█████╗ ",
// " ██║ ██║ ╚═══██╗██║ ██║   ██╔══╝ ██║╚██╔╝██║██╔══╝ ",
// " ██████╔╝██████╔╝██████╔╝   ██║ ██║ ╚═╝ ██║███████╗ ",
// " ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ",
// " ",
// " "
// };
char * FM_bannerN[9] = {
" ESC or Arrow Keys For Menu ",
" ██████╗ ██████╗██████╗  ███████╗███╗ ███╗███████╗ ",
" ██╔══██╗██╔════╝██╔══██╗   ██╔════╝████╗ ████║██╔════╝ ",
" ██║ ██║╚█████╗ ██║ ██║   █████╗ ██╔████╔██║█████╗ ",
" ██║ ██║ ╚═══██╗██║ ██║   ██╔══╝ ██║╚██╔╝██║██╔══╝ ",
" ██████╔╝██████╔╝██████╔╝   ██║ ██║ ╚═╝ ██║███████╗ ",
" ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ",
" ",
" "
" ESC or Arrow Keys For Menu Happy Halloween! ___)__|_ ",
" ██████╗ ██████╗██████╗  ███████╗███╗ ███╗███████╗ .-*' '*-, ",
" ██╔══██╗██╔════╝██╔══██╗   ██╔════╝████╗ ████║██╔════╝; /_| |_\\ ;",
" ██║ ██║╚█████╗ ██║ ██║   █████╗ ██╔████╔██║█████╗ ; |\\ /| ;",
" ██║ ██║ ╚═══██╗██║ ██║   ██╔══╝ ██║╚██╔╝██║██╔══╝ ; | ''--...--'' | ; ",
" ██████╔╝██████╔╝██████╔╝   ██║ ██║ ╚═╝ ██║███████╗ \\ ''---.....--'' / ",
" ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ''*-.,_______,.-*' ",
" Happy Halloween ",
" "
};
char * SyncTypes[44] = {
@ -152,8 +175,8 @@ char * DMRBusrtTypes[32] = {
"VOICE LDU",
"TDU/TDULC",
"TSBK",
"MAC_SIGNAL",
"MAC_SIGNAL"
"MAC SIGNAL",
"MAC SIGNAL"
};
@ -1910,13 +1933,14 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
}
if (opts->ncurses_compact == 0)
{
attron(COLOR_PAIR(6)); //6
attron(COLOR_PAIR(1)); //6
for (short int i = 0; i < 7; i++)
{
printw("%s \n", FM_bannerN[i]);
}
printw (" https://github.com/lwvmobile/dsd-fme/tree/pulseaudio\n");
printw (" Github Build Version: %s \n", GIT_TAG);
//printw (" Github Build Version: %s \n", GIT_TAG);
printw (" Github Build Version: %s \n", "1313"); //probably better than the first number I thought of
attroff(COLOR_PAIR(6)); //6
// printw ("--Build Info------------------------------------------------------------------\n");
// printw ("| https://github.com/lwvmobile/dsd-fme/tree/pulseaudio\n"); //http link

View File

@ -31,30 +31,30 @@ static const int16_t duid_lookup[256] = {
};
//4V and 2V deinterleave schedule
const int c0[24] = {
const int c0[25] = {
23,5,22,4,21,3,20,2,19,1,18,0,
17,16,15,14,13,12,11,10,9,7,6
17,16,15,14,13,12,11,10,9,8,7,6
};
const int c1[24] = {
const int c1[24] = {
10,9,8,7,6,5,22,4,21,3,20,2,
19,1,18,0,17,16,15,14,13,12,11
};
const int c2[24] = {
const int c2[12] = {
3,2,1,0,10,9,8,7,6,5,4
};
const int c3[24] = {
const int c3[15] = {
13,12,11,10,9,8,7,6,5,4,3,2,1,0
};
const int csubset[72] = {
const int csubset[73] = {
0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,
0,0,1,3,0,0,1,3,0,1,1,3,0,1,1,3,
0,1,1,3,0,1,1,3,0,1,1,3,0,1,2,3,
0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,
0,1,2,3
0,1,2,3,0,1,2,3
};
const int *w;

View File

@ -220,7 +220,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon
year, month, day, hour, min, seconds);
fprintf (stderr, " Local Time Offset: %.01f Hours;", offhour);
//if ist bit is set, then time on system may be considered invalid (i.e., no external time sync)
if (ist == 1)
if (ist % 1)
{
fprintf (stderr, " Invalid System Time ");
}