kopia lustrzana https://github.com/rs1729/RS
baseband IQ: --min speed-up by reducing IF bandwidth
rodzic
5baaeb5622
commit
3e42ea98c5
|
@ -841,6 +841,9 @@ int read_slbit(dsp_t *dsp, int *bit, int inv, int ofs, int pos, float l, int spi
|
|||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
#define IF_SAMPLE_RATE 48000
|
||||
#define IF_SAMPLE_RATE_MIN 32000
|
||||
|
||||
#define IF_TRANSITION_BW (4e3) // 4kHz transition width
|
||||
#define FM_TRANSITION_BW (2e3) // 2kHz transition width
|
||||
|
||||
|
@ -882,13 +885,14 @@ int init_buffers(dsp_t *dsp) {
|
|||
|
||||
if (dsp->opt_iq == 5)
|
||||
{
|
||||
int IF_sr = 48000; // designated IF sample rate
|
||||
int IF_sr = IF_SAMPLE_RATE; // designated IF sample rate
|
||||
int decM = 1; // decimate M:1
|
||||
int sr_base = dsp->sr;
|
||||
float f_lp; // dec_lowpass: lowpass_bandwidth/2
|
||||
float t_bw; // dec_lowpass: transition_bandwidth
|
||||
int taps; // dec_lowpass: taps
|
||||
|
||||
if (dsp->opt_IFmin) IF_sr = IF_SAMPLE_RATE_MIN;
|
||||
if (IF_sr > sr_base) IF_sr = sr_base;
|
||||
if (IF_sr < sr_base) {
|
||||
while (sr_base % IF_sr) IF_sr += 1;
|
||||
|
@ -896,7 +900,11 @@ int init_buffers(dsp_t *dsp) {
|
|||
}
|
||||
|
||||
f_lp = (IF_sr+20e3)/(4.0*sr_base);
|
||||
t_bw = (IF_sr-20e3)/*/2.0*/; if (t_bw < 0) t_bw = 8e3;
|
||||
t_bw = (IF_sr-20e3)/*/2.0*/;
|
||||
if (dsp->opt_IFmin) {
|
||||
t_bw = (IF_sr-12e3);
|
||||
}
|
||||
if (t_bw < 0) t_bw = 10e3;
|
||||
t_bw /= sr_base;
|
||||
taps = 4.0/t_bw; if (taps%2==0) taps++;
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@ typedef struct {
|
|||
double SNRdB;
|
||||
|
||||
// decimate
|
||||
int opt_IFmin;
|
||||
int decM;
|
||||
ui32_t sr_base;
|
||||
ui32_t dectaps;
|
||||
|
|
|
@ -850,6 +850,7 @@ int main(int argc, char **argv) {
|
|||
int option_ptu = 0;
|
||||
int option_dist = 0; // continuous pcks 0..8
|
||||
int option_auto = 0;
|
||||
int option_min = 0;
|
||||
int option_iq = 0;
|
||||
int option_lp = 0;
|
||||
int option_dc = 0;
|
||||
|
@ -969,6 +970,9 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
else if (strcmp(*argv, "--lp") == 0) { option_lp = 1; } // IQ lowpass
|
||||
else if (strcmp(*argv, "--dc") == 0) { option_dc = 1; }
|
||||
else if (strcmp(*argv, "--min") == 0) {
|
||||
option_min = 1;
|
||||
}
|
||||
else if (strcmp(*argv, "--dbg") == 0) { gpx.option.dbg = 1; }
|
||||
else {
|
||||
fp = fopen(*argv, "rb");
|
||||
|
@ -1034,6 +1038,7 @@ int main(int argc, char **argv) {
|
|||
dsp.lpIQ_bw = 12e3; // IF lowpass bandwidth
|
||||
dsp.lpFM_bw = 4e3; // FM audio lowpass
|
||||
dsp.opt_dc = option_dc;
|
||||
dsp.opt_IFmin = option_min;
|
||||
|
||||
if ( dsp.sps < 8 ) {
|
||||
fprintf(stderr, "note: sample rate low\n");
|
||||
|
|
|
@ -923,6 +923,7 @@ static void proc_frame(gpx_t *gpx, int len) {
|
|||
int main(int argc, char **argv) {
|
||||
|
||||
int option_inv = 0; // invertiert Signal
|
||||
int option_min = 0;
|
||||
int option_iq = 0;
|
||||
int option_lp = 0;
|
||||
int option_dc = 0;
|
||||
|
@ -1049,6 +1050,9 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
else if (strcmp(*argv, "--lp") == 0) { option_lp = 1; } // IQ lowpass
|
||||
else if (strcmp(*argv, "--dc") == 0) { option_dc = 1; }
|
||||
else if (strcmp(*argv, "--min") == 0) {
|
||||
option_min = 1;
|
||||
}
|
||||
else if (strcmp(*argv, "--json") == 0) {
|
||||
gpx->option.jsn = 1;
|
||||
gpx->option.ecc = 1;
|
||||
|
@ -1114,6 +1118,7 @@ int main(int argc, char **argv) {
|
|||
dsp.lpIQ_bw = 8e3; // IF lowpass bandwidth
|
||||
dsp.lpFM_bw = 6e3; // FM audio lowpass
|
||||
dsp.opt_dc = option_dc;
|
||||
dsp.opt_IFmin = option_min;
|
||||
|
||||
if ( dsp.sps < 8 ) {
|
||||
fprintf(stderr, "note: sample rate low (%.1f sps)\n", dsp.sps);
|
||||
|
|
|
@ -892,6 +892,7 @@ int main(int argc, char **argv) {
|
|||
//int option_res = 0; // genauere Bitmessung
|
||||
int option_color = 0;
|
||||
int option_ptu = 0;
|
||||
int option_min = 0;
|
||||
int option_iq = 0;
|
||||
int option_lp = 0;
|
||||
int option_dc = 0;
|
||||
|
@ -996,6 +997,9 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
else if (strcmp(*argv, "--lp") == 0) { option_lp = 1; } // IQ lowpass
|
||||
else if (strcmp(*argv, "--dc") == 0) { option_dc = 1; }
|
||||
else if (strcmp(*argv, "--min") == 0) {
|
||||
option_min = 1;
|
||||
}
|
||||
else if (strcmp(*argv, "--json") == 0) { gpx.option.jsn = 1; }
|
||||
else {
|
||||
fp = fopen(*argv, "rb");
|
||||
|
@ -1051,6 +1055,7 @@ int main(int argc, char **argv) {
|
|||
dsp.lpIQ_bw = 24e3; // IF lowpass bandwidth
|
||||
dsp.lpFM_bw = 10e3; // FM audio lowpass
|
||||
dsp.opt_dc = option_dc;
|
||||
dsp.opt_IFmin = option_min;
|
||||
|
||||
if ( dsp.sps < 8 ) {
|
||||
fprintf(stderr, "note: sample rate low (%.1f sps)\n", dsp.sps);
|
||||
|
|
|
@ -208,11 +208,12 @@ int main(int argc, char **argv) {
|
|||
option_inv = 0,
|
||||
option_ecc = 0, // BCH(63,51)
|
||||
option_jsn = 0; // JSON output (auto_rx)
|
||||
int wavloaded = 0;
|
||||
int option_min = 0;
|
||||
int option_iq = 0;
|
||||
int option_lp = 0;
|
||||
int option_dc = 0;
|
||||
int sel_wavch = 0;
|
||||
int wavloaded = 0;
|
||||
|
||||
int option1 = 0,
|
||||
option2 = 0;
|
||||
|
@ -337,6 +338,9 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
else if (strcmp(*argv, "--lp") == 0) { option_lp = 1; } // IQ lowpass
|
||||
else if ( (strcmp(*argv, "--dc") == 0) ) { option_dc = 1; }
|
||||
else if (strcmp(*argv, "--min") == 0) {
|
||||
option_min = 1;
|
||||
}
|
||||
else if (strcmp(*argv, "--json") == 0) {
|
||||
option_jsn = 1;
|
||||
option_ecc = 1;
|
||||
|
@ -387,6 +391,7 @@ int main(int argc, char **argv) {
|
|||
dsp.lpIQ_bw = 16e3; // IF lowpass bandwidth
|
||||
dsp.lpFM_bw = 4e3; // FM audio lowpass
|
||||
dsp.opt_dc = option_dc;
|
||||
dsp.opt_IFmin = option_min;
|
||||
|
||||
if ( dsp.sps < 8 ) {
|
||||
fprintf(stderr, "note: sample rate low (%.1f sps)\n", dsp.sps);
|
||||
|
|
|
@ -1532,6 +1532,7 @@ static int find_binhead(FILE *fp, hdb_t *hdb, float *score) {
|
|||
int main(int argc, char *argv[]) {
|
||||
|
||||
//int option_inv = 0; // invertiert Signal
|
||||
int option_min = 0;
|
||||
int option_iq = 0;
|
||||
int option_lp = 0;
|
||||
int option_dc = 0;
|
||||
|
@ -1642,6 +1643,9 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
else if (strcmp(*argv, "--lp") == 0) { option_lp = 1; } // IQ lowpass
|
||||
else if (strcmp(*argv, "--dc") == 0) { option_dc = 1; }
|
||||
else if (strcmp(*argv, "--min") == 0) {
|
||||
option_min = 1;
|
||||
}
|
||||
else if (strcmp(*argv, "--json") == 0) {
|
||||
gpx.option.jsn = 1;
|
||||
gpx.option.ecc = 2;
|
||||
|
@ -1710,6 +1714,7 @@ int main(int argc, char *argv[]) {
|
|||
dsp.lpIQ_bw = 8e3; // IF lowpass bandwidth
|
||||
dsp.lpFM_bw = 6e3; // FM audio lowpass
|
||||
dsp.opt_dc = option_dc;
|
||||
dsp.opt_IFmin = option_min;
|
||||
|
||||
if ( dsp.sps < 8 ) {
|
||||
fprintf(stderr, "note: sample rate low (%.1f sps)\n", dsp.sps);
|
||||
|
|
|
@ -1231,6 +1231,7 @@ int main(int argc, char *argv[]) {
|
|||
char *fpname = NULL;
|
||||
|
||||
int option_der = 0; // linErr
|
||||
int option_min = 0;
|
||||
int option_iq = 0;
|
||||
int option_lp = 0;
|
||||
int option_dc = 0;
|
||||
|
@ -1413,6 +1414,9 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
else if (strcmp(*argv, "--lp") == 0) { option_lp = 1; } // IQ lowpass
|
||||
else if (strcmp(*argv, "--dc") == 0) { option_dc = 1; }
|
||||
else if (strcmp(*argv, "--min") == 0) {
|
||||
option_min = 1;
|
||||
}
|
||||
else if (strcmp(*argv, "--ngp") == 0) { gpx.option.ngp = 1; } // RS92-NGP, RS92-D: 1680 MHz
|
||||
else {
|
||||
fp = fopen(*argv, "rb");
|
||||
|
@ -1489,6 +1493,7 @@ int main(int argc, char *argv[]) {
|
|||
dsp.lpIQ_bw = 8e3; // IF lowpass bandwidth
|
||||
dsp.lpFM_bw = 6e3; // FM audio lowpass
|
||||
dsp.opt_dc = option_dc;
|
||||
dsp.opt_IFmin = option_min;
|
||||
if (gpx.option.ngp) { // L-band rs92-ngp
|
||||
dsp.h = 3.8; // RS92-NGP: 1680/400=4.2, 4.2*0.9=3.8=4.75*0.8
|
||||
dsp.lpIQ_bw = 32e3; // IF lowpass bandwidth // 32e3=4.2*7.6e3
|
||||
|
|
|
@ -151,6 +151,7 @@ typedef struct {
|
|||
int nch; // channels
|
||||
int sel_ch; // select wav channel
|
||||
//
|
||||
int opt_IFmin;
|
||||
int sr_base;
|
||||
int decM;
|
||||
int dectaps;
|
||||
|
|
|
@ -38,7 +38,8 @@ void *thd_m10(void *);
|
|||
void *thd_lms6X(void *);
|
||||
|
||||
|
||||
#define IF_SAMPLE_RATE 48000
|
||||
#define IF_SAMPLE_RATE 48000
|
||||
#define IF_SAMPLE_RATE_MIN 32000
|
||||
|
||||
static int pcm_dec_init(pcm_t *p) {
|
||||
|
||||
|
@ -49,6 +50,7 @@ static int pcm_dec_init(pcm_t *p) {
|
|||
float tbw; // dec_lowpass: transition_bandwidth/Hz
|
||||
int taps; // dec_lowpass: taps
|
||||
|
||||
if (p->opt_IFmin) IF_sr = IF_SAMPLE_RATE_MIN;
|
||||
if (IF_sr > sr_base) IF_sr = sr_base;
|
||||
if (IF_sr < sr_base) {
|
||||
while (sr_base % IF_sr) IF_sr += 1;
|
||||
|
@ -56,7 +58,11 @@ static int pcm_dec_init(pcm_t *p) {
|
|||
}
|
||||
|
||||
f_lp = (IF_sr+20e3)/(4.0*sr_base);
|
||||
tbw = (IF_sr-20e3)/*/2.0*/; if (tbw < 0) tbw = 8e3;
|
||||
tbw = (IF_sr-20e3)/*/2.0*/;
|
||||
if (p->opt_IFmin) {
|
||||
tbw = (IF_sr-12e3);
|
||||
}
|
||||
if (tbw < 0) tbw = 10e3;
|
||||
taps = sr_base*4.0/tbw; if (taps%2==0) taps++;
|
||||
|
||||
taps = decimate_init(f_lp, taps);
|
||||
|
@ -90,7 +96,8 @@ int main(int argc, char **argv) {
|
|||
void *rstype[MAX_FQ];
|
||||
int option_pcmraw = 0,
|
||||
option_jsn = 0,
|
||||
option_dc = 0;
|
||||
option_dc = 0,
|
||||
option_min = 0;
|
||||
|
||||
#ifdef CYGWIN
|
||||
_setmode(fileno(stdin), _O_BINARY); // _fileno(stdin)
|
||||
|
@ -162,6 +169,9 @@ int main(int argc, char **argv) {
|
|||
else if (strcmp(*argv, "--dc") == 0) {
|
||||
option_dc = 1;
|
||||
}
|
||||
else if (strcmp(*argv, "--min") == 0) {
|
||||
option_min = 1;
|
||||
}
|
||||
else if (strcmp(*argv, "-") == 0) {
|
||||
int sample_rate = 0, bits_sample = 0, channels = 0;
|
||||
++argv;
|
||||
|
@ -204,6 +214,7 @@ int main(int argc, char **argv) {
|
|||
return -50;
|
||||
}
|
||||
|
||||
pcm.opt_IFmin = option_min;
|
||||
pcm_dec_init( &pcm );
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ typedef int i32_t;
|
|||
|
||||
static int option_verbose = 0, // ausfuehrliche Anzeige
|
||||
option_inv = 0, // invertiert Signal
|
||||
option_min = 0,
|
||||
option_iq = 0,
|
||||
option_dc = 0,
|
||||
option_silent = 0,
|
||||
|
@ -754,6 +755,8 @@ static int headcmp(int symlen, unsigned int mvp, int inv, rsheader_t *rshd) {
|
|||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
#define IF_SAMPLE_RATE 48000
|
||||
#define IF_SAMPLE_RATE_MIN 32000
|
||||
|
||||
#define SQRT2 1.4142135624 // sqrt(2)
|
||||
// sigma = sqrt(log(2)) / (2*PI*BT):
|
||||
|
@ -806,7 +809,7 @@ static int init_buffers() {
|
|||
|
||||
if (option_iq == 5)
|
||||
{
|
||||
int IF_sr = 48000; // designated IF sample rate
|
||||
int IF_sr = IF_SAMPLE_RATE; // designated IF sample rate
|
||||
int decM = 1; // decimate M:1
|
||||
float f_lp; // dec_lowpass: lowpass_bw/2
|
||||
float t_bw; // dec_lowpass: transition_bw
|
||||
|
@ -816,6 +819,7 @@ static int init_buffers() {
|
|||
|
||||
sr_base = sample_rate;
|
||||
|
||||
if (option_min) IF_sr = IF_SAMPLE_RATE_MIN;
|
||||
if (IF_sr > sr_base) IF_sr = sr_base;
|
||||
if (IF_sr < sr_base) {
|
||||
while (sr_base % IF_sr) IF_sr += 1;
|
||||
|
@ -823,7 +827,11 @@ static int init_buffers() {
|
|||
}
|
||||
|
||||
f_lp = (IF_sr+20e3)/(4.0*sr_base);
|
||||
t_bw = (IF_sr-20e3)/*/2.0*/; if (t_bw < 0) t_bw = 8e3;
|
||||
t_bw = (IF_sr-20e3)/*/2.0*/;
|
||||
if (option_min) {
|
||||
t_bw = (IF_sr-12e3);
|
||||
}
|
||||
if (t_bw < 0) t_bw = 10e3;
|
||||
t_bw /= sr_base;
|
||||
taps = 4.0/t_bw; if (taps%2==0) taps++;
|
||||
|
||||
|
@ -1144,6 +1152,9 @@ int main(int argc, char **argv) {
|
|||
set_lpIQ = bw_kHz * 1e3;
|
||||
}
|
||||
else if ( (strcmp(*argv, "--dc") == 0) ) { option_dc = 1; }
|
||||
else if (strcmp(*argv, "--min") == 0) {
|
||||
option_min = 1;
|
||||
}
|
||||
else if ( (strcmp(*argv, "-L") == 0) ) {
|
||||
// L-band 1680kHz (IQ: decimation not limited)
|
||||
lpIQ_bw[0] = 32e3;
|
||||
|
|
Ładowanie…
Reference in New Issue