From 0807ab8cd56f96e84c196d60e11e5e1c197d9c9b Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 10 Jul 2007 18:27:56 +0000 Subject: [PATCH] Not finished, but thunderstorm is coming ... git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@489 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- gcom2.f90 | 5 +++-- map65.py | 1 + spec.f90 | 30 ++++++++++++++++++++---------- specjt.py | 25 +++++++++++++++++-------- 4 files changed, 41 insertions(+), 20 deletions(-) diff --git a/gcom2.f90 b/gcom2.f90 index cb936fc28..ef5f613d1 100644 --- a/gcom2.f90 +++ b/gcom2.f90 @@ -43,7 +43,8 @@ integer idphi !Phase offset in Y channel (deg) GUI integer nkeep !Timeout limit for band maps (min) GUI integer nmode !Which WSJT mode? GUI,Decoder integer mode65 !JT65 sub-mode (A/B/C ==> 1/2/4) GUI,SoundIn,Decoder -integer nclip !Clipping level GUI +integer nbpp !# FFT Bins/pixel, wideband waterfall Spec +integer nfullspec !Set to 1 to display full spectrum GUI integer ndebug !Write debugging info? GUI integer ndphi !Set to 1 to compute dphi GUI,Decoder integer nblank !Is NB checked? GUI @@ -103,7 +104,7 @@ common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & ndecdone,npingtime,ierr,lauto,mantx,nrestart,ntr,nmsg,nsave,nadd5, & dftolerance,LDecoded,rxdone,monitoring,nzap,minsigdb, & nclearave,nfreeze,nafc,ncsmin,newspec,nfa,nfb,nfcal,idphi,nkeep, & - nmode,mode65,nclip,ndebug,ndphi, & + nmode,mode65,nbpp,nfullspec,ndebug,ndphi, & nblank,nport,mousedf,mousefqso,neme,nrw26,naggressive,ntx2,nagain, & shok,sendingsh,d2a(661500),d2b(661500),b(60000),jza,jzb,ntime, & idinterval,msmax,lenappdir,idf,ndiskdat,nlines,nflat,ntxreq,ntxnow, & diff --git a/map65.py b/map65.py index 12de5cca2..c7e76b1e5 100644 --- a/map65.py +++ b/map65.py @@ -1761,6 +1761,7 @@ GenStdMsgs() Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8] Audio.gcom2.mousefqso=125 Audio.gcom2.ncsmin=4 +Audio.gcom2.nfullspec=0 monitor() first=1 if g.Win32: root.iconbitmap("wsjt.ico") diff --git a/spec.f90 b/spec.f90 index 50f5fc0ec..e265ff154 100644 --- a/spec.f90 +++ b/spec.f90 @@ -37,11 +37,6 @@ subroutine spec(brightness,contrast,ngain,nspeed,a,a2) nlines=322/nadd call zero(s,NFFT*NY) k=0 - fselect=mousefqso + 1.6 - imid=nint(1000.0*(fselect-125.0+48.0)/df) - ia=imid-374 - ib=ia+749 - do j=1,nlines do n=1,nadd k=k+1 @@ -60,16 +55,30 @@ subroutine spec(brightness,contrast,ngain,nspeed,a,a2) gain=40*sqrt(nstep(nspeed)/5.0) * 5.0**(0.01*contrast) gamma=1.3 + 0.01*contrast offset=(brightness+64.0)/2 - k=0 fac=20.0/nadd - nbpp=NFFT/NX !Bins per pixel in wide waterfall - do j=nlines,1,-1 !Reverse order so last will be on top + + nbpp=(nfb-nfa)*NFFT/(96.0*NX) !Bins per pixel in wideband (upper) waterfall + fselect=mousefqso + 1.6 + imid=nint(1000.0*(fselect-125.0+48.0)/df) + fmid=0.5*(nfa+nfb) + imid0=nint(1000.0*(fmid-125.0+48.0)/df) + i0=imid-374 + ii0=imid-374*nbpp + if(nfullspec.eq.1) then + nbpp=NFFT/NX + ii0=0 + endif + + k=0 + do j=nlines,1,-1 !Reverse order so last will be on top do i=1,NX k=k+1 n=0 x=0. - do ii=(i-1)*nbpp+1,i*nbpp + iia=(i-1)*nbpp + ii0 + 1 + iib=i*nbpp + ii0 + do ii=iia,iib x=max(x,s(ii,j)) enddo x=fac*x @@ -77,8 +86,9 @@ subroutine spec(brightness,contrast,ngain,nspeed,a,a2) n=min(252,max(0,n)) a(k)=n +! Now do the lower (zoomed) waterfall with one FFT bin per pixel. n=0 - x=fac*s(ia+i-1,j) + x=fac*s(i0+i-1,j) if(x.gt.0.0) n=(3.0*x)**gamma + offset n=min(252,max(0,n)) a2(k)=n diff --git a/specjt.py b/specjt.py index 3c235112a..f511409a0 100644 --- a/specjt.py +++ b/specjt.py @@ -110,8 +110,13 @@ def pal_AFMHot(): #---------------------------------------------------- fdf_change # Readout of graphical cursor location def fdf_change(event): - df=96.0/750.0 - fmid=122.8 # empirical + + bw=float(Audio.gcom2.nfb - Audio.gcom2.nfa) + fmid=130.0 + if Audio.gcom2.nfullspec: + bw=96.0 #Total bw 96 kHz + fmid=125.0 - 2.2 #Empirical + df=bw/NX #kHz per pixel g.Freq=df*(event.x-375) + fmid n=int(g.Freq+0.5) t="%d" % (n,) @@ -319,11 +324,15 @@ def update(): #-------------------------------------------------------- draw_axis def draw_axis(): c.delete(ALL) - xmid=125.0 - 2.3 #Empirical - bw=96.0 - x1=int(xmid-0.6*bw) - x2=int(xmid+0.6*bw) - xdf=bw/NX #128 Hz + bw=float(Audio.gcom2.nfb - Audio.gcom2.nfa) + xmid=130.0 + if Audio.gcom2.nfullspec: + bw=96.0 #Total bw 96 kHz + xmid=125.0 - 2.3 #Empirical + xdf=bw/NX #kHz per pixel + x1=int(xmid-0.6*bw) #Make it too wide, to be + x2=int(xmid+0.6*bw) #sure to get all the numbers +# print Audio.gcom2.nfullspec,bw,xdf,x1,x2 for ix in range(x1,x2,1): i=0.5*NX + (ix-xmid)/xdf j=20 @@ -334,7 +343,7 @@ def draw_axis(): if ix<100: x=x+1 y=8 c.create_text(x,y,text=str(ix)) - c.create_line(i,25,i,j,fill='black') + c.create_line(i,25,i,j,fill='black') #Draw the upper scale c2.delete(ALL) xmid2=0