mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-31 13:12:30 -04:00
Several optional sync vectors.
This commit is contained in:
parent
cbb42e9cdd
commit
f263a70dd3
@ -23,7 +23,7 @@ subroutine sfox_sync(iwave,fsample,isync,f,t)
|
|||||||
ftol=20.0
|
ftol=20.0
|
||||||
ia=nint((fsync-ftol)/df)
|
ia=nint((fsync-ftol)/df)
|
||||||
ib=nint((fsync+ftol)/df)
|
ib=nint((fsync+ftol)/df)
|
||||||
lagmax=1.0/dtstep
|
lagmax=1.5/dtstep
|
||||||
lag1=-lagmax
|
lag1=-lagmax
|
||||||
lag2=lagmax
|
lag2=lagmax
|
||||||
|
|
||||||
@ -61,8 +61,6 @@ subroutine sfox_sync(iwave,fsample,isync,f,t)
|
|||||||
enddo
|
enddo
|
||||||
savg=savg/jz
|
savg=savg/jz
|
||||||
|
|
||||||
!###
|
|
||||||
|
|
||||||
ccfbest=0.
|
ccfbest=0.
|
||||||
ibest=0
|
ibest=0
|
||||||
lagpk=0
|
lagpk=0
|
||||||
@ -106,11 +104,20 @@ subroutine sfox_sync(iwave,fsample,isync,f,t)
|
|||||||
! write(*,4100) ibest,lagbest,f,dxi*df,t,dxj*dtstep
|
! write(*,4100) ibest,lagbest,f,dxi*df,t,dxj*dtstep
|
||||||
!4100 format(2i6,2f10.1,2f10.3)
|
!4100 format(2i6,2f10.1,2f10.3)
|
||||||
|
|
||||||
! print*,'aaa',ibest,lagbest
|
nsum=0
|
||||||
! do lag=lag1,lag2
|
sq=0.
|
||||||
! write(51,3051) lag*dtstep,ccf(ibest,lag)
|
do lag=lag1,lag2
|
||||||
!3051 format(2f12.4)
|
if(abs(lag-lagbest).gt.3) then
|
||||||
! enddo
|
sq=sq + ccf(ibest,lag)**2
|
||||||
|
nsum=nsum+1
|
||||||
|
endif
|
||||||
|
write(51,3051) lag*dtstep,ccf(ibest,lag)
|
||||||
|
3051 format(2f12.4)
|
||||||
|
enddo
|
||||||
|
|
||||||
|
rms=sqrt(sq/nsum)
|
||||||
|
snrsync=ccf(ibest,lagbest)/rms
|
||||||
|
! print*,'snr:',snrsync
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine sfox_sync
|
end subroutine sfox_sync
|
||||||
|
@ -13,6 +13,7 @@ program sfoxtest
|
|||||||
integer isync(44)
|
integer isync(44)
|
||||||
integer jsync(171)
|
integer jsync(171)
|
||||||
integer itone(171)
|
integer itone(171)
|
||||||
|
integer nsb(10)
|
||||||
real*4 xnoise(NMAX) !Random noise
|
real*4 xnoise(NMAX) !Random noise
|
||||||
real*4 dat(NMAX) !Generated real data
|
real*4 dat(NMAX) !Generated real data
|
||||||
complex cdat(NMAX) !Generated complex waveform
|
complex cdat(NMAX) !Generated complex waveform
|
||||||
@ -39,6 +40,8 @@ program sfoxtest
|
|||||||
116, 122, 130, 131, 134, 136, 137, 140, 146, 154, &
|
116, 122, 130, 131, 134, 136, 137, 140, 146, 154, &
|
||||||
159, 161, 163, 165/
|
159, 161, 163, 165/
|
||||||
|
|
||||||
|
data nsb/1,2,4,7,11,16,22,29,37,39/
|
||||||
|
|
||||||
nargs=iargc()
|
nargs=iargc()
|
||||||
if(nargs.ne.11) then
|
if(nargs.ne.11) then
|
||||||
print*,'Usage: sfoxtest f0 DT ITU M N K NS v hs nfiles snr'
|
print*,'Usage: sfoxtest f0 DT ITU M N K NS v hs nfiles snr'
|
||||||
@ -83,11 +86,13 @@ program sfoxtest
|
|||||||
call sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample,ns0)
|
call sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample,ns0)
|
||||||
tsync=NSYNC/fsample
|
tsync=NSYNC/fsample
|
||||||
txt=(NN+NS)*NSPS/fsample
|
txt=(NN+NS)*NSPS/fsample
|
||||||
|
nstype=nv/10
|
||||||
|
nv=mod(nv,10)
|
||||||
|
|
||||||
write(*,1000) MM,NN,KK,NSPS,baud,bw,itu,tsync,txt
|
write(*,1000) MM,NN,KK,NSPS,baud,bw,itu,tsync,txt,nstype
|
||||||
1000 format('M:',i2,' Base code: (',i3,',',i3,') NSPS:',i5, &
|
1000 format('M:',i2,' Base code: (',i3,',',i3,') NSPS:',i5, &
|
||||||
' Baud:',f7.3,' BW:',f9.3/ &
|
' Baud:',f7.3,' BW:',f9.3/ &
|
||||||
'Channel: ',a2,' Tsync:',f4.1,' TxT:',f5.1/)
|
'Channel: ',a2,' Tsync:',f4.1,' TxT:',f5.1,' SyncType:',i2/)
|
||||||
|
|
||||||
! Allocate storage for arrays that depend on code parameters.
|
! Allocate storage for arrays that depend on code parameters.
|
||||||
allocate(s3(0:NQ-1,0:NN-1))
|
allocate(s3(0:NQ-1,0:NN-1))
|
||||||
@ -103,25 +108,33 @@ program sfoxtest
|
|||||||
allocate(correct(0:NN-1))
|
allocate(correct(0:NN-1))
|
||||||
|
|
||||||
idum=-1
|
idum=-1
|
||||||
jsync=0
|
if(nstype.eq.2) then
|
||||||
jsync(1)=1
|
jsync=0
|
||||||
jsync(NDS)=1
|
jsync(1)=1
|
||||||
ms=2
|
jsync(NDS)=1
|
||||||
do i=1,100000
|
ms=2
|
||||||
j=1 + (NDS-1)*ran1(idum)
|
do i=1,100000
|
||||||
if(jsync(j).eq.0) then
|
j=1 + (NDS-1)*ran1(idum)
|
||||||
jsync(j)=1
|
if(jsync(j).eq.0) then
|
||||||
ms=ms+1
|
jsync(j)=1
|
||||||
if(ms.eq.NS) exit
|
ms=ms+1
|
||||||
endif
|
if(ms.eq.NS) exit
|
||||||
enddo
|
endif
|
||||||
j=0
|
enddo
|
||||||
do i=1,NDS
|
j=0
|
||||||
if(jsync(i).eq.1) then
|
do i=1,NDS
|
||||||
j=j+1
|
if(jsync(i).eq.1) then
|
||||||
isync(j)=i
|
j=j+1
|
||||||
endif
|
isync(j)=i
|
||||||
enddo
|
endif
|
||||||
|
enddo
|
||||||
|
else if(nstype.eq.3) then
|
||||||
|
isync(1:10)=nsb
|
||||||
|
isync(11:20)=nsb + isync(10) + 2
|
||||||
|
isync(21:30)=nsb + isync(20) + 2
|
||||||
|
isync(31:40)=nsb + isync(30) + 2
|
||||||
|
isync(41:44)=nsb(1:4) + isync(40) + 2
|
||||||
|
endif
|
||||||
|
|
||||||
rms=100.
|
rms=100.
|
||||||
baud=fsample/nsps !Keying rate, 11.719 baud for nsps=1024
|
baud=fsample/nsps !Keying rate, 11.719 baud for nsps=1024
|
||||||
|
Loading…
x
Reference in New Issue
Block a user