Correct a scaling error in spec9. Should improve decoding significantly!

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2715 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-11-06 19:49:19 +00:00
parent e4c78f090b
commit 46c6f4cb22
4 changed files with 70 additions and 21 deletions

Binary file not shown.

View File

@ -11,7 +11,7 @@ program jt9
parameter (NSMAX=22000) !Max length of saved spectra
integer*4 ihdr(11)
real*4 s(NSMAX)
real*4 red(NSMAX)
real*4 ccfred(NSMAX)
logical*1 lstrong(0:1023)
integer*1 i1SoftSymbols(207)
character*22 msg
@ -37,11 +37,13 @@ program jt9
nfa=1000
nfb=2000
ntol=500
! ntol=500
ntol=20
nfqso=1500
newdat=1
nb=0
nbslider=100
limit=20000
do ifile=ifile1,nargs
call getarg(ifile,infile)
@ -75,8 +77,9 @@ program jt9
nhsym=(k-2048)/kstep
if(nhsym.ge.1 .and. nhsym.ne.nhsym0) then
! Emit signal readyForFFT
call symspec(k,ntrperiod,nsps,nb,nbslider,pxdb, &
s,red,df3,ihsym,nzap,slimit,lstrong,c0,npts8)
ingain=0
call symspec(k,ntrperiod,nsps,ingain,nb,nbslider,pxdb, &
s,ccfred,df3,ihsym,nzap,slimit,lstrong,c0,npts8)
nhsym0=nhsym
if(ihsym.ge.184) go to 10
endif
@ -84,24 +87,53 @@ program jt9
10 close(10)
iz=1000.0/df3
! print*,'A',ihsym,nhsym,tstep,df3,ntol,nfqso
! Now do the decoding
nutc=nutc0
! Get sync, approx freq
call sync9(ss,tstep,df3,ntol,nfqso,sync,snr,fpk0,red)
! print*,'B',sync,fpk,npts8,nsps
call spec9(c0,npts8,nsps,fpk0,fpk,xdt,i1SoftSymbols)
call decode9(i1SoftSymbols,msg)
nsync=sync
nsnr=nint(snr)
width=0.0
write(*,1010) nutc,nsync,nsnr,xdt,1000.0+fpk,width,msg
1010 format(i4.4,i4,i5,f6.1,f8.2,f6.2,3x,a22)
call sync9(ss,tstep,df3,ntol,nfqso,ccfred,ia,ib,ipk)
fgood=0.
df8=1500.0/(nsps/8)
sbest=0.
do i=ia,ib
f=(i-1)*df3
if((i.eq.ipk .or. ccfred(i).ge.3.0) .and. f.gt.fgood+10.0*df8) then
call spec9(c0,npts8,nsps,f,fpk,xdt,i1SoftSymbols)
call decode9(i1SoftSymbols,limit,nlim,msg)
print*,msg
snr=10.0*log10(ccfred(i)) - 10.0*log10(2500.0/df3) + 2.0
sync=ccfred(i) - 2.0
if(sync.lt.0.0) sync=0.0
nsync=sync
if(nsync.gt.10) nsync=10
nsnr=nint(snr)
width=0.0
if(ccfred(i).gt.sbest .and. fgood.eq.0.0) then
sbest=ccfred(i)
write(line,1010) nutc,nsync,nsnr,xdt,1000.0+fpk,width
if(nsync.gt.0) nsynced=1
endif
if(msg.ne.' ') then
write(13,1010) nutc,nsync,nsnr,xdt,1000.0+fpk,width,msg
1010 format(i4.4,i4,i5,f6.1,f8.2,f6.2,3x,a22)
write(14,1010) nutc,nsync,nsnr,xdt,1000.0+fpk,width,msg
fgood=f
nsynced=1
ndecoded=1
endif
endif
enddo
if(fgood.eq.0.0) then
write(13,1020) line
write(14,1020) line
1020 format(a33)
endif
! write(*,1010) nutc,sync,xdt,1000.0+fpk,msg
!1010 format(i4.4,3f7.1,2x,a22)
enddo
go to 999

View File

@ -7,7 +7,9 @@ subroutine spec9(c0,npts8,nsps,fpk0,fpk,xdt,i1SoftSymbols)
complex c(0:MAXFFT-1)
integer*1 i1SoftSymbolsScrambled(207)
integer*1 i1SoftSymbols(207)
integer*1 i1
integer ig(0:7)
equivalence (i1,i4)
data ig/0,1,3,2,7,6,4,5/ !Gray code removal
include 'jt9sync.f90'
save
@ -39,9 +41,6 @@ subroutine spec9(c0,npts8,nsps,fpk0,fpk,xdt,i1SoftSymbols)
call peakdt9(c1,npts8,nsps8,istart,foffset,idt)
istart=istart + 0.0625*nsps8*idt
xdt=istart/1500.0 - 1.0
! write(*,3002) 0.0625*nsps8*idt/1500.0,idf*0.1*1500.0/nsps8
!3002 format(2f8.2)
fshift=foffset
twopi=8.0*atan(1.0)
@ -71,6 +70,18 @@ subroutine spec9(c0,npts8,nsps,fpk0,fpk,xdt,i1SoftSymbols)
enddo
enddo
sum=0.
do j=1,69
smax=0.
do i=0,7
smax=max(smax,ssym(i,j))
sum=sum+ssym(i,j)
enddo
sum=sum-smax
enddo
ave=sum/(69*7)
ssym=ssym/ave
m0=3
ntones=8
k=0
@ -87,11 +98,17 @@ subroutine spec9(c0,npts8,nsps,fpk0,fpk,xdt,i1SoftSymbols)
endif
enddo
k=k+1
i1SoftSymbolsScrambled(k)=min(127,max(-127,nint(10.0*(r1-r2)))) + 128
i4=nint(10.0*(r1-r2))
if(i4.lt.-127) i4=-127
if(i4.gt.127) i4=127
i4=i4+128
i1SoftSymbolsScrambled(k)=i1
enddo
enddo
call interleave9(i1SoftSymbolsScrambled,-1,i1SoftSymbols)
call flush(81)
call flush(82)
return
end subroutine spec9

View File

@ -1,4 +1,4 @@
//-------------------------------------------------------------- MainWindow
//--------------------------------------------------------------- MainWindow
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "devsetup.h"