Temporary code, to aid with a series of tests of the JT9 decoder.

This commit will serve as a benchmark for comparison with new code to
be written.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3266 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-05-14 14:29:01 +00:00
parent e00dd5fdb0
commit f1d6248c46
4 changed files with 59 additions and 24 deletions

View File

@ -21,6 +21,12 @@ subroutine decoder(ss,c0,nstandalone)
common/tracer/limtrace,lu
save
call system_clock(iclock0,iclock_rate,iclock_max) !###
nfreqs0=0
nfreqs1=0
ndecodes0=0
ndecodes1=0
call timer('decoder ',0)
open(13,file='decoded.txt',status='unknown')
@ -112,11 +118,18 @@ subroutine decoder(ss,c0,nstandalone)
(ccfred(i).lt.ccfred(i+1))) cycle
if(nqd.eq.1 .or. &
(ccfred(i).ge.ccflim .and. abs(f-fgood).gt.10.0*df8)) then
if(nqd.eq.0) nfreqs0=nfreqs0+1
if(nqd.eq.1) nfreqs1=nfreqs1+1
call timer('softsym ',0)
fpk=1000.0 + df3*(i-1)
c1(1:npts8)=conjg(c0(1:npts8))
call softsym(c1,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
i1SoftSymbols)
! c1(1:npts8)=conjg(c0(1:npts8))
! call softsym(c1,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
! i1SoftSymbols)
call softsym(c0,npts8,nsps8,newdat,fpk,syncpk,snrdb,xdt,freq, &
drift,i1SoftSymbols)
call timer('softsym ',1)
call timer('decode9 ',0)
@ -129,11 +142,19 @@ subroutine decoder(ss,c0,nstandalone)
if(nsync.gt.10) nsync=10
nsnr=nint(snrdb)
ndrift=nint(drift/df3)
write(38,3002) nutc,freq,ccfred(i),nlim,msg
3002 format(i4.4,2f8.1,i9,2x,a22)
if(msg.ne.' ') then
if(nqd.eq.0) ndecodes0=ndecodes0+1
if(nqd.eq.1) ndecodes1=ndecodes1+1
write(*,fmt) nutc,nsync,nsnr,xdt,freq,ndrift,msg
write(13,fmt) nutc,nsync,nsnr,xdt,freq,ndrift,msg
! write(14,1014) nutc,nsync,nsnr,xdt,freq,ndrift,ccfred(i),nlim,msg
!1014 format(i4.4,i4,i5,f6.1,f8.0,i4,f9.1,i9,3x,a22)
iaa=max(1,i-3)
ibb=min(NSMAX,i+11)
fgood=f
@ -158,5 +179,12 @@ subroutine decoder(ss,c0,nstandalone)
call timer('decoder ',1)
if(nstandalone.eq.0) call timer('decoder ',101)
call system_clock(iclock,iclock_rate,iclock_max)
write(39,3001) nutc,nfreqs1,nfreqs0,ndecodes1,ndecodes0, &
float(iclock-iclock0)/iclock_rate
3001 format(5i8,f10.3)
call flush(38)
call flush(39)
return
end subroutine decoder

View File

@ -1,4 +1,4 @@
subroutine downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2)
subroutine downsam9(c0,npts8,nsps8,newdat,nspsd,fpk,c2,nz2)
!Downsample to nspsd samples per symbol, info centered at fpk
@ -7,29 +7,36 @@ subroutine downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2)
complex c1(0:NMAX-1)
complex c2(0:4096-1)
real s(1000)
save
fac=1.e-4
c1(0:npts8-1)=fac*c0 !Copy c0 into c1
do i=1,npts8-1,2
c1(i)=-c1(i)
enddo
c1(npts8:)=0. !Zero the rest of c1
nfft1=128*nsps8 !Forward FFT length
nh1=nfft1/2
df1=1500.0/nfft1
call four2a(c1,nfft1,1,-1,1) !Forward FFT
nadd=1.0/df1
j=250/df1
s=0.
do i=1,1000
do n=1,nadd
j=j+1
s(i)=s(i)+real(c1(j))**2 + aimag(c1(j))**2
if(newdat.eq.1) then
fac=1.e-4
do i=0,npts8-1,2
c1(i)=fac*conjg(c0(i))
c1(i+1)=-fac*conjg(c0(i+1))
enddo
enddo
call pctile(s,1000,40,avenoise)
c1(npts8:)=0. !Zero the rest of c1
call four2a(c1,nfft1,1,-1,1) !Forward FFT
nadd=1.0/df1
j=250/df1
s=0.
do i=1,1000
do n=1,nadd
j=j+1
s(i)=s(i)+real(c1(j))**2 + aimag(c1(j))**2
enddo
! write(37,3001) i+1000,s(i),db(s(i)),nadd
!3001 format(i5,2f12.3,i8)
enddo
call pctile(s,1000,40,avenoise)
newdat=0
endif
ndown=nsps8/16 !Downsample factor
nfft2=nfft1/ndown !Backward FFT length
nh2=nfft2/2

View File

@ -1,4 +1,4 @@
subroutine softsym(c0,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
subroutine softsym(c0,npts8,nsps8,newdat,fpk,syncpk,snrdb,xdt,freq,drift, &
i1SoftSymbols)
! Compute the soft symbols
@ -16,7 +16,7 @@ subroutine softsym(c0,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
ndown=nsps8/nspsd
! Mix, low-pass filter, and downsample to 16 samples per symbol
call downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2)
call downsam9(c0,npts8,nsps8,newdat,nspsd,fpk,c2,nz2)
call peakdt9(c2,nz2,nsps8,nspsd,c3,nz3,xdt) !Find DT

View File

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