Add Watterson channel model to wspr5sim. Fix up processing of c5 files in wspr5d.f90.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7696 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2017-05-25 16:24:57 +00:00
parent 2517106629
commit a5054c7d5d
3 changed files with 17 additions and 10 deletions

View File

@ -110,6 +110,7 @@ program wspr5d
if(j1.gt.0) then if(j1.gt.0) then
read(10,end=999) fname,ntrmin,fMHz,c read(10,end=999) fname,ntrmin,fMHz,c
read(fname(8:11),*) nutc read(fname(8:11),*) nutc
write(datetime,'(i11)') nutc
else if(j2.gt.0) then else if(j2.gt.0) then
read(10,end=999) ihdr,iwave read(10,end=999) ihdr,iwave
read(infile(j2-4:j2-1),*) nutc read(infile(j2-4:j2-1),*) nutc

View File

@ -99,6 +99,7 @@ program wspr5d
if(j1.gt.0) then if(j1.gt.0) then
read(10,end=999) fname,ntrmin,fMHz,c read(10,end=999) fname,ntrmin,fMHz,c
read(fname(8:11),*) nutc read(fname(8:11),*) nutc
write(datetime,'(i11)') nutc
else if(j2.gt.0) then else if(j2.gt.0) then
read(10,end=999) ihdr,iwave read(10,end=999) ihdr,iwave
read(infile(j2-4:j2-1),*) nutc read(infile(j2-4:j2-1),*) nutc
@ -118,7 +119,7 @@ program wspr5d
!write(*,*) fc1+fc2 !write(*,*) fc1+fc2
call downsample(c,fc1+fc2,cd) call downsample(c,fc1+fc2,cd)
do ncoh=0,1 do ncoh=1,0,-1
do is=0,9 do is=0,9
idt=is/2 idt=is/2
if( mod(is,2).eq. 1 ) idt=-is/2 if( mod(is,2).eq. 1 ) idt=-is/2
@ -140,9 +141,6 @@ program wspr5d
sbits(i+3)=r1 sbits(i+3)=r1
enddo enddo
! ebits=hbits(1:411)
! isum=sum(id(1:205)*(2*ebits(1:409:2)-1))/2
!write(*,*) is,isum
j=1 j=1
do i=1,205 do i=1,205
if( abs(id(i)) .ne. 2 ) then if( abs(id(i)) .ne. 2 ) then
@ -248,7 +246,6 @@ do idf=0,idfmax
cmbest=cm cmbest=cm
endif endif
enddo enddo
!write(*,'(f10.3)') fbest
end subroutine mskseqdet end subroutine mskseqdet
subroutine downsample(ci,f0,co) subroutine downsample(ci,f0,co)

View File

@ -17,9 +17,9 @@ program wspr5sim
! Get command-line argument(s) ! Get command-line argument(s)
nargs=iargc() nargs=iargc()
if(nargs.ne.6) then if(nargs.ne.8) then
print*,'Usage: wspr5sim "message" f0 DT nwav nfiles snr' print*,'Usage: wspr5sim "message" f0 DT fsp del nwav nfiles snr'
print*,'Example: wspr5sim "K1ABC FN42 30" 50 0.0 0 10 -33' print*,'Example: wspr5sim "K1ABC FN42 30" 50 0.0 0.1 1.0 1 10 -33'
go to 999 go to 999
endif endif
call getarg(1,msg) !Message to be transmitted call getarg(1,msg) !Message to be transmitted
@ -28,10 +28,14 @@ program wspr5sim
call getarg(3,arg) call getarg(3,arg)
read(arg,*) xdt !Time offset from nominal (s) read(arg,*) xdt !Time offset from nominal (s)
call getarg(4,arg) call getarg(4,arg)
read(arg,*) nwav !1 for *.wav file, 0 for *.c5 file read(arg,*) fspread !Watterson frequency spread (Hz)
call getarg(5,arg) call getarg(5,arg)
read(arg,*) nfiles !Number of files read(arg,*) delay !Watterson delay (ms)
call getarg(6,arg) call getarg(6,arg)
read(arg,*) nwav !1 for *.wav file, 0 for *.c5 file
call getarg(7,arg)
read(arg,*) nfiles !Number of files
call getarg(8,arg)
read(arg,*) snrdb !SNR_2500 read(arg,*) snrdb !SNR_2500
twopi=8.0*atan(1.0) twopi=8.0*atan(1.0)
@ -68,6 +72,11 @@ program wspr5sim
if(k.ge.0 .and. k.lt.NZ) c0(k)=cmplx(cos(xphi),sin(xphi)) if(k.ge.0 .and. k.lt.NZ) c0(k)=cmplx(cos(xphi),sin(xphi))
enddo enddo
enddo enddo
if( fspread .ne. 0.0 .or. delay .ne. 0.0 ) then
call watterson(c0,NZ,fs,delay,fspread)
endif
c0=sig*c0 !Scale to requested sig level c0=sig*c0 !Scale to requested sig level
do ifile=1,nfiles do ifile=1,nfiles