kopia lustrzana https://github.com/rs1729/RS
lms6X auto-detect: IQ decode reset
rodzic
f735732828
commit
673ce66acd
|
@ -146,6 +146,7 @@ typedef struct {
|
||||||
int typ;
|
int typ;
|
||||||
float frm_rate;
|
float frm_rate;
|
||||||
int auto_detect;
|
int auto_detect;
|
||||||
|
int reset_dsp;
|
||||||
option_t option;
|
option_t option;
|
||||||
RS_t RS;
|
RS_t RS;
|
||||||
VIT_t *vit;
|
VIT_t *vit;
|
||||||
|
@ -840,7 +841,7 @@ static void proc_frame(gpx_t *gpx, int len) {
|
||||||
if (gpx->sf6 < 4) {
|
if (gpx->sf6 < 4) {
|
||||||
frmsync_X(gpx, block_bytes); // pos(frm_syncX[]) < 46: different baud not significant
|
frmsync_X(gpx, block_bytes); // pos(frm_syncX[]) < 46: different baud not significant
|
||||||
if (gpx->sfX == 4) {
|
if (gpx->sfX == 4) {
|
||||||
if (gpx->auto_detect) gpx->typ = 10;
|
if (gpx->auto_detect) { gpx->typ = 10; gpx->reset_dsp = 1; }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -881,7 +882,7 @@ static void proc_frame(gpx_t *gpx, int len) {
|
||||||
for (j = 0; j < 4; j++) gpx->sf6 += (block_bytes[blk_pos+j] == frm_sync6[j]);
|
for (j = 0; j < 4; j++) gpx->sf6 += (block_bytes[blk_pos+j] == frm_sync6[j]);
|
||||||
if (gpx->sf6 == 4) {
|
if (gpx->sf6 == 4) {
|
||||||
gpx->frm_pos = 0;
|
gpx->frm_pos = 0;
|
||||||
if (gpx->auto_detect) gpx->typ = 6;
|
if (gpx->auto_detect) { gpx->typ = 6; gpx->reset_dsp = 1; }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
blk_pos++;
|
blk_pos++;
|
||||||
|
@ -891,7 +892,7 @@ static void proc_frame(gpx_t *gpx, int len) {
|
||||||
// LMS6: frm_rate = 4800.0 * FRAME_LEN/BLOCK_LEN = 4800*300/260 = 5538
|
// LMS6: frm_rate = 4800.0 * FRAME_LEN/BLOCK_LEN = 4800*300/260 = 5538
|
||||||
// LMSX: delta_mp = 4797.8 (longer timesync-frames possible)
|
// LMSX: delta_mp = 4797.8 (longer timesync-frames possible)
|
||||||
if (gpx->frm_rate > 5000.0 || gpx->frm_rate < 4000.0) { // lms6-blocklen = 260/300 sr, sync wird ueberlesen ...
|
if (gpx->frm_rate > 5000.0 || gpx->frm_rate < 4000.0) { // lms6-blocklen = 260/300 sr, sync wird ueberlesen ...
|
||||||
if (gpx->auto_detect) gpx->typ = 6;
|
if (gpx->auto_detect) { gpx->typ = 6; gpx->reset_dsp = 1; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -969,7 +970,7 @@ int main(int argc, char **argv) {
|
||||||
gpx_t _gpx = {0}; gpx_t *gpx = &_gpx;
|
gpx_t _gpx = {0}; gpx_t *gpx = &_gpx;
|
||||||
|
|
||||||
gpx->auto_detect = 1;
|
gpx->auto_detect = 1;
|
||||||
|
gpx->reset_dsp = 0;
|
||||||
|
|
||||||
#ifdef CYGWIN
|
#ifdef CYGWIN
|
||||||
_setmode(fileno(stdin), _O_BINARY); // _setmode(_fileno(stdin), _O_BINARY);
|
_setmode(fileno(stdin), _O_BINARY); // _setmode(_fileno(stdin), _O_BINARY);
|
||||||
|
@ -1016,9 +1017,6 @@ int main(int argc, char **argv) {
|
||||||
else if ( (strcmp(*argv, "-i") == 0) || (strcmp(*argv, "--invert") == 0) ) {
|
else if ( (strcmp(*argv, "-i") == 0) || (strcmp(*argv, "--invert") == 0) ) {
|
||||||
option_inv = 1; // nicht noetig
|
option_inv = 1; // nicht noetig
|
||||||
}
|
}
|
||||||
else if ( (strcmp(*argv, "--dc") == 0) ) {
|
|
||||||
option_dc = 1;
|
|
||||||
}
|
|
||||||
else if ( (strcmp(*argv, "--ch2") == 0) ) { sel_wavch = 1; } // right channel (default: 0=left)
|
else if ( (strcmp(*argv, "--ch2") == 0) ) { sel_wavch = 1; } // right channel (default: 0=left)
|
||||||
else if ( (strcmp(*argv, "--ths") == 0) ) {
|
else if ( (strcmp(*argv, "--ths") == 0) ) {
|
||||||
++argv;
|
++argv;
|
||||||
|
@ -1050,6 +1048,7 @@ int main(int argc, char **argv) {
|
||||||
option_iq = 5;
|
option_iq = 5;
|
||||||
}
|
}
|
||||||
else if (strcmp(*argv, "--lp") == 0) { option_lp = 1; } // IQ lowpass
|
else if (strcmp(*argv, "--lp") == 0) { option_lp = 1; } // IQ lowpass
|
||||||
|
else if (strcmp(*argv, "--dc") == 0) { option_dc = 1; }
|
||||||
else if (strcmp(*argv, "--json") == 0) {
|
else if (strcmp(*argv, "--json") == 0) {
|
||||||
gpx->option.jsn = 1;
|
gpx->option.jsn = 1;
|
||||||
gpx->option.ecc = 1;
|
gpx->option.ecc = 1;
|
||||||
|
@ -1209,12 +1208,18 @@ int main(int argc, char **argv) {
|
||||||
pos = BLOCKSTART;
|
pos = BLOCKSTART;
|
||||||
header_found = 0;
|
header_found = 0;
|
||||||
|
|
||||||
if ( gpx->auto_detect ) {
|
if ( gpx->auto_detect && gpx->reset_dsp ) {
|
||||||
if (gpx->typ == 10) {
|
if (gpx->typ == 10) {
|
||||||
// set lmsX
|
// set lmsX
|
||||||
rawbitblock_len = RAWBITBLOCK_LEN;//_X;
|
rawbitblock_len = RAWBITBLOCK_LEN;//_X;
|
||||||
dsp.br = (float)BAUD_RATEX;
|
dsp.br = (float)BAUD_RATEX;
|
||||||
dsp.sps = (float)dsp.sr/dsp.br;
|
dsp.sps = (float)dsp.sr/dsp.br;
|
||||||
|
|
||||||
|
// reset F1sum, F2sum
|
||||||
|
for (k = 0; k < dsp.N_IQBUF; k++) dsp.rot_iqbuf[k] = 0;
|
||||||
|
dsp.F1sum = 0;
|
||||||
|
dsp.F2sum = 0;
|
||||||
|
|
||||||
bitofs = bitofsX + shift;
|
bitofs = bitofsX + shift;
|
||||||
}
|
}
|
||||||
if (gpx->typ == 6) {
|
if (gpx->typ == 6) {
|
||||||
|
@ -1222,8 +1227,15 @@ int main(int argc, char **argv) {
|
||||||
rawbitblock_len = RAWBITBLOCK_LEN_6;
|
rawbitblock_len = RAWBITBLOCK_LEN_6;
|
||||||
dsp.br = (float)BAUD_RATE6;
|
dsp.br = (float)BAUD_RATE6;
|
||||||
dsp.sps = (float)dsp.sr/dsp.br;
|
dsp.sps = (float)dsp.sr/dsp.br;
|
||||||
|
|
||||||
|
// reset F1sum, F2sum
|
||||||
|
for (k = 0; k < dsp.N_IQBUF; k++) dsp.rot_iqbuf[k] = 0;
|
||||||
|
dsp.F1sum = 0;
|
||||||
|
dsp.F2sum = 0;
|
||||||
|
|
||||||
bitofs = bitofs6 + shift;
|
bitofs = bitofs6 + shift;
|
||||||
}
|
}
|
||||||
|
gpx->reset_dsp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,7 @@ typedef struct {
|
||||||
int typ;
|
int typ;
|
||||||
float frm_rate;
|
float frm_rate;
|
||||||
int auto_detect;
|
int auto_detect;
|
||||||
|
int reset_dsp;
|
||||||
option_t option;
|
option_t option;
|
||||||
RS_t RS;
|
RS_t RS;
|
||||||
VIT_t *vit;
|
VIT_t *vit;
|
||||||
|
@ -844,7 +845,7 @@ static void proc_frame(gpx_t *gpx, int len, dsp_t *dsp) {
|
||||||
if (gpx->sf6 < 4) {
|
if (gpx->sf6 < 4) {
|
||||||
frmsync_X(gpx, block_bytes); // pos(frm_syncX[]) < 46: different baud not significant
|
frmsync_X(gpx, block_bytes); // pos(frm_syncX[]) < 46: different baud not significant
|
||||||
if (gpx->sfX == 4) {
|
if (gpx->sfX == 4) {
|
||||||
if (gpx->auto_detect) gpx->typ = 10;
|
if (gpx->auto_detect) { gpx->typ = 10; gpx->reset_dsp = 1; }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -885,7 +886,7 @@ static void proc_frame(gpx_t *gpx, int len, dsp_t *dsp) {
|
||||||
for (j = 0; j < 4; j++) gpx->sf6 += (block_bytes[blk_pos+j] == frm_sync6[j]);
|
for (j = 0; j < 4; j++) gpx->sf6 += (block_bytes[blk_pos+j] == frm_sync6[j]);
|
||||||
if (gpx->sf6 == 4) {
|
if (gpx->sf6 == 4) {
|
||||||
gpx->frm_pos = 0;
|
gpx->frm_pos = 0;
|
||||||
if (gpx->auto_detect) gpx->typ = 6;
|
if (gpx->auto_detect) { gpx->typ = 6; gpx->reset_dsp = 1; }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
blk_pos++;
|
blk_pos++;
|
||||||
|
@ -895,7 +896,7 @@ static void proc_frame(gpx_t *gpx, int len, dsp_t *dsp) {
|
||||||
// LMS6: frm_rate = 4800.0 * FRAME_LEN/BLOCK_LEN = 4800*300/260 = 5538
|
// LMS6: frm_rate = 4800.0 * FRAME_LEN/BLOCK_LEN = 4800*300/260 = 5538
|
||||||
// LMSX: delta_mp = 4797.8 (longer timesync-frames possible)
|
// LMSX: delta_mp = 4797.8 (longer timesync-frames possible)
|
||||||
if (gpx->frm_rate > 5000.0 || gpx->frm_rate < 4000.0) { // lms6-blocklen = 260/300 sr, sync wird ueberlesen ...
|
if (gpx->frm_rate > 5000.0 || gpx->frm_rate < 4000.0) { // lms6-blocklen = 260/300 sr, sync wird ueberlesen ...
|
||||||
if (gpx->auto_detect) gpx->typ = 6;
|
if (gpx->auto_detect) { gpx->typ = 6; gpx->reset_dsp = 1; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -973,6 +974,7 @@ void *thd_lms6X(void *targs) { // pcm_t *pcm, double xlt_fq
|
||||||
gpx_t _gpx = {0}; gpx_t *gpx = &_gpx;
|
gpx_t _gpx = {0}; gpx_t *gpx = &_gpx;
|
||||||
|
|
||||||
gpx->auto_detect = 1;
|
gpx->auto_detect = 1;
|
||||||
|
gpx->reset_dsp = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#ifdef CYGWIN
|
#ifdef CYGWIN
|
||||||
|
@ -1125,12 +1127,18 @@ void *thd_lms6X(void *targs) { // pcm_t *pcm, double xlt_fq
|
||||||
pos = BLOCKSTART;
|
pos = BLOCKSTART;
|
||||||
header_found = 0;
|
header_found = 0;
|
||||||
|
|
||||||
if ( gpx->auto_detect ) {
|
if ( gpx->auto_detect && gpx->reset_dsp ) {
|
||||||
if (gpx->typ == 10) {
|
if (gpx->typ == 10) {
|
||||||
// set lmsX
|
// set lmsX
|
||||||
rawbitblock_len = RAWBITBLOCK_LEN;//_X;
|
rawbitblock_len = RAWBITBLOCK_LEN;//_X;
|
||||||
dsp.br = (float)BAUD_RATEX;
|
dsp.br = (float)BAUD_RATEX;
|
||||||
dsp.sps = (float)dsp.sr/dsp.br;
|
dsp.sps = (float)dsp.sr/dsp.br;
|
||||||
|
|
||||||
|
// reset F1sum, F2sum
|
||||||
|
for (k = 0; k < dsp.N_IQBUF; k++) dsp.rot_iqbuf[k] = 0;
|
||||||
|
dsp.F1sum = 0;
|
||||||
|
dsp.F2sum = 0;
|
||||||
|
|
||||||
bitofs = bitofsX + shift;
|
bitofs = bitofsX + shift;
|
||||||
}
|
}
|
||||||
if (gpx->typ == 6) {
|
if (gpx->typ == 6) {
|
||||||
|
@ -1138,13 +1146,21 @@ void *thd_lms6X(void *targs) { // pcm_t *pcm, double xlt_fq
|
||||||
rawbitblock_len = RAWBITBLOCK_LEN_6;
|
rawbitblock_len = RAWBITBLOCK_LEN_6;
|
||||||
dsp.br = (float)BAUD_RATE6;
|
dsp.br = (float)BAUD_RATE6;
|
||||||
dsp.sps = (float)dsp.sr/dsp.br;
|
dsp.sps = (float)dsp.sr/dsp.br;
|
||||||
|
|
||||||
|
// reset F1sum, F2sum
|
||||||
|
for (k = 0; k < dsp.N_IQBUF; k++) dsp.rot_iqbuf[k] = 0;
|
||||||
|
dsp.F1sum = 0;
|
||||||
|
dsp.F2sum = 0;
|
||||||
|
|
||||||
bitofs = bitofs6 + shift;
|
bitofs = bitofs6 + shift;
|
||||||
}
|
}
|
||||||
|
gpx->reset_dsp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
free_buffers(&dsp);
|
free_buffers(&dsp);
|
||||||
if (gpx->vit) { free(gpx->vit); gpx->vit = NULL; }
|
if (gpx->vit) { free(gpx->vit); gpx->vit = NULL; }
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue