diff --git a/lib/wsprd/osdwspr.f90 b/lib/wsprd/osdwspr.f90 index 42b8e949c..c1ae76846 100644 --- a/lib/wsprd/osdwspr.f90 +++ b/lib/wsprd/osdwspr.f90 @@ -110,11 +110,12 @@ elseif(ndeep.eq.2) then npre1=1 npre2=0 nt=66 - ntheta=16 + ntheta=22 + ntau = 16 elseif(ndeep.eq.3) then - nord=2 + nord=1 npre1=1 - npre2=0 + npre2=1 nt=66 ntheta=22 ntau=16 @@ -128,10 +129,10 @@ elseif(ndeep.eq.4) then elseif(ndeep.eq.5) then nord=3 npre1=1 - npre2=0 + npre2=1 nt=66 ntheta=22 - ntau=20 + ntau=16 endif do iorder=1,nord diff --git a/lib/wsprd/wsprd.c b/lib/wsprd/wsprd.c index 3fb15f5af..a297ecc21 100644 --- a/lib/wsprd/wsprd.c +++ b/lib/wsprd/wsprd.c @@ -83,7 +83,7 @@ unsigned long readc2file(char *ptr_to_infile, float *idat, float *qdat, fread(&ntrmin,sizeof(int),1,fp); fread(&dfreq,sizeof(double),1,fp); *freq=dfreq; - + buffer=calloc(2*65536,sizeof(float)); unsigned long nread=fread(buffer,sizeof(float),2*45000,fp); fclose(fp); @@ -139,7 +139,7 @@ unsigned long readwavfile(char *ptr_to_infile, int ntrmin, float *idat, float *q fprintf(stderr, "Cannot open data file '%s'\n", ptr_to_infile); return 1; } - + buf2 = calloc(npoints,sizeof(short int)); fread(buf2,2,22,fp); //Read and ignore header fread(buf2,2,npoints,fp); //Read raw data @@ -202,7 +202,7 @@ void sync_and_demodulate(float *id, float *qd, long np, static float dt=1.0/375.0, df=375.0/256.0; static float pi=3.14159265358979323846; float twopidt, df15=df*1.5, df05=df*0.5; - + int i, j, k, lag; float i0[162],q0[162],i1[162],q1[162],i2[162],q2[162],i3[162],q3[162]; float p0,p1,p2,p3,cmet,totp,syncmax,fac; @@ -211,7 +211,7 @@ void sync_and_demodulate(float *id, float *qd, long np, dphi3, cdphi3, sdphi3; float f0=0.0, fp, ss, fbest=0.0, fsum=0.0, f2sum=0.0, fsymb[162]; int best_shift = 0, ifreq; - + syncmax=-1e30; if( mode == 0 ) {ifmin=0; ifmax=0; fstep=0.0; f0=*f1;} if( mode == 1 ) {lagmin=*shift1;lagmax=*shift1;f0=*f1;} @@ -282,7 +282,7 @@ void sync_and_demodulate(float *id, float *qd, long np, p1=i1[i]*i1[i] + q1[i]*q1[i]; p2=i2[i]*i2[i] + q2[i]*q2[i]; p3=i3[i]*i3[i] + q3[i]*q3[i]; - + p0=sqrt(p0); p1=sqrt(p1); p2=sqrt(p2); @@ -334,12 +334,12 @@ void sync_and_demodulate(float *id, float *qd, long np, } void noncoherent_sequence_detection(float *id, float *qd, long np, - unsigned char *symbols, float *f1, int *shift1, - float *drift1, int symfac, int *nblocksize) + unsigned char *symbols, float *f1, int *shift1, + float *drift1, int symfac, int *nblocksize, int *bitmetric) { /************************************************************************ * Noncoherent sequence detection for wspr. * - * Allowed block lengths are nblock=1,2,3,6, or 9 symbols. * + * Allowed block lengths are nblock=1,2,3,6, or 9 symbols. * * Longer block lengths require longer channel coherence time. * * The whole block is estimated at once. * * nblock=1 corresponds to noncoherent detection of individual symbols * @@ -364,31 +364,32 @@ void noncoherent_sequence_detection(float *id, float *qd, long np, lag=*shift1; nblock=*nblocksize; nseq=1<0) && (k xm0 ? xm1 : xm0); + } } } for (i=0; i<162; i++) { //Normalize the soft symbols @@ -529,26 +533,26 @@ void subtract_signal(float *id, float *qd, long np, return; } /****************************************************************************** - Fully coherent signal subtraction + Subtract the coherent component of a signal *******************************************************************************/ void subtract_signal2(float *id, float *qd, long np, float f0, int shift0, float drift0, unsigned char* channel_symbols) { float dt=1.0/375.0, df=375.0/256.0; float pi=4.*atan(1.0), twopidt, phi=0, dphi, cs; - int i, j, k, ii, nsym=162, nspersym=256, nfilt=256; //nfilt must be even number. + int i, j, k, ii, nsym=162, nspersym=256, nfilt=360; //nfilt must be even number. int nsig=nsym*nspersym; int nc2=45000; float *refi, *refq, *ci, *cq, *cfi, *cfq; - + refi=calloc(nc2,sizeof(float)); refq=calloc(nc2,sizeof(float)); ci=calloc(nc2,sizeof(float)); cq=calloc(nc2,sizeof(float)); cfi=calloc(nc2,sizeof(float)); cfq=calloc(nc2,sizeof(float)); - + twopidt=2.0*pi*dt; /****************************************************************************** @@ -578,7 +582,21 @@ void subtract_signal2(float *id, float *qd, long np, phi=phi+dphi; } } - + + float w[nfilt], norm=0, partialsum[nfilt]; + //lowpass filter and remove startup transient + for (i=0; i=2 ? 1:0; + } + deinterleave(cw); + nerrors=0; + for (i=0; i<162; i++) { + is = symbols[i] > 127 ? 1:0; + nerrors = nerrors + (is == cw[i] ? 0:1); + } + return nerrors; +} + //*************************************************************************** void usage(void) { @@ -710,7 +731,7 @@ int main(int argc, char *argv[]) int i,j,k; unsigned char *symbols, *decdata, *channel_symbols, *apmask, *cw; signed char message[]={-9,13,-35,123,57,-39,64,0,0,0,0}; - char *callsign, *call_loc_pow; + char *callsign, *grid, *call_loc_pow; char *ptr_to_infile,*ptr_to_infile_suffix; char *data_dir=NULL; char wisdom_fname[200],all_fname[200],spots_fname[200]; @@ -720,13 +741,11 @@ int main(int argc, char *argv[]) int writenoise=0,usehashtable=1,wspr_type=2, ipass, nblocksize; int nhardmin,ihash; int writec2=0,maxdrift; - int shift1, lagmin, lagmax, lagstep, ifmin, ifmax, worth_a_try, not_decoded; + int shift1, lagmin, lagmax, lagstep, ifmin, ifmax, not_decoded; unsigned int nbits=81, stacksize=200000; - unsigned int npoints, metric, cycles, maxnp; + unsigned int npoints, cycles, maxnp, metric; float df=375.0/256.0/2; - float freq0[200],snr0[200],drift0[200],sync0[200]; float fsymbs[162]; - int shift0[200]; float dt=1.0/375.0, dt_print; double dialfreq_cmdline=0.0, dialfreq, freq_print; double dialfreq_error=0.0; @@ -737,16 +756,21 @@ int main(int argc, char *argv[]) float *idat, *qdat; clock_t t0,t00; float tfano=0.0,treadwav=0.0,tcandidates=0.0,tsync0=0.0; - float tsync1=0.0,tsync2=0.0,ttotal=0.0; + float tsync1=0.0,tsync2=0.0,tosd=0.0,ttotal=0.0; + + struct cand { float freq; float snr; int shift; float drift; float sync; }; + struct cand candidates[200]; struct result { char date[7]; char time[5]; float sync; float snr; - float dt; double freq; char message[23]; float drift; - unsigned int cycles; int jitter; int blocksize; unsigned int metric; - unsigned char osd_decode; }; + float dt; double freq; char message[23]; float drift; + unsigned int cycles; int jitter; int blocksize; unsigned int metric; + int nhardmin; int ipass; int decodetype;}; struct result decodes[50]; char *hashtab; hashtab=calloc(32768*13,sizeof(char)); + char *loctab; + loctab=calloc(32768*5,sizeof(char)); int nh; symbols=calloc(nbits*2,sizeof(unsigned char)); apmask=calloc(162,sizeof(unsigned char)); @@ -754,6 +778,7 @@ int main(int argc, char *argv[]) decdata=calloc(11,sizeof(unsigned char)); channel_symbols=calloc(nbits*2,sizeof(unsigned char)); callsign=calloc(13,sizeof(char)); + grid=calloc(5,sizeof(char)); call_loc_pow=calloc(23,sizeof(char)); float allfreqs[100]; char allcalls[100][13]; @@ -768,11 +793,10 @@ int main(int argc, char *argv[]) float minsync2=0.12; //Second sync limit int iifac=8; //Step size in final DT peakup int symfac=50; //Soft-symbol normalizing factor - int block_demod=1; //Default is to use block demod on pass 2 int subtraction=1; - int npasses=2; - int ndepth=-1; //Depth for OSD - + int npasses=3; + int ndepth=-1; //Depth for OSD + float minrms=52.0 * (symfac/64.0); //Final test for plausible decoding delta=60; //Fano threshold step float bias=0.45; //Fano metric bias (used for both Fano and stack algorithms) @@ -791,8 +815,8 @@ int main(int argc, char *argv[]) case 'a': data_dir = optarg; break; - case 'B': - block_demod=0; + case 'B': + npasses=2; break; case 'c': writec2=1; @@ -825,7 +849,7 @@ int main(int argc, char *argv[]) case 'q': //no shift jittering quickmode = 1; break; - case 's': //single pass mode + case 's': //single pass mode subtraction = 0; npasses = 1; break; @@ -891,10 +915,10 @@ int main(int argc, char *argv[]) // fdiag=fopen("wsprd_diag","a"); if((ftimer=fopen(timer_fname,"r"))) { - //Accumulate timing data - fscanf(ftimer,"%f %f %f %f %f %f %f", - &treadwav,&tcandidates,&tsync0,&tsync1,&tsync2,&tfano,&ttotal); - fclose(ftimer); + //Accumulate timing data + fscanf(ftimer,"%f %f %f %f %f %f %f %f", + &treadwav,&tcandidates,&tsync0,&tsync1,&tsync2,&tfano,&tosd,&ttotal); + fclose(ftimer); } ftimer=fopen(timer_fname,"w"); @@ -927,7 +951,7 @@ int main(int argc, char *argv[]) strncpy(uttime,ptr_to_infile_suffix-4,4); date[6]='\0'; uttime[4]='\0'; - + // Do windowed ffts over 2 symbols, stepped by half symbols int nffts=4*floor(npoints/512)-1; fftin=(fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex)*512); @@ -941,35 +965,32 @@ int main(int argc, char *argv[]) } if( usehashtable ) { - char line[80], hcall[12]; + char line[80], hcall[13], hgrid[5]; if( (fhash=fopen(hash_fname,"r+")) ) { while (fgets(line, sizeof(line), fhash) != NULL) { - sscanf(line,"%d %s",&nh,hcall); + hgrid[0]='\0'; + sscanf(line,"%d %s %s",&nh,hcall,hgrid); strcpy(hashtab+nh*13,hcall); + if(strlen(hgrid)>0) strcpy(loctab+nh*5,hgrid); } } else { fhash=fopen(hash_fname,"w+"); } fclose(fhash); } - + //*************** main loop starts here ***************** for (ipass=0; ipasssmspec[j-1]) && + (smspec[j]>smspec[j+1]) && + (npk<200); + if ( candidate ) { + candidates[npk].freq = (j-205)*df; + candidates[npk].snr = 10*log10(smspec[j])-snr_scaling_factor; + npk++; + } + } if( more_candidates ) { - for(j=0; j<411; j=j+2) { + for(j=0; j<411; j=j+3) { candidate = (smspec[j]>min_snr) && (npk<200); if ( candidate ) { - freq0[npk]=(j-205)*df; - snr0[npk]=10*log10(smspec[j])-snr_scaling_factor; - npk++; - } - } - } else { - for(j=1; j<410; j++) { - candidate = (smspec[j]>smspec[j-1]) && - (smspec[j]>smspec[j+1]) && - (npk<200); - if ( candidate ) { - freq0[npk]=(j-205)*df; - snr0[npk]=10*log10(smspec[j])-snr_scaling_factor; + candidates[npk].freq = (j-205)*df; + candidates[npk].snr = 10*log10(smspec[j])-snr_scaling_factor; npk++; } } } - + // Compute corrected fmin, fmax, accounting for dial frequency error fmin += dialfreq_error; // dialfreq_error is in units of Hz fmax += dialfreq_error; @@ -1076,32 +1095,28 @@ int main(int argc, char *argv[]) // Don't waste time on signals outside of the range [fmin,fmax]. i=0; for( j=0; j= fmin && freq0[j] <= fmax ) { - freq0[i]=freq0[j]; - snr0[i]=snr0[j]; + if( candidates[j].freq >= fmin && candidates[j].freq <= fmax ) { + candidates[i]=candidates[j]; i++; } } npk=i; - // bubble sort on snr, bringing freq along for the ride + // bubble sort on snr int pass; - float tmp; + struct cand tmp; for (pass = 1; pass <= npk - 1; pass++) { for (k = 0; k < npk - pass ; k++) { - if (snr0[k] < snr0[k+1]) { - tmp = snr0[k]; - snr0[k] = snr0[k+1]; - snr0[k+1] = tmp; - tmp = freq0[k]; - freq0[k] = freq0[k+1]; - freq0[k+1] = tmp; + if (candidates[k].snr < candidates[k+1].snr) { + tmp = candidates[k]; + candidates[k]=candidates[k+1]; + candidates[k+1] = tmp; } } } t0=clock(); - + /* Make coarse estimates of shift (DT), freq, and drift * Look for time offsets up to +/- 8 symbols (about +/- 5.4 s) relative @@ -1121,13 +1136,13 @@ int main(int argc, char *argv[]) span of 162 symbols, with deviation equal to 0 at the center of the signal vector. */ - + int idrift,ifr,if0,ifd,k0; int kindex; float smax,ss,pow,p0,p1,p2,p3; for(j=0; j smax ) { //Save coarse parameters smax=sync1; - shift0[j]=128*(k0+1); - drift0[j]=idrift; - freq0[j]=(ifr-256)*df; - sync0[j]=sync1; + candidates[j].shift=128*(k0+1); + candidates[j].drift=idrift; + candidates[j].freq=(ifr-256)*df; + candidates[j].sync=sync1; } } } } } tcandidates += (float)(clock()-t0)/CLOCKS_PER_SEC; - + /* Refine the estimates of freq, shift using sync as a metric. Sync is calculated such that it is a float taking values in the range @@ -1182,15 +1197,12 @@ int main(int argc, char *argv[]) could each work on one candidate at a time. */ for (j=0; jminsync1 continue fstep=0.0; ifmin=0; ifmax=0; lagmin=shift1-128; @@ -1200,24 +1212,24 @@ int main(int argc, char *argv[]) sync_and_demodulate(idat, qdat, npoints, symbols, &f1, ifmin, ifmax, fstep, &shift1, lagmin, lagmax, lagstep, &drift1, symfac, &sync1, 0); tsync0 += (float)(clock()-t0)/CLOCKS_PER_SEC; - + fstep=0.25; ifmin=-2; ifmax=2; t0 = clock(); sync_and_demodulate(idat, qdat, npoints, symbols, &f1, ifmin, ifmax, fstep, &shift1, lagmin, lagmax, lagstep, &drift1, symfac, &sync1, 1); - - if(ipass == 0) { + + if(ipass < 2) { // refine drift estimate fstep=0.0; ifmin=0; ifmax=0; float driftp,driftm,syncp,syncm; driftp=drift1+0.5; sync_and_demodulate(idat, qdat, npoints, symbols, &f1, ifmin, ifmax, fstep, &shift1, - lagmin, lagmax, lagstep, &driftp, symfac, &syncp, 1); - + lagmin, lagmax, lagstep, &driftp, symfac, &syncp, 1); + driftm=drift1-0.5; sync_and_demodulate(idat, qdat, npoints, symbols, &f1, ifmin, ifmax, fstep, &shift1, - lagmin, lagmax, lagstep, &driftm, symfac, &syncm, 1); - + lagmin, lagmax, lagstep, &driftm, symfac, &syncm, 1); + if(syncp>sync1) { drift1=driftp; sync1=syncp; @@ -1227,80 +1239,118 @@ int main(int argc, char *argv[]) } } tsync1 += (float)(clock()-t0)/CLOCKS_PER_SEC; - + // fine-grid lag and freq search if( sync1 > minsync1 ) { - + lagmin=shift1-32; lagmax=shift1+32; lagstep=16; t0 = clock(); sync_and_demodulate(idat, qdat, npoints, symbols, &f1, ifmin, ifmax, fstep, &shift1, lagmin, lagmax, lagstep, &drift1, symfac, &sync1, 0); tsync0 += (float)(clock()-t0)/CLOCKS_PER_SEC; - + // fine search over frequency fstep=0.05; ifmin=-2; ifmax=2; t0 = clock(); sync_and_demodulate(idat, qdat, npoints, symbols, &f1, ifmin, ifmax, fstep, &shift1, - lagmin, lagmax, lagstep, &drift1, symfac, &sync1, 1); + lagmin, lagmax, lagstep, &drift1, symfac, &sync1, 1); tsync1 += (float)(clock()-t0)/CLOCKS_PER_SEC; - - worth_a_try = 1; - } else { - worth_a_try = 0; + + candidates[j].freq=f1; + candidates[j].shift=shift1; + candidates[j].drift=drift1; + candidates[j].sync=sync1; } - - int idt, ii, jittered_shift; - float y,sq,rms; + } + + int nwat=0; + int idupe; + for ( j=0; j candidates[k].sync) candidates[k]=candidates[j]; + } else if ( candidates[j].sync > minsync2 ) { + candidates[nwat]=candidates[j]; + nwat++; + } + } + + int idt, ii, jittered_shift; + float y,sq,rms; + int ib, blocksize, bitmetric; + int n1,n2,n3,nadd,nu,ntype; + int osd_decode; + for (j=0; j minsync2) && (rms > minrms)) { + + if(rms > minrms) { deinterleave(symbols); t0 = clock(); - + if ( stackdecoder ) { not_decoded = jelinek(&metric, &cycles, decdata, symbols, nbits, - stacksize, stack, mettab,maxcycles); + stacksize, stack, mettab,maxcycles); } else { not_decoded = fano(&metric,&cycles,&maxnp,decdata,symbols,nbits, - mettab,delta,maxcycles); + mettab,delta,maxcycles); } - + tfano += (float)(clock()-t0)/CLOCKS_PER_SEC; - - if( (ndepth >= 0) && not_decoded ) { + + if( (ndepth >= 0) && not_decoded ) { for(i=0; i<162; i++) { - fsymbs[i]=symbols[i]-127; + fsymbs[i]=symbols[i]-128.0; } + t0 = clock(); osdwspr_(fsymbs,apmask,&ndepth,cw,&nhardmin,&dmin); + tosd += (float)(clock()-t0)/CLOCKS_PER_SEC; + for(i=0; i<162; i++) { - symbols[i]=255*cw[i]; + symbols[i]=255*cw[i]; } fano(&metric,&cycles,&maxnp,decdata,symbols,nbits, - mettab,delta,maxcycles); + mettab,delta,maxcycles); for(i=0; i<11; i++) { if( decdata[i]>127 ) { message[i]=decdata[i]-256; @@ -1311,33 +1361,42 @@ int main(int argc, char *argv[]) unpack50(message,&n1,&n2); if( !unpackcall(n1,callsign) ) break; callsign[12]=0; + if( !unpackgrid(n2, grid) ) break; + grid[4]=0; ntype = (n2&127) - 64; + int itype; if( (ntype >= 0) && (ntype <= 62) ) { nu = ntype%10; + itype=1; if( !(nu == 0 || nu == 3 || nu == 7) ) { - nadd=nu; - if( nu > 3 ) nadd=nu-3; - if( nu > 7 ) nadd=nu-7; - n3=n2/128+32768*(nadd-1); - if( !unpackpfx(n3,callsign) ) break; + nadd=nu; + if( nu > 3 ) nadd=nu-3; + if( nu > 7 ) nadd=nu-7; + n3=n2/128+32768*(nadd-1); + if( !unpackpfx(n3,callsign) ) { + break; + } + itype=2; } ihash=nhash(callsign,strlen(callsign),(uint32_t)146); - if(strncmp(hashtab+ihash*13,callsign,13)==0) { - not_decoded=0; - osd_decode =1; - break; + if(strncmp(hashtab+ihash*13,callsign,13)==0) { + if( (itype==1 && strncmp(loctab+ihash*5,grid,5)==0) || + (itype==2) ) { + not_decoded=0; + osd_decode =1; + } } - } + } } - + } idt++; if( quickmode ) break; } ib++; - } - - if( worth_a_try && !not_decoded ) { + } + + if( !not_decoded ) { ndecodes_pass++; for(i=0; i<11; i++) { @@ -1349,26 +1408,25 @@ int main(int argc, char *argv[]) } } - + // Unpack the decoded message, update the hashtable, apply // sanity checks on grid and power, and return // call_loc_pow string and also callsign (for de-duping). - noprint=unpk_(message,hashtab,call_loc_pow,callsign); - - // subtract even on last pass - if( subtraction && (ipass < npasses ) && !noprint ) { - if( get_wspr_channel_symbols(call_loc_pow, hashtab, channel_symbols) ) { + noprint=unpk_(message,hashtab,loctab,call_loc_pow,callsign); + if( subtraction && !noprint ) { + if( get_wspr_channel_symbols(call_loc_pow, hashtab, loctab, channel_symbols) ) { subtract_signal2(idat, qdat, npoints, f1, shift1, drift1, channel_symbols); + if(!osd_decode) nhardmin=count_hard_errors(symbols,channel_symbols); } else { break; } } - - // Remove dupes (same callsign and freq within 3 Hz) + + // Remove dupes (same callsign and freq within 4 Hz) int dupe=0; for (i=0; i *(const float*)elem2; } -int unpk_(signed char *message, char *hashtab, char *call_loc_pow, char *callsign) +int unpk_(signed char *message, char *hashtab, char *loctab, char *call_loc_pow, char *callsign) { int n1,n2,n3,ndbm,ihash,nadd,noprint=0; char grid[5],grid6[7],cdbm[3]; @@ -279,6 +279,7 @@ int unpk_(signed char *message, char *hashtab, char *call_loc_pow, char *callsig strncat(call_loc_pow,"\0",1); ihash=nhash(callsign,strlen(callsign),(uint32_t)146); strcpy(hashtab+ihash*13,callsign); + strcpy(loctab+ihash*5,grid); } else { nadd=nu; if( nu > 3 ) nadd=nu-3; @@ -312,7 +313,9 @@ int unpk_(signed char *message, char *hashtab, char *call_loc_pow, char *callsig // not testing 4'th and 5'th chars because of this case: JO33 40 // grid is only 4 chars even though this is a hashed callsign... // isalpha(grid6[4]) && isalpha(grid6[5]) ) ) { - noprint=1; + noprint=1; + } else { + strncpy(loctab+ihash*5,grid6,4); } ihash=(n2-ntype-64)/128; diff --git a/lib/wsprd/wsprd_utils.h b/lib/wsprd/wsprd_utils.h index d67083633..db6ba9466 100644 --- a/lib/wsprd/wsprd_utils.h +++ b/lib/wsprd/wsprd_utils.h @@ -24,6 +24,6 @@ void deinterleave(unsigned char *sym); int doublecomp(const void* elem1, const void* elem2); int floatcomp(const void* elem1, const void* elem2); -int unpk_( signed char *message, char* hashtab, char *call_loc_pow, char *callsign); +int unpk_( signed char *message, char* hashtab, char* loctab, char *call_loc_pow, char *callsign); #endif diff --git a/lib/wsprd/wsprsim.c b/lib/wsprd/wsprsim.c index b3af99809..053dd547a 100644 --- a/lib/wsprd/wsprsim.c +++ b/lib/wsprd/wsprsim.c @@ -128,10 +128,12 @@ int main(int argc, char *argv[]) int i, c, printchannel=0, writec2=0; float snr=50.0; float f0=0.0, t0=1.0; - char *message, *c2filename, *hashtab; + char *message, *c2filename, *hashtab, *loctab; c2filename=malloc(sizeof(char)*15); hashtab=malloc(sizeof(char)*32768*13); + loctab=malloc(sizeof(char)*32768*5); memset(hashtab,0,sizeof(char)*32768*13); + memset(hashtab,0,sizeof(char)*32768*5); // message length is 22 characters message=malloc(sizeof(char)*23); @@ -169,7 +171,7 @@ int main(int argc, char *argv[]) } unsigned char channel_symbols[162]; - get_wspr_channel_symbols(message, hashtab, channel_symbols); + get_wspr_channel_symbols(message, hashtab, loctab, channel_symbols); if( printchannel ) { printf("Channel symbols:\n"); diff --git a/lib/wsprd/wsprsim_utils.c b/lib/wsprd/wsprsim_utils.c index f65efba4a..b6b95c491 100644 --- a/lib/wsprd/wsprsim_utils.c +++ b/lib/wsprd/wsprsim_utils.c @@ -162,7 +162,7 @@ void interleave(unsigned char *sym) } } -int get_wspr_channel_symbols(char* rawmessage, char* hashtab, unsigned char* symbols) { +int get_wspr_channel_symbols(char* rawmessage, char* hashtab, char* loctab, unsigned char* symbols) { int m=0, ntype=0; long unsigned int n=0; int i, j, ihash; @@ -292,7 +292,7 @@ int get_wspr_channel_symbols(char* rawmessage, char* hashtab, unsigned char* sym signed char check_data[11]; memcpy(check_data,data,sizeof(char)*11); - unpk_(check_data,hashtab,check_call_loc_pow,check_callsign); + unpk_(check_data,hashtab,loctab,check_call_loc_pow,check_callsign); // printf("Will decode as: %s\n",check_call_loc_pow); unsigned int nbytes=11; // The message with tail is packed into almost 11 bytes. diff --git a/lib/wsprd/wsprsim_utils.h b/lib/wsprd/wsprsim_utils.h index acffdee91..7f1f62e93 100644 --- a/lib/wsprd/wsprsim_utils.h +++ b/lib/wsprd/wsprsim_utils.h @@ -11,6 +11,6 @@ extern int printdata; -int get_wspr_channel_symbols(char* message, char* hashtab, unsigned char* symbols); +int get_wspr_channel_symbols(char* message, char* hashtab, char*loctab, unsigned char* symbols); #endif diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index a90ab8992..50301c397 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1491,8 +1491,8 @@ void MainWindow::dataSink(qint64 frames) double f0m1500=m_dialFreqRxWSPR/1000000.0; // + 0.000001*(m_BFO - 1500); t2.sprintf(" -f %.6f ",f0m1500); if((m_ndepth&7)==1) depth_string=" -qB "; //2 pass w subtract, no Block detection, no shift jittering - if((m_ndepth&7)==2) depth_string=" -B "; //2 pass w subtract, no Block detection - if((m_ndepth&7)==3) depth_string=" -C 5000 -o 4"; //2 pass w subtract, Block detection and OSD. + if((m_ndepth&7)==2) depth_string=" -C 500 -o 4 "; //3 pass, subtract, Block detection, OSD + if((m_ndepth&7)==3) depth_string=" -C 500 -o 4 -d "; //3 pass, subtract, Block detect, OSD, more candidates QString degrade; degrade.sprintf("-d %4.1f ",m_config.degrade());