ft8d/ft8d.f90

69 lines
1.9 KiB
Fortran
Raw Normal View History

2018-03-24 07:20:34 -04:00
program ft8d
! Decode FT8 data read from *.c2 files.
2018-03-24 07:20:34 -04:00
include 'ft8_params.f90'
2018-10-20 05:12:27 -04:00
character infile*80,date*6,time*4
2018-10-18 08:34:24 -04:00
character msgcall*6,msggrid*4
2018-04-01 11:36:02 -04:00
real s(NFFT1,NHSYM)
real sbase(NFFT1)
real candidate(3,200)
2018-04-01 11:36:02 -04:00
real*8 dialfreq
complex dd(NMAX,4)
2018-04-19 16:09:02 -04:00
logical newdat
integer apsym(KK)
2018-03-24 07:20:34 -04:00
nargs=iargc()
if(nargs.ne.1) then
print*,'Usage: ft8d file'
2018-03-24 12:06:33 -04:00
go to 999
2018-03-24 07:20:34 -04:00
endif
twopi=8.0*atan(1.0)
2018-04-01 16:08:21 -04:00
fs=4000.0 !Sample rate
2018-03-24 07:20:34 -04:00
dt=1.0/fs !Sample interval (s)
tt=NSPS*dt !Duration of "itone" symbols (s)
ts=2*NSPS*dt !Duration of OQPSK symbols (s)
baud=1.0/tt !Keying rate (baud)
txt=NZ*dt !Transmission length (s)
2018-04-01 16:08:21 -04:00
nfa=-1600
nfb=+1600
2018-04-01 11:36:02 -04:00
nfqso=0
2018-03-24 07:20:34 -04:00
call getarg(1,infile)
open(10,file=infile,status='old',access='stream')
read(10,end=999) dialfreq,dd
close(10)
j2=index(infile,'.c2')
date=infile(j2-11:j2-6)
time=infile(j2-4:j2-1)
do ipart=1,4
2018-03-24 12:06:33 -04:00
ndecodes=0
2018-03-26 02:37:27 -04:00
ndepth=1
newdat=.true.
syncmin=1.5
call sync8(dd(1:NMAX,ipart),nfa+2000,nfb+2000,syncmin, &
2018-10-23 03:16:50 -04:00
nfqso+2000,200,s,candidate,ncand,sbase)
do icand=1,ncand
sync=candidate(3,icand)
f1=candidate(1,icand)
xdt=candidate(2,icand)
xbase=10.0**(0.1*(sbase(nint(f1/3.125))-40.0))
call ft8b(dd(1:NMAX,ipart),newdat,nQSOProgress,nfqso+2000, &
nftx,ndepth,lft8apon,lapcqonly,napwid,nagain,iaptype, &
f1,xdt,xbase,apsym,nharderrors,dmin,nbadcrc,iappass, &
2018-04-19 16:09:02 -04:00
msgcall,msggrid,xsnr)
nsnr=nint(xsnr)
xdt=xdt-0.5
hd=nharderrors+dmin
2018-04-19 16:09:02 -04:00
if(nbadcrc.eq.0) then
2018-10-20 05:12:27 -04:00
write(*,1004) date,time,15*(ipart-1),min(sync,999.0),nint(xsnr), &
2018-04-19 16:09:02 -04:00
xdt,nint(f1-2000+dialfreq),msgcall,msggrid
2018-10-20 05:12:27 -04:00
1004 format(a6,1x,a4,i2.2,f6.1,i4,f6.2,i9,1x,a6,1x,a4)
2018-03-24 12:06:33 -04:00
endif
enddo
enddo ! ipart loop
2018-03-24 07:20:34 -04:00
999 end program ft8d