Some adjustments to usage of flat3.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3625 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2014-01-08 20:55:11 +00:00
parent b4c3fe2368
commit 8832044265
4 changed files with 18 additions and 20 deletions

View File

@ -1,9 +1,9 @@
subroutine flat3(savg0,iz,nterms,ynoise,savg) subroutine flat3(s0,iz,nfa,nfb,nterms,ynoise,s)
implicit real*8 (a-h,o-z) implicit real*8 (a-h,o-z)
parameter (NSMAX=6827) parameter (NSMAX=6827)
real*4 savg0(iz) real*4 s0(iz)
real*4 savg(iz) real*4 s(iz)
real*4 ynoise,y4 real*4 ynoise,y4
real*8 x(NSMAX) real*8 x(NSMAX)
@ -17,10 +17,11 @@ subroutine flat3(savg0,iz,nterms,ynoise,savg)
df=12000.0/16384.0 df=12000.0/16384.0
do i=1,iz do i=1,iz
y0(i)=db(savg0(i)) y0(i)=db(s0(i))
enddo enddo
ia=200.0/df ia=(nfa+200.0)/df
ib=4500.0/df ib=5000.0/df
if(nfb.gt.0) ib=nfb/df
j=0 j=0
do i=ia,ib do i=ia,ib
j=j+1 j=j+1
@ -35,14 +36,12 @@ subroutine flat3(savg0,iz,nterms,ynoise,savg)
do iter=1,99 do iter=1,99
call polfit(x,y,y,npts,nterms,mode,a,chisqr) call polfit(x,y,y,npts,nterms,mode,a,chisqr)
! print*,iter,npts,a(1:nterms)
rewind 21
do i=1,ib do i=1,ib
f=i*df f=i*df
yfit(i)=0.0 yfit(i)=a(nterms)
do n=1,nterms do n=nterms-1,1,-1
yfit(i)=yfit(i) + a(n) * f**(n-1) yfit(i)=f*yfit(i) + a(n)
enddo enddo
! write(21,1010) f,y0(i),yfit(i),y0(i)-yfit(i) ! write(21,1010) f,y0(i),yfit(i),y0(i)-yfit(i)
!1010 format(4f12.3) !1010 format(4f12.3)
@ -51,6 +50,7 @@ subroutine flat3(savg0,iz,nterms,ynoise,savg)
do j=1,npts do j=1,npts
y1=y(j)-yfit(ii(j)) y1=y(j)-yfit(ii(j))
if(y1.lt.ynoise) then if(y1.lt.ynoise) then
! if(y1.lt.ynoise .and. y1.gt.-ynoise) then
k=k+1 k=k+1
x(k)=x(j) x(k)=x(j)
y(k)=y(j) y(k)=y(j)
@ -67,8 +67,8 @@ subroutine flat3(savg0,iz,nterms,ynoise,savg)
! enddo ! enddo
do i=1,ib do i=1,ib
y4=y0(i)-yfit(i) y4=y0(i)-yfit(i) - 20.0
savg(i)=10.0**(0.1*y4) s(i)=10.0**(0.1*y4)
enddo enddo
end subroutine flat3 end subroutine flat3

View File

@ -26,7 +26,8 @@ subroutine symspec(k,ntrperiod,nsps,ingain,slope,pxdb,s,df3,ihsym,npts8)
complex cx(0:MAXFFT3/2) complex cx(0:MAXFFT3/2)
integer*2 id2 integer*2 id2
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, & common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, &
ntr,mousefqso,newdat,nfa,nfb,ntol,kin,nzhsym,nsynced,ndecoded ntr,mousefqso,newdat,npts8a,nfa,nfsplit,nfb,ntol,kin,nzhsym, &
nsave,nagain,ndepth,ntxmode,nmode,junk(5)
data rms/999.0/,k0/99999999/,nfft3z/0/,slope0/0.0/ data rms/999.0/,k0/99999999/,nfft3z/0/,slope0/0.0/
equivalence (xc,cx) equivalence (xc,cx)
save save
@ -108,7 +109,7 @@ subroutine symspec(k,ntrperiod,nsps,ingain,slope,pxdb,s,df3,ihsym,npts8)
savg=scale*ssum/ihsym savg=scale*ssum/ihsym
if(abs(slope+0.1).lt.0.01) then if(abs(slope+0.1).lt.0.01) then
call flat3(s,iz,3,1.0,s) call flat3(s,iz,nfa,nfb,3,1.0,s)
! call flat3(savg,iz,3,1.0,savg) ! call flat3(savg,iz,3,1.0,savg)
endif endif

View File

@ -14,8 +14,6 @@
#include "getfile.h" #include "getfile.h"
#include "logqso.h" #include "logqso.h"
#ifdef QT5 #ifdef QT5
#include <QtConcurrent/QtConcurrentRun> #include <QtConcurrent/QtConcurrentRun>
#endif #endif
@ -711,12 +709,13 @@ void MainWindow::dataSink(qint64 frames)
jt9com_.ndiskdat=0; jt9com_.ndiskdat=0;
} }
// Get power, spectrum, and ihsym // Get power, spectrum, and ihsym
trmin=m_TRperiod/60; trmin=m_TRperiod/60;
slope=0.0; slope=0.0;
slope=(float)m_wideGraph->getSlope(); slope=(float)m_wideGraph->getSlope();
int k (frames - 1); int k (frames - 1);
jt9com_.nfa=m_wideGraph->nStartFreq();
jt9com_.nfb=m_wideGraph->getFmax();
symspec_(&k,&trmin,&m_nsps,&m_inGain,&slope,&px,s,&df3,&ihsym,&npts8); symspec_(&k,&trmin,&m_nsps,&m_inGain,&slope,&px,s,&df3,&ihsym,&npts8);
if(ihsym <=0) return; if(ihsym <=0) return;
QString t; QString t;

View File

@ -8,8 +8,6 @@
class QAudioDeviceInfo; class QAudioDeviceInfo;
class QAudioDeviceInfo;
// An instance of this sends audio data to a specified soundcard. // An instance of this sends audio data to a specified soundcard.
class SoundOutput : public QObject class SoundOutput : public QObject