diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c38ac422..b36ac2226 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -865,7 +865,7 @@ if (Fortran_COMPILER_NAME MATCHES "gfortran.*") set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -isysroot ${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}") elseif (Fortran_COMPILER_NAME MATCHES "ifort.*") # ifort (untested) diff --git a/lib/fsk4hf/genwsprlf.f90 b/lib/fsk4hf/genwsprlf.f90 index bd9e2472e..0364c5bc3 100644 --- a/lib/fsk4hf/genwsprlf.f90 +++ b/lib/fsk4hf/genwsprlf.f90 @@ -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. @@ -6,7 +6,7 @@ subroutine genwsprlf(msgbits,id,icw,cbb,csync) parameter (ND=300) !Data symbols: LDPC (300,60), r=1/5 parameter (NS=109) !Sync symbols (2 x 48 + Barker 13) 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 (N2=2*NSPS) !Samples per OQPSK symbol (32) 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 icw(ND) integer id(NS+ND) + integer jd(NS+ND) integer isync(48) !Long sync vector integer ib13(13) !Barker 13 code + integer itone(NN) integer*8 n8 data ib13/1,1,1,1,1,-1,-1,1,1,-1,1,-1,1/ data first/.true./ @@ -125,5 +127,21 @@ subroutine genwsprlf(msgbits,id,icw,cbb,csync) enddo 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 end subroutine genwsprlf diff --git a/lib/fsk4hf/wsprlfsim.f90 b/lib/fsk4hf/wsprlfsim.f90 index b27b9f9ba..87a8b3728 100644 --- a/lib/fsk4hf/wsprlfsim.f90 +++ b/lib/fsk4hf/wsprlfsim.f90 @@ -31,10 +31,12 @@ program wsprlfsim complex cb13(0:N13-1) !Barker 13 waveform complex c(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 z real xnoise(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 pp(2*NSPS) !Shaped pulse for OQPSK real a(5) !For twkfreq1 @@ -42,6 +44,7 @@ program wsprlfsim integer id(NS+ND) !NRZ values (+/-1) for Sync and Data integer ierror(NS+ND) integer icw(NN) + integer itone(NN) integer*1 msgbits(KK),decoded(KK),apmask(ND),cw(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, & @@ -84,15 +87,12 @@ program wsprlfsim pp(i)=sin(0.5*(i-1)*twopi/(2*NSPS)) 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 a=0. a(1)=f0 - call twkfreq1(cbb,NZ,fs,a,cbb) !Mix to specified frequency - -! write(*,3101) id -!3101 format(20i3) - + call twkfreq1(cbb,NZ,fs,a,c0) !Mix baseband to specified frequency + isna=-20 isnb=-40 if(snrdb.ne.0.0) then @@ -109,7 +109,7 @@ program wsprlfsim sqf=0. sqt=0. do iter=1,iters !Loop over requested iterations - c=cbb + c=c0 if(delay.ne.0.0 .or. fspread.ne.0.0) then call watterson(c,NZ,fs,delay,fspread) endif @@ -167,7 +167,7 @@ program wsprlfsim !----------------------------------------------------------------- nterms=maxn - c0=c + c1=c do itry=1,20 idf=itry/2 if(mod(itry,2).eq.0) idf=-idf @@ -176,7 +176,7 @@ program wsprlfsim ifer=1 a(1)=idf*0.00085 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 msksoftsymw(zz,aa,bb,id,nterms,ierror,rxdata,nhard0,nhardsync0) if(nhardsync0.gt.35) cycle