Implemented the "nqd=1,0,-1" logic for decoding.

Plot scale now marks the decoding range in blue, Rx freq range in green, 
and Tx frew range in red.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3126 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-04-03 20:21:00 +00:00
parent 4b4a1a2f42
commit dc49b627c2
2 changed files with 107 additions and 75 deletions

View File

@ -67,68 +67,78 @@ subroutine decoder(ss,c0)
kstep=nsps/2
tstep=kstep/12000.0
call timer('sync9 ',0)
! Compute ccfred()
call sync9(ss,nzhsym,tstep,df3,nfa,nfb,ntol,nfqso,ccfred,ia,ib,ipk)
call timer('sync9 ',1)
ccfok=.false.
ccfok(max(ipk-1,1):min(ipk+1,NSMAX))=.true.
! nok=0
do i=ia+9,ib-25
t1=ccfred(i)/(sum(ccfred(i-8:i-6)/3.0))
t2=ccfred(i)/(sum(ccfred(i+23:i+25)/3.0))
if(t1.ge.ccflim .and. t2.ge.ccflim) ccfok(i)=.true.
! if(ccfok(i)) nok=nok+1
enddo
! write(39,*) nok,(ib-25) - (ia+9) +1
! call flush(39)
nRxLog=0
fgood=0.
nsps8=nsps/8
df8=1500.0/nsps8
sbest=-1.0
dblim=db(864.0/nsps8) - 26.2
i1=max(nint((nfqso-1000)/df3 - 10),ia)
i2=min(nint((nfqso-1000)/df3 + 10),ib)
ii=maxloc(ccfred(i1:i2))
i00=ii(1) + i1 - 1
do j=ia,ib
i=j
if(i.eq.ia) i=i00 !Examine QSO frequency first
f=(i-1)*df3
if(.not.ccfok(i)) cycle
if((i.eq.i00 .or. (ccfred(i).ge.3.0) .and. abs(f-fgood).gt.10.0*df8)) then
call timer('decode9a',0)
fpk=1000.0 + df3*(i-1)
c1(1:npts8)=conjg(c0(1:npts8))
call decode9a(c1,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
i1SoftSymbols)
call timer('decode9a',1)
call timer('decode9 ',0)
call decode9(i1SoftSymbols,limit,nlim,msg)
call timer('decode9 ',1)
! sync=(syncpk-1.0)/2.0
sync=(syncpk+1)/4.0
if(sync.lt.0.0 .or. snrdb.lt.dblim-2.0) sync=0.0
nsync=sync
if(nsync.gt.10) nsync=10
nsnr=nint(snrdb)
ndrift=nint(drift/df3)
if(msg.ne.' ') then
write(*,fmt) nutc,nsync,nsnr,xdt,freq,ndrift,msg
write(13,fmt) nutc,nsync,nsnr,xdt,freq,ndrift,msg
fgood=f
nsynced=1
ndecoded=1
ccfok(max(ia,i-3):min(ib,i+11))=.false.
call flush(6)
endif
do nqd=1,0,-1
if(nqd.eq.1) then
nfa1=nfqso-ntol
nfb1=nfqso+ntol
else
nfa1=nfa
nfb1=nfb
endif
call timer('sync9 ',0)
! Compute ccfred()
call sync9(ss,nzhsym,tstep,df3,nfa1,nfb1,ntol,nfqso,ccfred,ia,ib,ipk)
call timer('sync9 ',1)
ccfok=.false.
ccfok(max(ipk-1,1):min(ipk+1,NSMAX))=.true.
if(nqd.eq.1) then
ia1=ia
ib1=ib
else
do i=ia+9,ib-25
t1=ccfred(i)/(sum(ccfred(i-8:i-6)/3.0))
t2=ccfred(i)/(sum(ccfred(i+23:i+25)/3.0))
if(t1.ge.ccflim .and. t2.ge.ccflim) ccfok(i)=.true.
enddo
ccfok(ia1:ib1)=.false.
endif
nRxLog=0
fgood=0.
nsps8=nsps/8
df8=1500.0/nsps8
sbest=-1.0
dblim=db(864.0/nsps8) - 26.2
i1=max(nint((nfqso-1000)/df3 - 10),ia)
i2=min(nint((nfqso-1000)/df3 + 10),ib)
ii=maxloc(ccfred(i1:i2))
i00=ii(1) + i1 - 1
do i=ia,ib
f=(i-1)*df3
if(.not.ccfok(i)) cycle
if(nqd.eq.1 .or. &
(ccfred(i).ge.3.0 .and. abs(f-fgood).gt.10.0*df8)) then
call timer('decode9a',0)
fpk=1000.0 + df3*(i-1)
c1(1:npts8)=conjg(c0(1:npts8))
call decode9a(c1,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
i1SoftSymbols)
call timer('decode9a',1)
call timer('decode9 ',0)
call decode9(i1SoftSymbols,limit,nlim,msg)
call timer('decode9 ',1)
sync=(syncpk+1)/4.0
if(sync.lt.0.0 .or. snrdb.lt.dblim-2.0) sync=0.0
nsync=sync
if(nsync.gt.10) nsync=10
nsnr=nint(snrdb)
ndrift=nint(drift/df3)
if(msg.ne.' ') then
write(*,fmt) nutc,nsync,nsnr,xdt,freq,ndrift,msg
write(13,fmt) nutc,nsync,nsnr,xdt,freq,ndrift,msg
fgood=f
nsynced=1
ndecoded=1
ccfok(max(ia,i-3):min(ib,i+11))=.false.
call flush(6)
endif
endif
enddo
call flush(6)
enddo
write(*,1010) nsynced,ndecoded

View File

@ -174,7 +174,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
if(m_OverlayPixmap.isNull()) return;
if(m_WaterfallPixmap.isNull()) return;
int w = m_WaterfallPixmap.width();
int x,y,x1,x2;
int x,y,x1,x2,dx;
// int nHzDiv[11]={0,50,100,200,200,200,500,500,500,500,500};
float pixperdiv;
@ -269,21 +269,43 @@ void CPlotter::DrawOverlay() //DrawOverlay()
}
}
QPen pen0(Qt::green, 3); //Mark QSO Freq with green tick
painter0.setPen(pen0);
x=XfromFreq(m_fQSO);
painter0.drawLine(x,17,x,30);
x1=XfromFreq(m_fMin); //Mark the decoding range
x2=XfromFreq(m_fMax);
pen0.setWidth(6);
painter0.drawLine(x1,28,x2,28);
x1=XfromFreq(m_fMin);
int bw=9.0*12000.0/m_nsps;
dx=XfromFreq(m_fMin+bw) - x1;
QPen pen1(Qt::red, 3); //Mark TxFreq with red tick
QPen pen0(Qt::green, 3); //Mark Rx Freq with green
painter0.setPen(pen0);
x1=XfromFreq(m_fQSO);
x2=x1+dx;
painter0.drawLine(x1,24,x1,30);
painter0.drawLine(x1,28,x2,28);
painter0.drawLine(x2,24,x2,30);
QPen pen2(Qt::blue, 3); //Mark the decoding range
painter0.setPen(pen2);
x1=XfromFreq(m_fMin);
if(x1<2) x1=2;
x2=x1+30;
// pen2.setWidth(6);
painter0.drawLine(x1,18,x1,28);
painter0.drawLine(x1,23,x2,23);
painter0.drawLine(x2,23,x2-5,18);
painter0.drawLine(x2,23,x2-5,28);
x2=XfromFreq(m_fMax);
x1=x2-30;
// pen2.setWidth(6);
painter0.drawLine(x2,18,x2,28);
painter0.drawLine(x1,23,x2,23);
painter0.drawLine(x1,23,x1+5,18);
painter0.drawLine(x1,23,x1+5,28);
QPen pen1(Qt::red, 3); //Mark Tx freq with red
painter0.setPen(pen1);
x=XfromFreq(m_txFreq);
painter0.drawLine(x,0,x,13);
painter0.drawLine(x,13,x-2,11);
painter0.drawLine(x,13,x+2,11);
x1=XfromFreq(m_txFreq);
x2=x1+dx;
painter0.drawLine(x1,17,x1,21);
painter0.drawLine(x1,17,x2,17);
painter0.drawLine(x2,17,x2,21);
}
void CPlotter::MakeFrequencyStrs() //MakeFrequencyStrs