Introduce nzhsym, the number of computed half-symbol spectra.

Correct the logic for computing lag range in sync9.f90.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2751 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-11-19 18:23:39 +00:00
parent 2c9479df01
commit 561acda6f7
7 changed files with 18 additions and 10 deletions

View File

@ -18,6 +18,7 @@ extern struct {
int nfb; //High decode limit (kHz) int nfb; //High decode limit (kHz)
int ntol; //+/- decoding range around fQSO (Hz) int ntol; //+/- decoding range around fQSO (Hz)
int kin; int kin;
int nzhsym;
int nsynced; int nsynced;
int ndecoded; int ndecoded;
} jt9com_; } jt9com_;

View File

@ -14,7 +14,7 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c00)
integer ii(1) integer ii(1)
complex c0(NDMAX),c00(NDMAX) complex c0(NDMAX),c00(NDMAX)
common/jt9com/ss0(184,NSMAX),savg(NSMAX),id2(NMAX),nutc0,ndiskdat, & common/jt9com/ss0(184,NSMAX),savg(NSMAX),id2(NMAX),nutc0,ndiskdat, &
ntr,nfqso,newdat,npts80,nfb,ntol,kin,nsynced,ndecoded ntr,nfqso,newdat,npts80,nfb,ntol,kin,nzhsym,nsynced,ndecoded
common/jt9comB/ss(184,NSMAX),c0 common/jt9comB/ss(184,NSMAX),c0
common/tracer/limtrace,lu common/tracer/limtrace,lu
logical first logical first
@ -79,7 +79,7 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c00)
tstep=kstep/12000.0 tstep=kstep/12000.0
call timer('sync9 ',0) call timer('sync9 ',0)
call sync9(ss,tstep,df3,ntol,nfqso,ccfred,ia,ib,ipk) ! Get sync, approx freq call sync9(ss,nzhsym,tstep,df3,ntol,nfqso,ccfred,ia,ib,ipk) !Compute ccfred
call timer('sync9 ',1) call timer('sync9 ',1)
open(13,file='decoded.txt',status='unknown') open(13,file='decoded.txt',status='unknown')
@ -98,7 +98,6 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c00)
ii=maxloc(ccfred(ia:ib)) ii=maxloc(ccfred(ia:ib))
i=ii(1) + ia - 1 i=ii(1) + ia - 1
f=(i-1)*df3 f=(i-1)*df3
print*,ipk,i,ccfred(i),f,abs(f-fgood)
if((i.eq.ipk .or. ccfred(i).ge.3.0) .and. abs(f-fgood).gt.10.0*df8) then if((i.eq.ipk .or. ccfred(i).ge.3.0) .and. abs(f-fgood).gt.10.0*df8) then
call timer('spec9 ',0) call timer('spec9 ',0)
call spec9(c0,npts8,nsps,f,fpk,xdt,snr,i1SoftSymbols) call spec9(c0,npts8,nsps,f,fpk,xdt,snr,i1SoftSymbols)

View File

@ -4,6 +4,10 @@
integer ii2(16) !Locations of sync half-symbols integer ii2(16) !Locations of sync half-symbols
data ii2/1,3,9,19,31,45,65,69,101,103,109,119,131,145,165,169/ data ii2/1,3,9,19,31,45,65,69,101,103,109,119,131,145,165,169/
integer ka(16),kb(16) !Reference symbols for sync
data ka/5,5,11,21,33,47,63,71,97,105,111,121,133,147,159,163/
data kb/7,7,13,23,35,49,67,73,99,107,113,123,135,149,161,167/
integer isync(85) !Sync vector integer isync(85) !Sync vector
data isync/ & data isync/ &

View File

@ -33,7 +33,7 @@ subroutine symspec(k,ntrperiod,nsps,ingain,nb,nbslider,pxdb,s,red, &
integer*2 id2 integer*2 id2
complex c0(NDMAX) complex c0(NDMAX)
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, & common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, &
ntr,mousefqso,newdat,nfa,nfb,ntol,kin ntr,mousefqso,newdat,nfa,nfb,ntol,kin,nzhsym,nsynced,ndecoded
data rms/999.0/,k0/99999999/,ntrperiod0/0/,nfft3z/0/ data rms/999.0/,k0/99999999/,ntrperiod0/0/,nfft3z/0/
save save

View File

@ -1,4 +1,4 @@
subroutine sync9(ss,tstep,df3,ntol,nfqso,ccfred,ia,ib,ipkbest) subroutine sync9(ss,nzhsym,tstep,df3,ntol,nfqso,ccfred,ia,ib,ipkbest)
parameter (NSMAX=22000) !Max length of saved spectra parameter (NSMAX=22000) !Max length of saved spectra
real ss(184,NSMAX) real ss(184,NSMAX)
@ -18,16 +18,20 @@ subroutine sync9(ss,tstep,df3,ntol,nfqso,ccfred,ia,ib,ipkbest)
endif endif
sbest=0. sbest=0.
lagmax=2.5/tstep + 0.9999 lag1=-(2.5/tstep + 0.9999)
lag2=5.0/tstep + 0.9999
ccfred=0. ccfred=0.
do i=ia,ib do i=ia,ib
smax=0. smax=0.
do lag=-lagmax,lagmax do lag=lag1,lag2
sum=0. sum=0.
do j=1,16 do j=1,16
k=ii2(j) + lag k=ii2(j) + lag
if(k.ge.1) sum=sum + ss(k,i) - 0.5*(ss(k+2,i)+ss(k+4,i)) kaa=ka(j)+lag
kbb=kb(j)+lag
if(k.ge.1 .and. k.le.nzhsym) sum=sum + ss(k,i) - &
0.5*(ss(kaa,i)+ss(kbb,i))
enddo enddo
if(sum.gt.smax) then if(sum.gt.smax) then
smax=sum smax=sum

View File

@ -350,12 +350,11 @@ void MainWindow::dataSink(int k)
g_pWideGraph->dataSink2(s,red,df3,ihsym,m_diskData,lstrong); g_pWideGraph->dataSink2(s,red,df3,ihsym,m_diskData,lstrong);
} }
// This is a bit strange. Why do we need the "-3" ???
// if(ihsym == m_hsymStop-3) {
if(ihsym == m_hsymStop) { if(ihsym == m_hsymStop) {
m_dataAvailable=true; m_dataAvailable=true;
jt9com_.npts8=(ihsym*m_nsps)/16; jt9com_.npts8=(ihsym*m_nsps)/16;
jt9com_.newdat=1; jt9com_.newdat=1;
jt9com_.nzhsym=m_hsymStop;
QDateTime t = QDateTime::currentDateTimeUtc(); QDateTime t = QDateTime::currentDateTimeUtc();
m_dateTime=t.toString("yyyy-MMM-dd hh:mm"); m_dateTime=t.toString("yyyy-MMM-dd hh:mm");
decode(); //Start the decoder decode(); //Start the decoder

View File

@ -19,6 +19,7 @@ extern struct {
int nfb; //High decode limit (kHz) int nfb; //High decode limit (kHz)
int ntol; //+/- decoding range around fQSO (Hz) int ntol; //+/- decoding range around fQSO (Hz)
int kin; int kin;
int nzhsym;
int nsynced; int nsynced;
int ndecoded; int ndecoded;
} jt9com_; } jt9com_;