Refine and clean up wspr osd code.

This commit is contained in:
Steve Franke 2018-09-11 16:45:17 -05:00
parent af7feaf65a
commit 261c68ec6d
3 changed files with 20 additions and 34 deletions

View File

@ -18,25 +18,12 @@ integer indx(N),ndeep,nhardmin
real rx(N),absrx(N),dmin real rx(N),absrx(N),dmin
logical first,reset logical first,reset
data first/.true./ 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, & 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/ 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 save first,gen
if( first ) then ! fill the generator matrix 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=0
gen(1,1:2*L)=gg(1:2*L) gen(1,1:2*L)=gg(1:2*L)
do i=2,K do i=2,K
@ -45,7 +32,6 @@ if( first ) then ! fill the generator matrix
first=.false. first=.false.
endif endif
! Re-order received vector to place systematic msg bits at the end.
rx=ss/127.0 rx=ss/127.0
apmaskr=apmask apmaskr=apmask
@ -111,41 +97,41 @@ cw=c0
ntotal=0 ntotal=0
nrejected=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.gt.5) ndeep=5
if( ndeep.eq. 1) then if( ndeep.eq. 1) then
nord=1 nord=1
npre1=0 npre1=0
npre2=0 npre2=0
nt=60 nt=66
ntheta=12 ntheta=16
elseif(ndeep.eq.2) then elseif(ndeep.eq.2) then
nord=1 nord=1
npre1=1 npre1=1
npre2=0 npre2=0
nt=60 nt=66
ntheta=12 ntheta=16
elseif(ndeep.eq.3) then elseif(ndeep.eq.3) then
nord=1 nord=2
npre1=1 npre1=1
npre2=1 npre2=0
nt=60 nt=66
ntheta=22 ntheta=22
ntau=16 ntau=16
elseif(ndeep.eq.4) then elseif(ndeep.eq.4) then
nord=2 nord=2
npre1=1 npre1=1
npre2=0 npre2=1
nt=60 nt=66
ntheta=22 ntheta=22
ntau=16 ntau=16
elseif(ndeep.eq.5) then elseif(ndeep.eq.5) then
nord=3 nord=3
npre1=1 npre1=1
npre2=1 npre2=0
nt=60 nt=66
ntheta=22 ntheta=22
ntau=16 ntau=20
endif endif
do iorder=1,nord do iorder=1,nord

View File

@ -693,6 +693,7 @@ void usage(void)
printf(" -H do not use (or update) the hash table\n"); printf(" -H do not use (or update) the hash table\n");
printf(" -J use the stack decoder instead of Fano decoder\n"); printf(" -J use the stack decoder instead of Fano decoder\n");
printf(" -m decode wspr-15 .wav file\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(" -q quick mode - doesn't dig deep for weak signals\n");
printf(" -s single pass mode, no subtraction (same as original wsprd)\n"); printf(" -s single pass mode, no subtraction (same as original wsprd)\n");
printf(" -v verbose mode (shows dupes)\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 block_demod=1; //Default is to use block demod on pass 2
int subtraction=1; int subtraction=1;
int npasses=2; 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 float minrms=52.0 * (symfac/64.0); //Final test for plausible decoding
delta=60; //Fano threshold step delta=60; //Fano threshold step
@ -786,7 +787,7 @@ int main(int argc, char *argv[])
idat=calloc(maxpts,sizeof(float)); idat=calloc(maxpts,sizeof(float));
qdat=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) { switch (c) {
case 'a': case 'a':
data_dir = optarg; data_dir = optarg;
@ -820,7 +821,7 @@ int main(int argc, char *argv[])
wspr_type = 15; wspr_type = 15;
break; break;
case 'o': //use ordered-statistics-decoder case 'o': //use ordered-statistics-decoder
use_osd = 1; ndepth=(int) strtol(optarg,NULL,10);
break; break;
case 'q': //no shift jittering case 'q': //no shift jittering
quickmode = 1; quickmode = 1;
@ -1291,12 +1292,11 @@ int main(int argc, char *argv[])
tfano += (float)(clock()-t0)/CLOCKS_PER_SEC; tfano += (float)(clock()-t0)/CLOCKS_PER_SEC;
if( use_osd && not_decoded ) { if( (ndepth >= 0) && not_decoded ) {
int ndeep=5;
for(i=0; i<162; i++) { for(i=0; i<162; i++) {
fsymbs[i]=symbols[i]-127; 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++) { for(i=0; i<162; i++) {
symbols[i]=255*cw[i]; symbols[i]=255*cw[i];
} }

View File

@ -1379,7 +1379,7 @@ void MainWindow::dataSink(qint64 frames)
t2.sprintf(" -f %.6f ",f0m1500); 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)==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)==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; QString degrade;
degrade.sprintf("-d %4.1f ",m_config.degrade()); degrade.sprintf("-d %4.1f ",m_config.degrade());