mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-20 02:52:00 -05:00
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:
parent
c7ee9ff304
commit
9ba06408b2
@ -21,6 +21,12 @@ subroutine decoder(ss,c0,nstandalone)
|
|||||||
common/tracer/limtrace,lu
|
common/tracer/limtrace,lu
|
||||||
save
|
save
|
||||||
|
|
||||||
|
call system_clock(iclock0,iclock_rate,iclock_max) !###
|
||||||
|
nfreqs0=0
|
||||||
|
nfreqs1=0
|
||||||
|
ndecodes0=0
|
||||||
|
ndecodes1=0
|
||||||
|
|
||||||
call timer('decoder ',0)
|
call timer('decoder ',0)
|
||||||
|
|
||||||
open(13,file='decoded.txt',status='unknown')
|
open(13,file='decoded.txt',status='unknown')
|
||||||
@ -112,11 +118,18 @@ subroutine decoder(ss,c0,nstandalone)
|
|||||||
(ccfred(i).lt.ccfred(i+1))) cycle
|
(ccfred(i).lt.ccfred(i+1))) cycle
|
||||||
if(nqd.eq.1 .or. &
|
if(nqd.eq.1 .or. &
|
||||||
(ccfred(i).ge.ccflim .and. abs(f-fgood).gt.10.0*df8)) then
|
(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)
|
call timer('softsym ',0)
|
||||||
fpk=1000.0 + df3*(i-1)
|
fpk=1000.0 + df3*(i-1)
|
||||||
c1(1:npts8)=conjg(c0(1:npts8))
|
! c1(1:npts8)=conjg(c0(1:npts8))
|
||||||
call softsym(c1,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
|
! call softsym(c1,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
|
||||||
i1SoftSymbols)
|
! i1SoftSymbols)
|
||||||
|
call softsym(c0,npts8,nsps8,newdat,fpk,syncpk,snrdb,xdt,freq, &
|
||||||
|
drift,i1SoftSymbols)
|
||||||
|
|
||||||
call timer('softsym ',1)
|
call timer('softsym ',1)
|
||||||
|
|
||||||
call timer('decode9 ',0)
|
call timer('decode9 ',0)
|
||||||
@ -129,11 +142,19 @@ subroutine decoder(ss,c0,nstandalone)
|
|||||||
if(nsync.gt.10) nsync=10
|
if(nsync.gt.10) nsync=10
|
||||||
nsnr=nint(snrdb)
|
nsnr=nint(snrdb)
|
||||||
ndrift=nint(drift/df3)
|
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(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(*,fmt) nutc,nsync,nsnr,xdt,freq,ndrift,msg
|
||||||
write(13,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
|
! 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)
|
!1014 format(i4.4,i4,i5,f6.1,f8.0,i4,f9.1,i9,3x,a22)
|
||||||
|
|
||||||
iaa=max(1,i-3)
|
iaa=max(1,i-3)
|
||||||
ibb=min(NSMAX,i+11)
|
ibb=min(NSMAX,i+11)
|
||||||
fgood=f
|
fgood=f
|
||||||
@ -158,5 +179,12 @@ subroutine decoder(ss,c0,nstandalone)
|
|||||||
call timer('decoder ',1)
|
call timer('decoder ',1)
|
||||||
if(nstandalone.eq.0) call timer('decoder ',101)
|
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
|
return
|
||||||
end subroutine decoder
|
end subroutine decoder
|
||||||
|
@ -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
|
!Downsample to nspsd samples per symbol, info centered at fpk
|
||||||
|
|
||||||
@ -7,28 +7,35 @@ subroutine downsam9(c0,npts8,nsps8,nspsd,fpk,c2,nz2)
|
|||||||
complex c1(0:NMAX-1)
|
complex c1(0:NMAX-1)
|
||||||
complex c2(0:4096-1)
|
complex c2(0:4096-1)
|
||||||
real s(1000)
|
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
|
nfft1=128*nsps8 !Forward FFT length
|
||||||
nh1=nfft1/2
|
nh1=nfft1/2
|
||||||
df1=1500.0/nfft1
|
df1=1500.0/nfft1
|
||||||
call four2a(c1,nfft1,1,-1,1) !Forward FFT
|
|
||||||
|
|
||||||
nadd=1.0/df1
|
if(newdat.eq.1) then
|
||||||
j=250/df1
|
fac=1.e-4
|
||||||
s=0.
|
do i=0,npts8-1,2
|
||||||
do i=1,1000
|
c1(i)=fac*conjg(c0(i))
|
||||||
do n=1,nadd
|
c1(i+1)=-fac*conjg(c0(i+1))
|
||||||
j=j+1
|
|
||||||
s(i)=s(i)+real(c1(j))**2 + aimag(c1(j))**2
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
c1(npts8:)=0. !Zero the rest of c1
|
||||||
call pctile(s,1000,40,avenoise)
|
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
|
ndown=nsps8/16 !Downsample factor
|
||||||
nfft2=nfft1/ndown !Backward FFT length
|
nfft2=nfft1/ndown !Backward FFT length
|
||||||
|
@ -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)
|
i1SoftSymbols)
|
||||||
|
|
||||||
! Compute the soft symbols
|
! Compute the soft symbols
|
||||||
@ -16,7 +16,7 @@ subroutine softsym(c0,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
|
|||||||
ndown=nsps8/nspsd
|
ndown=nsps8/nspsd
|
||||||
|
|
||||||
! Mix, low-pass filter, and downsample to 16 samples per symbol
|
! 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
|
call peakdt9(c2,nz2,nsps8,nspsd,c3,nz3,xdt) !Find DT
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//---------------------------------------------------------------- MainWindow
|
//--------------------------------------------------------------- MainWindow
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "devsetup.h"
|
#include "devsetup.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user