From 13842167ef59b116e1d7e8c112add640fd49448a Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 28 Apr 2017 12:04:05 +0000 Subject: [PATCH] Add the params file, and some updates to test programs. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7657 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/fsk4hf/getfc1w.f90 | 14 +++++++------- lib/fsk4hf/wspr5d.f90 | 11 ++++++++--- lib/fsk4hf/wspr5sim.f90 | 4 ++-- lib/fsk4hf/wsprlf_params.f90 | 14 ++++++++++++++ 4 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 lib/fsk4hf/wsprlf_params.f90 diff --git a/lib/fsk4hf/getfc1w.f90 b/lib/fsk4hf/getfc1w.f90 index b605b9890..c57d61a87 100644 --- a/lib/fsk4hf/getfc1w.f90 +++ b/lib/fsk4hf/getfc1w.f90 @@ -1,4 +1,4 @@ -subroutine getfc1w(c,fs,fc1) +subroutine getfc1w(c,fs,fc1,xsnr) include 'wsprlf_params.f90' @@ -25,7 +25,7 @@ subroutine getfc1w(c,fs,fc1) smax=0. ipk=0 fc1=0. - ia=nint(10.0/df1) + ia=nint(100.0/df1) do i=-ia,ia f=i*df1 if(s(i).gt.smax) then @@ -38,11 +38,11 @@ subroutine getfc1w(c,fs,fc1) enddo ! The following is for testing SNR calibration: -! sp3n=(s(ipk-1)+s(ipk)+s(ipk+1)) !Sig + 3*noise -! base=(sum(s)-sp3n)/(NFFT1-3.0) !Noise per bin -! psig=sp3n-3*base !Sig only -! pnoise=(2500.0/df1)*base !Noise in 2500 Hz -! xsnrdb=db(psig/pnoise) + sp3n=(s(ipk-1)+s(ipk)+s(ipk+1)) !Sig + 3*noise + base=(sum(s)-sp3n)/(NFFT1-3.0) !Noise per bin + psig=sp3n-3*base !Sig only + pnoise=(2500.0/df1)*base !Noise in 2500 Hz + xsnr=db(psig/pnoise) return end subroutine getfc1w diff --git a/lib/fsk4hf/wspr5d.f90 b/lib/fsk4hf/wspr5d.f90 index 74a0b45b6..9a32f3ef5 100644 --- a/lib/fsk4hf/wspr5d.f90 +++ b/lib/fsk4hf/wspr5d.f90 @@ -88,8 +88,8 @@ program wspr5d ! 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 + call getfc1w(c,fs,fc1,xsnr) !First approx for freq + call getfc2w(c,csync,fs,fc1,fc2,fc3) !Refined freq !NB: Measured performance is about equally good using fc2 or fc3 here: a(1)=-(fc1+fc2) @@ -124,11 +124,15 @@ program wspr5d !4501 format(i8,2f12.3) enddo xdt=jpk/fs + do i=0,NZ-1 + j=i+jpk + if(j.ge.0 .and. j.lt.NZ) c1(i)=c(j) + enddo ! print*,fc1,fc1+fc2,xdt,amax !----------------------------------------------------------------- nterms=maxn - c1=c +! c1=c ! do itry=1,1000 do itry=1,20 idf=itry/2 @@ -166,6 +170,7 @@ program wspr5d idat(7)=ishft(idat(7),6) call wqdecode(idat,message,itype) endif + nsnr=nint(xsnr) write(*,1110) ifile,nsnr,xdt,fc1+fc2,message 1110 format(2i5,f7.2,f7.2,2x,a22) enddo diff --git a/lib/fsk4hf/wspr5sim.f90 b/lib/fsk4hf/wspr5sim.f90 index 0b9ac8272..f9611ecb0 100644 --- a/lib/fsk4hf/wspr5sim.f90 +++ b/lib/fsk4hf/wspr5sim.f90 @@ -46,7 +46,7 @@ program wspr5sim dphi1=twopi*(f0+0.25d0*baud)*dt phi=0.d0 c0=0. - k=-1 + k=-1 + nint(xdt/dt) do j=1,NN dphi=dphi0 if(itone(j).eq.1) dphi=dphi1 @@ -56,7 +56,7 @@ program wspr5sim phi=phi+dphi if(phi.gt.twopi) phi=phi-twopi xphi=phi - c0(k)=cmplx(cos(xphi),sin(xphi)) + if(k.ge.0 .and. k.lt.NZ) c0(k)=cmplx(cos(xphi),sin(xphi)) enddo enddo c0=sig*c0 !Scale to requested sig level diff --git a/lib/fsk4hf/wsprlf_params.f90 b/lib/fsk4hf/wsprlf_params.f90 new file mode 100644 index 000000000..d0c3f5c7c --- /dev/null +++ b/lib/fsk4hf/wsprlf_params.f90 @@ -0,0 +1,14 @@ +!parameter (NDOWN=540) !Downsample factor (default 540) +parameter (NDOWN=30) !Downsample factor (default 540) +parameter (KK=60) !Information bits (50 + CRC10) +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 +parameter (NN=NR+NS+ND) !Total symbols (412) +parameter (NSPS0=8640) !Samples per symbol at 12000 S/s +parameter (NSPS=NSPS0/NDOWN) !Samples per MSK symbol (16) +parameter (N2=2*NSPS) !Samples per OQPSK symbol (32) +parameter (N13=13*N2) !Samples in central sync vector (416) +parameter (NZ=NSPS*NN) !Samples in baseband waveform (6592) +parameter (NZMAX=NSPS0*NN) +parameter (NFFT1=4*NSPS,NH1=NFFT1/2)