2012-07-17 15:31:01 -04:00
|
|
|
program msk
|
|
|
|
|
2012-07-19 14:01:14 -04:00
|
|
|
! Program to test decoding routines for mode JTMSK.
|
2012-07-17 15:31:01 -04:00
|
|
|
|
|
|
|
parameter (NSMAX=30*48000)
|
|
|
|
character*80 infile
|
|
|
|
character*6 cfile6
|
|
|
|
character*12 arg
|
2012-07-19 14:01:14 -04:00
|
|
|
character*12 mycall
|
2012-07-17 15:31:01 -04:00
|
|
|
real dat(NSMAX)
|
|
|
|
real x(NSMAX)
|
|
|
|
complex cx(0:NSMAX/2)
|
|
|
|
integer hdr(11)
|
|
|
|
integer*2 id
|
|
|
|
common/mscom/id(NSMAX),s1(215,703),s2(215,703)
|
|
|
|
|
|
|
|
nargs=iargc()
|
2012-07-19 14:01:14 -04:00
|
|
|
if(nargs.lt.2) then
|
|
|
|
print*,'Usage: msk nslow snr'
|
2012-07-17 15:31:01 -04:00
|
|
|
go to 999
|
|
|
|
endif
|
|
|
|
call getarg(1,arg)
|
2012-07-19 14:01:14 -04:00
|
|
|
read(arg,*) nslow
|
|
|
|
call getarg(2,arg)
|
2012-07-17 15:31:01 -04:00
|
|
|
read(arg,*) snr
|
|
|
|
|
2012-07-19 14:01:14 -04:00
|
|
|
! Read simulated pings from a file
|
2012-07-17 15:31:01 -04:00
|
|
|
open(71,file='dat.71',form='unformatted',status='old')
|
|
|
|
read(71) id
|
|
|
|
|
2012-07-19 14:01:14 -04:00
|
|
|
cfile6='123400'
|
2012-07-17 15:31:01 -04:00
|
|
|
npts=30*48000
|
|
|
|
kstep=2048
|
2012-07-19 14:01:14 -04:00
|
|
|
minsigdb=1
|
2012-07-17 15:31:01 -04:00
|
|
|
mousedf=0
|
|
|
|
ntol=200
|
2012-07-19 14:01:14 -04:00
|
|
|
mycall='W8WN'
|
2012-07-17 15:31:01 -04:00
|
|
|
|
2012-07-19 14:01:14 -04:00
|
|
|
! Make some band-limited noise.
|
2012-07-17 15:31:01 -04:00
|
|
|
call random_number(x)
|
|
|
|
nfft=NSMAX
|
|
|
|
call four2a(x,nfft,1,-1,0)
|
|
|
|
df=48000.0/nfft
|
|
|
|
ia=nint(300.0/df)
|
2012-07-19 14:01:14 -04:00
|
|
|
ib=nint(2700.0/df)
|
2012-07-17 15:31:01 -04:00
|
|
|
cx(:ia)=0.
|
|
|
|
cx(ib:)=0.
|
|
|
|
call four2a(cx,nfft,1,1,-1)
|
|
|
|
x(1)=0.
|
2012-07-19 14:01:14 -04:00
|
|
|
rms=sqrt(dot_product(x,x)/NSMAX)
|
2012-07-17 15:31:01 -04:00
|
|
|
x=x/rms
|
|
|
|
|
2012-07-19 14:01:14 -04:00
|
|
|
sig=(10.0**(0.05*snr))/32768.0 !Scaled signal strength
|
|
|
|
dat=sig*id + x !Add pings to noise
|
|
|
|
|
|
|
|
! This loop simulates being called from "datasink()" in program JTMSK.
|
2012-07-17 15:31:01 -04:00
|
|
|
do iblk=1,npts/kstep
|
2012-07-19 14:01:14 -04:00
|
|
|
k=iblk*kstep
|
|
|
|
call rtping(dat,k,cfile6,MinSigdB,MouseDF,ntol,mycall)
|
|
|
|
if(nslow.ne.0) call usleep(42000)
|
2012-07-17 15:31:01 -04:00
|
|
|
enddo
|
|
|
|
|
|
|
|
999 end program msk
|