Add frequency drift (Hz/min) option to jt65sim.

This commit is contained in:
Steve Franke 2018-12-01 09:17:58 -06:00
parent 6bb1e6ac22
commit 42d68ff84e

View File

@ -21,12 +21,13 @@ program jt65sim
character msg*22,fname*11,csubmode*1,c,optarg*500,numbuf*32 character msg*22,fname*11,csubmode*1,c,optarg*500,numbuf*32
! character call1*5,call2*5 ! character call1*5,call2*5
logical :: display_help=.false.,seed_prngs=.true. logical :: display_help=.false.,seed_prngs=.true.
type (option) :: long_options(12) = [ & type (option) :: long_options(13) = [ &
option ('help',.false.,'h','Display this help message',''), & option ('help',.false.,'h','Display this help message',''), &
option ('sub-mode',.true.,'m','sub mode, default MODE=A','MODE'), & option ('sub-mode',.true.,'m','sub mode, default MODE=A','MODE'), &
option ('num-sigs',.true.,'n','number of signals per file, default SIGNALS=10','SIGNALS'), & option ('num-sigs',.true.,'n','number of signals per file, default SIGNALS=10','SIGNALS'), &
option ('f0',.true.,'F','base frequency offset, default F0=1500.0','F0'), & option ('f0',.true.,'F','base frequency offset, default F0=1500.0','F0'), &
option ('doppler-spread',.true.,'d','Doppler spread, default SPREAD=0.0','SPREAD'), & option ('doppler-spread',.true.,'d','Doppler spread, default SPREAD=0.0','SPREAD'), &
option ('drift per min',.true.,'D','Frequency drift (Hz/min), default DRIFT=0.0','DRIFT'), &
option ('time-offset',.true.,'t','Time delta, default SECONDS=0.0','SECONDS'), & option ('time-offset',.true.,'t','Time delta, default SECONDS=0.0','SECONDS'), &
option ('num-files',.true.,'f','Number of files to generate, default FILES=1','FILES'), & option ('num-files',.true.,'f','Number of files to generate, default FILES=1','FILES'), &
option ('no-prng-seed',.false.,'p','Do not seed PRNGs (use for reproducible tests)',''), & option ('no-prng-seed',.false.,'p','Do not seed PRNGs (use for reproducible tests)',''), &
@ -50,6 +51,7 @@ program jt65sim
nsigs=10 nsigs=10
bf0=1500. bf0=1500.
fspread=0. fspread=0.
drift=0.
xdt=0. xdt=0.
snrdb=0. snrdb=0.
nfiles=1 nfiles=1
@ -58,7 +60,7 @@ program jt65sim
msg="K1ABC W9XYZ EN37" msg="K1ABC W9XYZ EN37"
do do
call getopt('hm:n:F:d:t:f:ps:SG:M:',long_options,c,optarg,narglen,nstat,noffset,nremain,.true.) call getopt('hm:n:F:d:D:t:f:ps:SG:M:',long_options,c,optarg,narglen,nstat,noffset,nremain,.true.)
if( nstat .ne. 0 ) then if( nstat .ne. 0 ) then
exit exit
end if end if
@ -76,6 +78,8 @@ program jt65sim
read (optarg(:narglen), *,err=10) bf0 read (optarg(:narglen), *,err=10) bf0
case ('d') case ('d')
read (optarg(:narglen), *,err=10) fspread read (optarg(:narglen), *,err=10) fspread
case ('D')
read (optarg(:narglen), *,err=10) drift
case ('t') case ('t')
read (optarg(:narglen), *) numbuf read (optarg(:narglen), *) numbuf
if (numbuf(1:1) == '\') then !'\' if (numbuf(1:1) == '\') then !'\'
@ -217,11 +221,8 @@ program jt65sim
do i=1,npts !Add this signal into cdat() do i=1,npts !Add this signal into cdat()
isym=floor(i/sps)+1 isym=floor(i/sps)+1
if(isym.gt.nsym) exit if(isym.gt.nsym) exit
if(isym.ne.isym0) then freq=f0 + (drift/60.0)*(i-npts/2)*dt + itone(isym)*baud*mode65
freq=f0 + itone(isym)*baud*mode65
dphi=twopi*freq*dt dphi=twopi*freq*dt
isym0=isym
endif
phi=phi + dphi phi=phi + dphi
if(phi.gt.twopi) phi=phi-twopi if(phi.gt.twopi) phi=phi-twopi
xphi=phi xphi=phi