Updates to test progs.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7655 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-04-27 19:06:57 +00:00
parent 34b30ed664
commit ffa55cc1dd
4 changed files with 35 additions and 19 deletions

View File

@ -23,8 +23,8 @@ subroutine cpolyfitw(c,pp,id,maxn,aa,bb,zz,nhardsync)
x(n)=float(ia+ib)/NZ - 1.0
yi(n)=real(zz(j))*0.5*id(j)
yq(n)=aimag(zz(j))*0.5*id(j)
write(54,1225) n,x(n),yi(n),yq(n)
1225 format(i5,3f12.4)
! write(54,1225) n,x(n),yi(n),yq(n)
!1225 format(i5,3f12.4)
endif
if(j.lt.jz) then
zz(j+jz)=sum(pp*c(ia+NSPS:ib+NSPS))/NSPS

View File

@ -15,7 +15,7 @@ subroutine genwspr5(msg,ichk,msgsent,itone,itype)
integer jd(NS+ND)
integer isync(48) !Long sync vector
integer ib13(13) !Barker 13 code
integer itone(NN)
integer itone(NZ)
integer*8 n8
data ib13/1,1,1,1,1,-1,-1,1,1,-1,1,-1,1/
data first/.true./
@ -96,12 +96,12 @@ subroutine genwspr5(msg,ichk,msgsent,itone,itype)
jd(2*j)=id(j+jz)/abs(id(j+jz))
enddo
jd(NS+ND)=id(jz)/abs(id(jz))
itone=0
itone=0
do j=1,jz-1
itone(2*j-1)=(jd(2*j)*jd(2*j-1)+1)/2;
itone(2*j)=-(jd(2*j)*jd(2*j+1)-1)/2;
itone(2*j+1)=(jd(2*j)*jd(2*j-1)+1)/2;
itone(2*j+2)=-(jd(2*j)*jd(2*j+1)-1)/2;
enddo
itone(NS+ND)=jd(NS+ND) !### Is this correct ??? ###
itone(NS+ND+2)=jd(NS+ND) !### Is this correct ??? ###
return
end subroutine genwspr5

View File

@ -38,7 +38,6 @@ program wspr5d
nargs=iargc()
if(nargs.ne.1) then
print*,'Usage: wspr5d maxn'
! print*,'Example: wsprlfsim 0 0 0 5 10 -20'
go to 999
endif
call getarg(1,arg)
@ -62,7 +61,7 @@ program wspr5d
n8=n8/2
enddo
! Defind array id() for sync symbols
! Define array id() for sync symbols
id=0
do j=1,48 !First group of 48
id(2*j-1)=2*isync(j)
@ -74,11 +73,20 @@ program wspr5d
id(2*j+109)=2*isync(j)
enddo
csync=0.
do j=1,205
if(abs(id(j)).eq.2) then
ia=nint((j-0.5)*N2)
ib=ia+N2-1
csync(ia:ib)=pp*id(j)/abs(id(j))
endif
enddo
do ifile=1,9999
read(10,end=999) c
! do i=0,NZ-1
! write(40,4001) i,c(i)
!4001 format(i8,2f10.6)
! write(40,4001) i,c(i),csync(i)
!4001 format(i8,4f12.6)
! enddo
call getfc1w(c,fs,fc1) !First approx for freq
call getfc2w(c,csync,fs,fc1,fc2,fc3) !Refined freq
@ -112,8 +120,11 @@ program wspr5d
amax=abs(z)
jpk=j
endif
! write(45,4501) j,j/fs,abs(z)
!4501 format(i8,2f12.3)
enddo
xdt=jpk/fs
! print*,fc1,fc1+fc2,xdt,amax
!-----------------------------------------------------------------
nterms=maxn
@ -155,8 +166,8 @@ program wspr5d
idat(7)=ishft(idat(7),6)
call wqdecode(idat,message,itype)
endif
write(*,1110) nsnr,xdt,fc1+fc2,message
1110 format(i4,f7.2,f7.2,2x,a22)
write(*,1110) ifile,nsnr,xdt,fc1+fc2,message
1110 format(2i5,f7.2,f7.2,2x,a22)
enddo
999 end program wspr5d

View File

@ -5,7 +5,7 @@ program wspr5sim
character*22 msg,msgsent
complex c0(0:NZ-1)
complex c(0:NZ-1)
integer itone(NN)
integer itone(NZ)
! Get command-line argument(s)
nargs=iargc()
@ -23,10 +23,15 @@ program wspr5sim
read(arg,*) nfiles
call getarg(5,arg)
read(arg,*) snrdb
call genwspr5(msg,ichk,msgsent,itone,itype)
write(*,1000) f0,xdt,snr,nfiles,msgsent
1000 format('f0:',f9.3,' DT:',f6.2,' SNR:',f6.1,' nfiles:',i3,2x,a22)
write(*,1234) itone(1:20)
1234 format(20i3)
txt=NN*NSPS0/12000.0
write(*,1000) f0,xdt,txt,snrdb,nfiles,msgsent
1000 format('f0:',f9.3,' DT:',f6.2,' txt:',f6.1,' SNR:',f6.1, &
' nfiles:',i3,2x,a22)
twopi=8.0*atan(1.0)
fs=NSPS*12000.0/NSPS0 !Sample rate
@ -44,7 +49,6 @@ program wspr5sim
phi=0.d0
c0=0.
k=-1
k=k+N2
do j=1,NN
dphi=dphi0
if(itone(j).eq.1) dphi=dphi1
@ -54,8 +58,9 @@ program wspr5sim
phi=phi+dphi
if(phi.gt.twopi) phi=phi-twopi
xphi=phi
if(k.ge.NZ) exit !### FIX THIS ###
c0(k)=cmplx(cos(xphi),sin(xphi))
! write(39,3039) k,-c0(k)
!3039 format(i8,2f12.6)
enddo
enddo
c0=sig*c0 !Scale to requested sig level