Changes to test programs.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7652 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-04-25 17:43:05 +00:00
parent 9b54cb4d12
commit cf0902ab92
3 changed files with 30 additions and 12 deletions

View File

@ -865,7 +865,7 @@ if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
endif (CMAKE_OSX_SYSROOT) endif (CMAKE_OSX_SYSROOT)
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -funroll-all-loops -fno-f2c ${General_FFLAGS}") set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fbounds-check -funroll-all-loops -fno-f2c ${General_FFLAGS}")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check -fno-f2c ${General_FFLAGS}") set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check -fno-f2c ${General_FFLAGS}")
elseif (Fortran_COMPILER_NAME MATCHES "ifort.*") elseif (Fortran_COMPILER_NAME MATCHES "ifort.*")
# ifort (untested) # ifort (untested)

View File

@ -1,4 +1,4 @@
subroutine genwsprlf(msgbits,id,icw,cbb,csync) subroutine genwsprlf(msgbits,id,icw,cbb,csync,itone)
!Encode a WSPR-LF message, produce baseband waveform and sync vector. !Encode a WSPR-LF message, produce baseband waveform and sync vector.
@ -6,7 +6,7 @@ subroutine genwsprlf(msgbits,id,icw,cbb,csync)
parameter (ND=300) !Data symbols: LDPC (300,60), r=1/5 parameter (ND=300) !Data symbols: LDPC (300,60), r=1/5
parameter (NS=109) !Sync symbols (2 x 48 + Barker 13) parameter (NS=109) !Sync symbols (2 x 48 + Barker 13)
parameter (NR=3) !Ramp up/down (2 x half-length symbols) parameter (NR=3) !Ramp up/down (2 x half-length symbols)
parameter (NN=NR+NS+ND) !Total symbols (410) parameter (NN=NR+NS+ND) !Total symbols (412)
parameter (NSPS=16) !Samples per MSK symbol (16) parameter (NSPS=16) !Samples per MSK symbol (16)
parameter (N2=2*NSPS) !Samples per OQPSK symbol (32) parameter (N2=2*NSPS) !Samples per OQPSK symbol (32)
parameter (N13=13*N2) !Samples in central sync vector (416) parameter (N13=13*N2) !Samples in central sync vector (416)
@ -22,8 +22,10 @@ subroutine genwsprlf(msgbits,id,icw,cbb,csync)
integer*1 msgbits(KK),codeword(ND) integer*1 msgbits(KK),codeword(ND)
integer icw(ND) integer icw(ND)
integer id(NS+ND) integer id(NS+ND)
integer jd(NS+ND)
integer isync(48) !Long sync vector integer isync(48) !Long sync vector
integer ib13(13) !Barker 13 code integer ib13(13) !Barker 13 code
integer itone(NN)
integer*8 n8 integer*8 n8
data ib13/1,1,1,1,1,-1,-1,1,1,-1,1,-1,1/ data ib13/1,1,1,1,1,-1,-1,1,1,-1,1,-1,1/
data first/.true./ data first/.true./
@ -125,5 +127,21 @@ subroutine genwsprlf(msgbits,id,icw,cbb,csync)
enddo enddo
csync=x csync=x
! Map I and Q to tones.
n=0
do i=1,204
n=n+1
jd(n)=id(i)/abs(id(i))
n=n+1
jd(n)=id(i+205)/abs(id(i+205))
enddo
jd(409)=id(205)/abs(id(205))
itone=0
do i=1,204
itone(2*i-1)=(jd(2*i)*jd(2*i-1)+1)/2;
itone(2*i)=-(jd(2*i)*jd(2*i+1)-1)/2;
enddo
itone(409)=jd(409) !### Is this correct ??? ###
return return
end subroutine genwsprlf end subroutine genwsprlf

View File

@ -31,10 +31,12 @@ program wsprlfsim
complex cb13(0:N13-1) !Barker 13 waveform complex cb13(0:N13-1) !Barker 13 waveform
complex c(0:NZ-1) !Complex waveform complex c(0:NZ-1) !Complex waveform
complex c0(0:NZ-1) !Complex waveform complex c0(0:NZ-1) !Complex waveform
complex c1(0:NZ-1) !Complex waveform
complex zz(NS+ND) !Complex symbol values (intermediate) complex zz(NS+ND) !Complex symbol values (intermediate)
complex z complex z
real xnoise(0:NZ-1) !Generated random noise real xnoise(0:NZ-1) !Generated random noise
real ynoise(0:NZ-1) !Generated random noise real ynoise(0:NZ-1) !Generated random noise
real s(0:NZ-1)
real rxdata(ND),llr(ND) !Soft symbols real rxdata(ND),llr(ND) !Soft symbols
real pp(2*NSPS) !Shaped pulse for OQPSK real pp(2*NSPS) !Shaped pulse for OQPSK
real a(5) !For twkfreq1 real a(5) !For twkfreq1
@ -42,6 +44,7 @@ program wsprlfsim
integer id(NS+ND) !NRZ values (+/-1) for Sync and Data integer id(NS+ND) !NRZ values (+/-1) for Sync and Data
integer ierror(NS+ND) integer ierror(NS+ND)
integer icw(NN) integer icw(NN)
integer itone(NN)
integer*1 msgbits(KK),decoded(KK),apmask(ND),cw(ND) integer*1 msgbits(KK),decoded(KK),apmask(ND),cw(ND)
! integer*1 codeword(ND) ! integer*1 codeword(ND)
data msgbits/0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1, & data msgbits/0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1, &
@ -84,14 +87,11 @@ program wsprlfsim
pp(i)=sin(0.5*(i-1)*twopi/(2*NSPS)) pp(i)=sin(0.5*(i-1)*twopi/(2*NSPS))
enddo enddo
call genwsprlf(msgbits,id,icw,cbb,csync)!Generate baseband waveform and csync call genwsprlf(msgbits,id,icw,cbb,csync,itone)!Generate baseband waveform
cb13=csync(3088:3503) !Copy the Barker 13 waveform cb13=csync(3088:3503) !Copy the Barker 13 waveform
a=0. a=0.
a(1)=f0 a(1)=f0
call twkfreq1(cbb,NZ,fs,a,cbb) !Mix to specified frequency call twkfreq1(cbb,NZ,fs,a,c0) !Mix baseband to specified frequency
! write(*,3101) id
!3101 format(20i3)
isna=-20 isna=-20
isnb=-40 isnb=-40
@ -109,7 +109,7 @@ program wsprlfsim
sqf=0. sqf=0.
sqt=0. sqt=0.
do iter=1,iters !Loop over requested iterations do iter=1,iters !Loop over requested iterations
c=cbb c=c0
if(delay.ne.0.0 .or. fspread.ne.0.0) then if(delay.ne.0.0 .or. fspread.ne.0.0) then
call watterson(c,NZ,fs,delay,fspread) call watterson(c,NZ,fs,delay,fspread)
endif endif
@ -167,7 +167,7 @@ program wsprlfsim
!----------------------------------------------------------------- !-----------------------------------------------------------------
nterms=maxn nterms=maxn
c0=c c1=c
do itry=1,20 do itry=1,20
idf=itry/2 idf=itry/2
if(mod(itry,2).eq.0) idf=-idf if(mod(itry,2).eq.0) idf=-idf
@ -176,7 +176,7 @@ program wsprlfsim
ifer=1 ifer=1
a(1)=idf*0.00085 a(1)=idf*0.00085
a(2:5)=0. a(2:5)=0.
call twkfreq1(c0,NZ,fs,a,c) !Mix c0 into c call twkfreq1(c1,NZ,fs,a,c) !Mix c1 into c
call cpolyfitw(c,pp,id,maxn,aa,bb,zz,nhs) call cpolyfitw(c,pp,id,maxn,aa,bb,zz,nhs)
call msksoftsymw(zz,aa,bb,id,nterms,ierror,rxdata,nhard0,nhardsync0) call msksoftsymw(zz,aa,bb,id,nterms,ierror,rxdata,nhard0,nhardsync0)
if(nhardsync0.gt.35) cycle if(nhardsync0.gt.35) cycle