diff --git a/lib/fsk4hf/wspr_wav.f90 b/lib/fsk4hf/wspr_wav.f90 index ba2a4e8ec..188242bbc 100644 --- a/lib/fsk4hf/wspr_wav.f90 +++ b/lib/fsk4hf/wspr_wav.f90 @@ -33,10 +33,17 @@ subroutine wspr_wav(baud,xdt,h,f0,itone,snrdb,iwave) if(k.gt.0 .and. k.le.NMAX) dat(k)=dat(k) + sig*sin(phi) enddo enddo - fac=32767.0 + rms=100.0 - if(snrdb.ge.90.0) iwave=nint(fac*dat) - if(snrdb.lt.90.0) iwave=nint(rms*dat) + if(snrdb.lt.90.0) then + dat=rms*dat; + if(maxval(abs(dat)).gt.32767.0) print*,"Warning - data will be clipped." + else + datpk=maxval(abs(dat)) + fac=32767.9/datpk + dat=fac*dat + endif + iwave=nint(dat) return end subroutine wspr_wav diff --git a/lib/fsk4hf/wsprsimf.f90 b/lib/fsk4hf/wsprsimf.f90 index c1089b6f7..c6c71fe6e 100644 --- a/lib/fsk4hf/wsprsimf.f90 +++ b/lib/fsk4hf/wsprsimf.f90 @@ -20,8 +20,8 @@ program wsprsim ! Get command-line argument(s) nargs=iargc() if(nargs.ne.8) then - print*,'Usage: wsprmsksim "message" f0 DT fsp del nwav nfiles snr' - print*,'Example: wsprmsksim "K1ABC FN42 30" 50 0.0 0.1 1.0 1 10 -33' + print*,'Usage: wsprsim "message" f0 DT fsp del nwav nfiles snr' + print*,'Example: wsprsim "K1ABC FN42 30" 50 0.0 0.1 1.0 1 10 -33' go to 999 endif call getarg(1,msg) !Message to be transmitted @@ -57,8 +57,8 @@ program wsprsim write(*,1000) f0,xdt,txt,snrdb,fspread,delay,nfiles,msgsent 1000 format('f0:',f9.3,' DT:',f6.2,' txt:',f6.1,' SNR:',f6.1, & ' fspread:',f6.1,' delay:',f6.1,' nfiles:',i3,2x,a22) - write(*,*) "Channel symbols: " - write(*,'(162i2)') itone +! write(*,*) "Channel symbols: " +! write(*,'(162i2)') itone h=1.0 phi=0.0 diff --git a/lib/jt65sim.f90 b/lib/jt65sim.f90 index b00c7f8cb..ba4285d4f 100644 --- a/lib/jt65sim.f90 +++ b/lib/jt65sim.f90 @@ -286,12 +286,12 @@ program jt65sim if(snrdb.lt.90.0) then dat=rms*dat(1:npts) else - datpk=maxval(abs(dat)) + datpk=maxval(abs(dat(1:npts))) fac=32766.9/datpk - dat=fac*dat(1:npts) + dat(1:npts)=fac*dat(1:npts) endif - if(any(dat.gt.32767.0)) print*,"Warning - data will be clipped." - iwave(1:npts)=real(dat(1:npts)) + if(any(abs(dat(1:npts)).gt.32767.0)) print*,"Warning - data will be clipped." + iwave(1:npts)=nint(dat(1:npts)) write(10) h,iwave(1:npts) !Save the .wav file close(10) enddo diff --git a/lib/wsprd/wsprd_exp.c b/lib/wsprd/wsprd_exp.c index ae9830b0f..9e0aa1caa 100644 --- a/lib/wsprd/wsprd_exp.c +++ b/lib/wsprd/wsprd_exp.c @@ -327,9 +327,6 @@ void sync_and_demodulate(float *id, float *qd, long np, if( fsymb[i] < -128 ) fsymb[i]=-128.0; symbols[i]=fsymb[i] + 128; } - printf("a: %f %f %f\n",fsymb[0],fsymb[1],fsymb[2]); - printf("a: %f %f %f\n",fsymb[3],fsymb[4],fsymb[5]); - printf("a: %f %f %f\n",fsymb[6],fsymb[7],fsymb[8]); return; } return; @@ -1182,7 +1179,6 @@ int main(int argc, char *argv[]) shift1=shift0[j]; sync1=sync0[j]; - // coarse-grid lag and freq search, then if sync>minsync1 continue fstep=0.0; ifmin=0; ifmax=0; lagmin=shift1-128; diff --git a/lib/wsprd/wsprsim_utils.c b/lib/wsprd/wsprsim_utils.c index d4a53c8b6..44781e777 100644 --- a/lib/wsprd/wsprsim_utils.c +++ b/lib/wsprd/wsprsim_utils.c @@ -302,7 +302,7 @@ int get_wspr_channel_symbols(char* rawmessage, char* hashtab, unsigned char* sym encode(channelbits,data,nbytes); interleave(channelbits); - + for (i=0; i<162; i++) { symbols[i]=2*channelbits[i]+pr3[i]; }