diff --git a/lib/wsprd/osdwspr.f90 b/lib/wsprd/osdwspr.f90 index 26069eb14..42b8e949c 100644 --- a/lib/wsprd/osdwspr.f90 +++ b/lib/wsprd/osdwspr.f90 @@ -18,25 +18,12 @@ integer indx(N),ndeep,nhardmin real rx(N),absrx(N),dmin logical first,reset data first/.true./ -!data p1/1,0,0,0,1,1,0,0,0,0,1,0,0,0,1,0,1,1,0,0,1,1,1,0,1/ -!data p2/1,0,1,0,1,0,1,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,1,1,1/ -!data p3/1,1,0,1,0,1,0,1,1,0,1,0,0,1,1,0,1,1,1,1,1,1,0,1,1/ -!data p4/1,1,1,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,1/ -!data p1/1,0,1,0,1,1,0,0,1,1,0,1,1,1,1,1/ -!data p2/1,0,1,1,0,1,0,0,1,1,1,1,1,0,0,1/ -!data p3/1,1,0,0,1,0,1,1,0,1,1,1,0,0,1,1/ -!data p4/1,1,1,0,1,1,0,1,1,1,1,0,0,1,0,1/ data gg/1,1,0,1,0,1,0,0,1,0,0,0,1,1,0,0,1,0,1,0,0,1,0,1,1,1,0,1,1,0,0,0, & 0,1,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,0,1,0,0,1,0,0,1,0,1,1,1,1,1,1/ save first,gen if( first ) then ! fill the generator matrix -! gg=0 -! gg(1:L)=p1 -! gg(L+1:2*L)=p2 -! gg(2*L+1:3*L)=p3 -! gg(3*L+1:4*L)=p4 gen=0 gen(1,1:2*L)=gg(1:2*L) do i=2,K @@ -45,7 +32,6 @@ if( first ) then ! fill the generator matrix first=.false. endif -! Re-order received vector to place systematic msg bits at the end. rx=ss/127.0 apmaskr=apmask @@ -111,41 +97,41 @@ cw=c0 ntotal=0 nrejected=0 -if(ndeep.eq.0) goto 998 ! norder=0 +if(ndeep.le.0) goto 998 ! norder=0 if(ndeep.gt.5) ndeep=5 if( ndeep.eq. 1) then nord=1 npre1=0 npre2=0 - nt=60 - ntheta=12 + nt=66 + ntheta=16 elseif(ndeep.eq.2) then nord=1 npre1=1 npre2=0 - nt=60 - ntheta=12 + nt=66 + ntheta=16 elseif(ndeep.eq.3) then - nord=1 + nord=2 npre1=1 - npre2=1 - nt=60 + npre2=0 + nt=66 ntheta=22 ntau=16 elseif(ndeep.eq.4) then nord=2 npre1=1 - npre2=0 - nt=60 + npre2=1 + nt=66 ntheta=22 ntau=16 elseif(ndeep.eq.5) then nord=3 npre1=1 - npre2=1 - nt=60 + npre2=0 + nt=66 ntheta=22 - ntau=16 + ntau=20 endif do iorder=1,nord diff --git a/lib/wsprd/wsprd.c b/lib/wsprd/wsprd.c index fc5b7e8ed..024afaa48 100644 --- a/lib/wsprd/wsprd.c +++ b/lib/wsprd/wsprd.c @@ -693,6 +693,7 @@ void usage(void) printf(" -H do not use (or update) the hash table\n"); printf(" -J use the stack decoder instead of Fano decoder\n"); printf(" -m decode wspr-15 .wav file\n"); + printf(" -o n (0<=n<=5), decoding depth for OSD, default is disabled\n"); printf(" -q quick mode - doesn't dig deep for weak signals\n"); printf(" -s single pass mode, no subtraction (same as original wsprd)\n"); printf(" -v verbose mode (shows dupes)\n"); @@ -771,7 +772,7 @@ int main(int argc, char *argv[]) int block_demod=1; //Default is to use block demod on pass 2 int subtraction=1; int npasses=2; - int ndepth=3; //Depth for OSD + int ndepth=-1; //Depth for OSD float minrms=52.0 * (symfac/64.0); //Final test for plausible decoding delta=60; //Fano threshold step @@ -786,7 +787,7 @@ int main(int argc, char *argv[]) idat=calloc(maxpts,sizeof(float)); qdat=calloc(maxpts,sizeof(float)); - while ( (c = getopt(argc, argv, "a:BcC:de:f:HJmoqstwvz:")) !=-1 ) { + while ( (c = getopt(argc, argv, "a:BcC:de:f:HJmo:qstwvz:")) !=-1 ) { switch (c) { case 'a': data_dir = optarg; @@ -820,7 +821,7 @@ int main(int argc, char *argv[]) wspr_type = 15; break; case 'o': //use ordered-statistics-decoder - use_osd = 1; + ndepth=(int) strtol(optarg,NULL,10); break; case 'q': //no shift jittering quickmode = 1; @@ -1291,12 +1292,11 @@ int main(int argc, char *argv[]) tfano += (float)(clock()-t0)/CLOCKS_PER_SEC; - if( use_osd && not_decoded ) { - int ndeep=5; + if( (ndepth >= 0) && not_decoded ) { for(i=0; i<162; i++) { fsymbs[i]=symbols[i]-127; } - osdwspr_(fsymbs,apmask,&ndeep,cw,&nhardmin,&dmin); + osdwspr_(fsymbs,apmask,&ndepth,cw,&nhardmin,&dmin); for(i=0; i<162; i++) { symbols[i]=255*cw[i]; } diff --git a/mainwindow.cpp b/mainwindow.cpp index 8ae8b9463..7fd49db9a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1379,7 +1379,7 @@ void MainWindow::dataSink(qint64 frames) 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=" -o"; //2 pass w subtract, Block detection and OSD. + if((m_ndepth&7)==3) depth_string=" -C 5000 -o 4"; //2 pass w subtract, Block detection and OSD. QString degrade; degrade.sprintf("-d %4.1f ",m_config.degrade());