1. subtractft8: on the last call to sqf, don't need to do the long FFT.

2. mainwindow.cpp: based on the time when <DecodeFinished> is received, calculate
mswait to try to place the killFile time at 0.75*m_TRperiod.
This commit is contained in:
Steven Franke 2020-03-06 11:06:44 -06:00
parent f367b6d6b9
commit f2266c3c54
2 changed files with 16 additions and 18 deletions

View File

@ -1,4 +1,4 @@
subroutine subtractft8(dd0,itone,f0,dt,ldt)
subroutine subtractft8(dd0,itone,f0,dt,lrefinedt)
! Subtract an ft8 signal
!
@ -15,7 +15,7 @@ subroutine subtractft8(dd0,itone,f0,dt,ldt)
complex cx(0:NFFT/2)
complex cref,camp,cfilt,cw,z
integer itone(79)
logical first,ldt
logical first,lrefinedt,ldt
data first/.true./
common/heap8/cref(NFRAME),camp(NMAX),cfilt(NMAX),cw(NMAX)
equivalence (x,cx)
@ -40,25 +40,16 @@ subroutine subtractft8(dd0,itone,f0,dt,ldt)
! Generate complex reference waveform cref
call gen_ft8wave(itone,79,1920,2.0,12000.0,f0,cref,xjunk,1,NFRAME)
ldt=lrefinedt
if(ldt) then !Are we refining DT ?
! sqa=sqf(-300)
! sqb=sqf(300)
! sq0=sqf(0) !Do the subtraction with idt=0
! call peakup(sqa,sq0,sqb,dx)
! if(abs(dx).gt.1.0) return !No acceptable minimum: do not subtract
! i1=nint(300.0*dx) !First approximation of best idt
i1=0
! sqa=sqf(i1-60)
! sqb=sqf(i1+60)
sqa=sqf(i1-90)
sqb=sqf(i1+90)
sq0=sqf(i1)
sqa=sqf(-90)
sqb=sqf(+90)
sq0=sqf(0)
call peakup(sqa,sq0,sqb,dx)
if(abs(dx).gt.1.0) return !No acceptable minimum: do not subtract
! i2=nint(60.0*dx) + i1 !Best estimate of idt
i2=nint(90.0*dx) + i1 !Best estimate of idt
ldt=.false.
sq0=sqf(i2) !Do the subtraction with idt=i2
!write(*,*) 'subtract - i2= ',i2,dt
else
sq0=sqf(0) !Do the subtraction with idt=0
endif

View File

@ -3074,8 +3074,15 @@ void MainWindow::readFromStdout() //readFromStdout
// qDebug() << "bb" << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz") << line_read;
if(m_mode=="QRA64") m_wideGraph->drawRed(0,0);
m_bDecoded = line_read.mid(20).trimmed().toInt() > 0;
int mswait=750.0*m_TRperiod;
if(!m_diskData) killFileTimer.start(mswait); //Kill in 3/4 period
auto tnow = QDateTime::currentDateTimeUtc ();
double tdone = fmod(double(tnow.time().second()),m_TRperiod);
int mswait;
if( tdone < 0.5*m_TRperiod ) {
mswait = 1000.0 * ( 0.75 * m_TRperiod - tdone );
} else {
mswait = 1000.0 * ( 1.75 * m_TRperiod - tdone );
}
if(!m_diskData) killFileTimer.start(mswait); //Kill at 3/4 period
decodeDone ();
m_startAnother=m_loopall;
if(m_bNoMoreFiles) {