Correct use of "gain" in symspec.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3643 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2014-01-17 14:56:11 +00:00
parent 9280eab4c2
commit 9a1c8e3e63
2 changed files with 4 additions and 6 deletions

View File

@ -47,7 +47,6 @@ subroutine symspec(k,ntrperiod,nsps,ingain,nflatten,pxdb,s,df3,ihsym,npts8)
w3(i)=2.0*(sin(i*pi/nfft3))**2 !Window for nfft3 spectrum w3(i)=2.0*(sin(i*pi/nfft3))**2 !Window for nfft3 spectrum
enddo enddo
nfft3z=nfft3 nfft3z=nfft3
nh=NSMAX/2
endif endif
if(k.lt.k0) then !Start a new data block if(k.lt.k0) then !Start a new data block
@ -56,19 +55,18 @@ subroutine symspec(k,ntrperiod,nsps,ingain,nflatten,pxdb,s,df3,ihsym,npts8)
ihsym=0 ihsym=0
if(ndiskdat.eq.0) id2(k+1:)=0 !Needed to prevent "ghosts". Not sure why. if(ndiskdat.eq.0) id2(k+1:)=0 !Needed to prevent "ghosts". Not sure why.
endif endif
gain=10.0**(0.05*ingain) gain=10.0**(0.1*ingain)
sq=0. sq=0.
do i=k0+1,k do i=k0+1,k
x1=id2(i) x1=id2(i)
sq=sq + x1*x1 sq=sq + x1*x1
enddo enddo
sq=sq * gain**2 sq=sq * gain
rms=sqrt(sq/(k-k0)) rms=sqrt(sq/(k-k0))
pxdb=0. pxdb=0.
if(rms.gt.0.0) pxdb=20.0*log10(rms) if(rms.gt.0.0) pxdb=20.0*log10(rms)
if(pxdb.gt.60.0) pxdb=60.0 if(pxdb.gt.60.0) pxdb=60.0
k0=k k0=k
ja=ja+jstep !Index of first sample ja=ja+jstep !Index of first sample
@ -96,7 +94,7 @@ subroutine symspec(k,ntrperiod,nsps,ingain,nflatten,pxdb,s,df3,ihsym,npts8)
sx=fac*(real(cx(j))**2 + aimag(cx(j))**2) sx=fac*(real(cx(j))**2 + aimag(cx(j))**2)
ss(n,i)=sx ss(n,i)=sx
ssum(i)=ssum(i) + sx ssum(i)=ssum(i) + sx
s(i)=gain*sx s(i)=1000.0*gain*sx
enddo enddo
savg=ssum/ihsym savg=ssum/ihsym

View File

@ -1,4 +1,4 @@
//-------------------------------------------------------------- MainWindow //--------------------------------------------------------------- MainWindow
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"