diff --git a/gcom2.f90 b/gcom2.f90 index c244154ce..862b7aad2 100644 --- a/gcom2.f90 +++ b/gcom2.f90 @@ -8,6 +8,7 @@ real ccf !CCF in time (blue curve) Decoder real green !Data for green line GUI real fselect !Specified QSO frequency GUI real pctlost !Percent of lost packets Decoder +real pctblank !Percent of blanked blocks/packets Decoder real rxnoise !Rx noise in dB recvpkt real dphi !Phase shift between pol'n channels GUI,Decoder integer ngreen !Length of green GUI @@ -103,7 +104,7 @@ character*12 pttport character*8 utcdata !HHMM UTC for the processed data Decoder common/gcom2/fcenter,ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & - green(500),fselect,pctlost,rxnoise,dphi,ngreen,dgain,iter, & + green(500),fselect,pctlost,pctblank,rxnoise,dphi,ngreen,dgain,iter, & ndecoding,ndecoding0,mousebutton,multicast, & ndecdone,npingtime,ierr,lauto,mantx,nrestart,ntr,nmsg,nsave,nadd5, & dftolerance,LDecoded,rxdone,monitoring,nzap,minsigdb, & diff --git a/map65.py b/map65.py index 7b5bdb029..c6f2f2eac 100644 --- a/map65.py +++ b/map65.py @@ -970,13 +970,10 @@ def update(): t=time.strftime('%Y %b %d\n%H:%M:%S',utc) Audio.gcom2.utcdate=t[:12] ldate.configure(text=t) - t="Rx noise: %.1f dB" % Audio.gcom2.rxnoise + t="Rx: %.1f dB %.1f %%" % (Audio.gcom2.rxnoise,Audio.gcom2.pctblank) msg4.configure(text=t) t="Drop: %.2f %%" % Audio.gcom2.pctlost msg5.configure(text=t) -## t="%d %.2f %.2f" % (Audio.datcom.kbuf,Audio.datcom.kk/(60.0*96000.0), \ -## Audio.datcom.kxp/(60.0*96000.0)) - msg5.configure(text=t) root_geom=root.geometry() try: bm_geom=bm.geometry() @@ -1620,12 +1617,14 @@ f5a.pack(side=LEFT,expand=1,fill=BOTH) #------------------------------------------------------ Receiving parameters f5b=Frame(iframe5,bd=2,relief=GROOVE) nzap=IntVar() +bblank=Checkbutton(f5b,text='NB',justify=RIGHT,variable=nblank) +bblank.grid(column=0,row=0,padx=2,pady=20,sticky='EW') ltol=Label(f5b, bg='white', fg='black', text='Tol 400', width=8, relief=RIDGE) -ltol.grid(column=0,row=2,padx=2,pady=1,sticky='EW') +ltol.grid(column=0,row=1,padx=2,pady=1,sticky='EW') Widget.bind(ltol,'',inctol) Widget.bind(ltol,'',dectol) ldsec=Label(f5b, bg='white', fg='black', text='Dsec 0.0', width=8, relief=RIDGE) -ldsec.grid(column=0,row=4,ipadx=3,padx=2,pady=5,sticky='EW') +ldsec.grid(column=0,row=2,ipadx=3,padx=2,pady=5,sticky='EW') Widget.bind(ldsec,'',incdsec) Widget.bind(ldsec,'',decdsec) diff --git a/recvpkt.F90 b/recvpkt.F90 index 3dfeec38c..a5826ed20 100644 --- a/recvpkt.F90 +++ b/recvpkt.F90 @@ -15,7 +15,7 @@ subroutine recvpkt(iarg) include 'gcom2.f90' equivalence (id,d8) data nblock0/0/,kb/1/,ns00/99/ - data sqave/0.0/,u/0.001/,rxnoise/0.0/,kbuf/1/,lost_tot/0/ + data sqave/0.0/,u/0.001/,rxnoise/0.0/,pctblank/0.0/,kbuf/1/,lost_tot/0/ data multicast0/-99/ save diff --git a/symspec.f90 b/symspec.f90 index f24e61cf8..e5b0f8ba0 100644 --- a/symspec.f90 +++ b/symspec.f90 @@ -30,8 +30,65 @@ subroutine symspec(id,kbuf,kk,kkdone,nutc,newdat) szavg(ip,i)=0. enddo enddo + +! Get baseline power level for this minute + n1=174 !Block size (somewhat arbitrary) + n2=(kkk-kkdone)/n1 !Number of blocks + k=0 !Starting place + sqq=0. + nsqq=0 + do j=1,n2 + sq=0. + do i=1,n1 !Find power in each block + k=k+1 + x1=id(1,k,kbuf) + x2=id(2,k,kbuf) + x3=id(3,k,kbuf) + x4=id(4,k,kbuf) + sq=sq + x1*x1 + x2*x2 + x3*x3 + x4*x4 + enddo + if(sq.lt.n1*10000.) then !Find power in good blocks + sqq=sqq+sq + nsqq=nsqq+1 + endif + enddo + sqave=sqq/nsqq !Average power in good blocks + nclip=0 + nz2=0 endif + if(nblank.ne.0) then +! Apply final noise blanking + n2=(kkk-kkdone)/n1 + k=kkdone + do j=1,n2 + sq=0. + do i=1,n1 + k=k+1 + x1=id(1,k,kbuf) + x2=id(2,k,kbuf) + x3=id(3,k,kbuf) + x4=id(4,k,kbuf) + sq=sq + x1*x1 + x2*x2 + x3*x3 + x4*x4 + enddo +! If power in this block is excessive, blank it. + if(sq.gt.1.5*sqave) then + do i=k-n1+1,k + id(1,i,kbuf)=0 + id(2,i,kbuf)=0 + id(3,i,kbuf)=0 + id(4,i,kbuf)=0 + enddo + nclip=nclip+1 + endif + enddo + nz2=nz2+n2 + pctblank=nclip*100.0/nz2 +! write(*,3002) nblank,n2,nz2,nclip,kkk,kkdone,pctblank,sqave +!3002 format(4i6,2i9,f8.1,f10.0) + endif +!### + do nn=1,ntot i0=ts+hsym !Starting sample pointer if((i0+npts-1).gt.kkk) go to 998 !See if we have enough points