2019-01-25 17:01:34 -05:00
|
|
|
program ft4d
|
|
|
|
|
|
|
|
include 'ft4_params.f90'
|
|
|
|
|
2019-01-26 12:42:07 -05:00
|
|
|
character*8 arg
|
|
|
|
character*17 cdatetime
|
|
|
|
character*120 data_dir
|
|
|
|
character*11 datetime
|
|
|
|
character*37 decodes(100)
|
|
|
|
character*16 fname
|
|
|
|
character*6 hiscall
|
|
|
|
character*80 infile
|
|
|
|
character*61 line
|
|
|
|
character*6 mycall
|
|
|
|
|
2019-01-25 17:01:34 -05:00
|
|
|
real*8 fMHz
|
2019-01-26 12:42:07 -05:00
|
|
|
|
2019-01-25 17:01:34 -05:00
|
|
|
integer ihdr(11)
|
|
|
|
integer*2 iwave(NMAX) !Generated full-length waveform
|
|
|
|
|
|
|
|
fs=12000.0/NDOWN !Sample rate
|
|
|
|
dt=1/fs !Sample interval after downsample (s)
|
|
|
|
tt=NSPS*dt !Duration of "itone" symbols (s)
|
|
|
|
baud=1.0/tt !Keying rate for "itone" symbols (baud)
|
|
|
|
txt=NZ*dt !Transmission length (s)
|
|
|
|
|
|
|
|
nargs=iargc()
|
|
|
|
if(nargs.lt.1) then
|
|
|
|
print*,'Usage: ft4d [-a <data_dir>] [-f fMHz] file1 [file2 ...]'
|
|
|
|
go to 999
|
|
|
|
endif
|
|
|
|
iarg=1
|
|
|
|
data_dir="."
|
|
|
|
call getarg(iarg,arg)
|
|
|
|
if(arg(1:2).eq.'-a') then
|
|
|
|
call getarg(iarg+1,data_dir)
|
|
|
|
iarg=iarg+2
|
|
|
|
endif
|
|
|
|
call getarg(iarg,arg)
|
|
|
|
if(arg(1:2).eq.'-f') then
|
|
|
|
call getarg(iarg+1,arg)
|
|
|
|
read(arg,*) fMHz
|
|
|
|
iarg=iarg+2
|
|
|
|
endif
|
|
|
|
ncoh=1
|
|
|
|
|
|
|
|
do ifile=iarg,nargs
|
|
|
|
call getarg(ifile,infile)
|
|
|
|
j2=index(infile,'.wav')
|
|
|
|
open(10,file=infile,status='old',access='stream')
|
|
|
|
read(10,end=999) ihdr,iwave
|
|
|
|
read(infile(j2-4:j2-1),*) nutc
|
|
|
|
datetime=infile(j2-11:j2-1)
|
2019-01-26 12:42:07 -05:00
|
|
|
cdatetime=' '//datetime
|
2019-01-25 17:01:34 -05:00
|
|
|
close(10)
|
|
|
|
|
2019-01-26 12:42:07 -05:00
|
|
|
call ft4_decode(cdatetime,nfqso,iwave,ndecodes,mycall,hiscall,nrx,line)
|
|
|
|
if(ndecodes.ge.1) write(*,'(a61)') line
|
2019-01-25 17:01:34 -05:00
|
|
|
enddo !files
|
|
|
|
|
|
|
|
write(*,1120)
|
|
|
|
1120 format("<DecodeFinished>")
|
|
|
|
|
|
|
|
999 end program ft4d
|
|
|
|
|
|
|
|
|