mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-12-24 11:40:31 -05:00
FT8 early decoding is now working.
This commit is contained in:
parent
cf07d478ac
commit
4a4864d2ae
@ -105,7 +105,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
|
||||
newdat=params%newdat
|
||||
call my_ft8%decode(ft8_decoded,id2,params%nQSOProgress,params%nfqso, &
|
||||
params%nftx,newdat,params%nutc,params%nfa,params%nfb, &
|
||||
params%ndepth,ncontest,logical(params%nagain), &
|
||||
params%nzhsym,params%ndepth,ncontest,logical(params%nagain), &
|
||||
logical(params%lft8apon),logical(params%lapcqonly), &
|
||||
params%napwid,mycall,hiscall,hisgrid)
|
||||
call timer('decft8 ',1)
|
||||
|
@ -1,6 +1,7 @@
|
||||
subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
||||
napwid,lsubtract,nagain,ncontest,iaptype,mycall12,hiscall12, &
|
||||
sync0,f1,xdt,xbase,apsym,aph10,nharderrors,dmin,nbadcrc,ipass,iera,msg37,xsnr)
|
||||
subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,nzhsym,lapon, &
|
||||
lapcqonly,napwid,lsubtract,nagain,ncontest,iaptype,mycall12,hiscall12, &
|
||||
sync0,f1,xdt,xbase,apsym,aph10,nharderrors,dmin,nbadcrc,ipass,iera, &
|
||||
msg37,xsnr,itone)
|
||||
|
||||
use crc
|
||||
use timer_module, only: timer
|
||||
@ -236,6 +237,7 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
||||
else
|
||||
npasses=3
|
||||
endif
|
||||
if(nzhsym.lt.50) npasses=1
|
||||
|
||||
do ipass=1,npasses
|
||||
llrd=llra
|
||||
@ -406,6 +408,9 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
||||
nbadcrc=0 ! If we get this far: valid codeword, valid (i3,n3), nonquirky message.
|
||||
call get_ft8_tones_from_77bits(message77,itone)
|
||||
if(lsubtract) call subtractft8(dd0,itone,f1,xdt)
|
||||
! write(*,3001) nzhsym,npasses,nqsoprogress,ipass,iaptype,lsubtract, &
|
||||
! f1,xdt,msg37(1:22); flush(6)
|
||||
!3001 format('A',5i3,L3,f7.1,f7.2,2x,a22)
|
||||
xsig=0.0
|
||||
xnoi=0.0
|
||||
do i=1,79
|
||||
|
@ -33,14 +33,14 @@ module ft8_decode
|
||||
contains
|
||||
|
||||
subroutine decode(this,callback,iwave,nQSOProgress,nfqso,nftx,newdat, &
|
||||
nutc,nfa,nfb,ndepth,ncontest,nagain,lft8apon,lapcqonly, &
|
||||
nutc,nfa,nfb,nzhsym,ndepth,ncontest,nagain,lft8apon,lapcqonly, &
|
||||
napwid,mycall12,hiscall12,hisgrid6)
|
||||
use timer_module, only: timer
|
||||
include 'ft8/ft8_params.f90'
|
||||
|
||||
class(ft8_decoder), intent(inout) :: this
|
||||
procedure(ft8_decode_callback) :: callback
|
||||
parameter (MAXCAND=300)
|
||||
parameter (MAXCAND=300,MAX_EARLY=100)
|
||||
real s(NH1,NHSYM)
|
||||
real sbase(NH1)
|
||||
real candidate(3,MAXCAND)
|
||||
@ -55,7 +55,12 @@ contains
|
||||
! character message*22
|
||||
character*37 allmessages(100)
|
||||
integer allsnrs(100)
|
||||
save s,dd
|
||||
integer itone(NN)
|
||||
integer itone_save(NN,MAX_EARLY)
|
||||
real f1_save(MAX_EARLY)
|
||||
real xdt_save(MAX_EARLY)
|
||||
|
||||
save s,dd,ndec_early,itone_save,f1_save,xdt_save
|
||||
|
||||
this%callback => callback
|
||||
write(datetime,1001) nutc !### TEMPORARY ###
|
||||
@ -63,9 +68,18 @@ contains
|
||||
|
||||
call ft8apset(mycall12,hiscall12,ncontest,apsym2,aph10)
|
||||
dd=iwave
|
||||
if(nzhsym.lt.50) then
|
||||
ndecodes=0
|
||||
allmessages=' '
|
||||
allsnrs=0
|
||||
else
|
||||
ndecodes=ndec_early
|
||||
endif
|
||||
if(nhsym.eq.50 .and. ndec_early.ge.1) then
|
||||
do i=1,ndec_early
|
||||
call subtractft8(dd,itone_save(1,i),f1_save(i),xdt_save(i))
|
||||
enddo
|
||||
endif
|
||||
ifa=nfa
|
||||
ifb=nfb
|
||||
if(nagain) then
|
||||
@ -104,10 +118,10 @@ contains
|
||||
xdt=candidate(2,icand)
|
||||
xbase=10.0**(0.1*(sbase(nint(f1/3.125))-40.0))
|
||||
call timer('ft8b ',0)
|
||||
call ft8b(dd,newdat,nQSOProgress,nfqso,nftx,ndepth,lft8apon, &
|
||||
call ft8b(dd,newdat,nQSOProgress,nfqso,nftx,ndepth,nzhsym,lft8apon, &
|
||||
lapcqonly,napwid,lsubtract,nagain,ncontest,iaptype,mycall12, &
|
||||
hiscall12,sync,f1,xdt,xbase,apsym2,aph10,nharderrors,dmin, &
|
||||
nbadcrc,iappass,iera,msg37,xsnr)
|
||||
nbadcrc,iappass,iera,msg37,xsnr,itone)
|
||||
call timer('ft8b ',1)
|
||||
nsnr=nint(xsnr)
|
||||
xdt=xdt-0.5
|
||||
@ -121,6 +135,9 @@ contains
|
||||
ndecodes=ndecodes+1
|
||||
allmessages(ndecodes)=msg37
|
||||
allsnrs(ndecodes)=nsnr
|
||||
f1_save(ndecodes)=f1
|
||||
xdt_save(ndecodes)=xdt
|
||||
itone_save(1:NN,ndecodes)=itone
|
||||
endif
|
||||
! write(81,1004) nutc,ncand,icand,ipass,iaptype,iappass, &
|
||||
! nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), &
|
||||
@ -134,6 +151,9 @@ contains
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
ndec_early=0
|
||||
if(nzhsym.lt.50) ndec_early=ndecodes
|
||||
|
||||
return
|
||||
end subroutine decode
|
||||
|
||||
|
@ -1411,7 +1411,7 @@ void MainWindow::dataSink(qint64 frames)
|
||||
m_dialFreqRxWSPR=m_freqNominal;
|
||||
}
|
||||
|
||||
if(m_ihsym == m_hsymStop) {
|
||||
if(m_ihsym==m_hsymStop or (m_mode=="FT8" and m_ihsym==m_earlyDecode and !m_diskData)) {
|
||||
if(m_mode=="Echo") {
|
||||
float snr=0;
|
||||
int nfrit=0;
|
||||
@ -1448,9 +1448,11 @@ void MainWindow::dataSink(qint64 frames)
|
||||
dec_data.params.newdat=1;
|
||||
dec_data.params.nagain=0;
|
||||
dec_data.params.nzhsym=m_hsymStop;
|
||||
if(m_mode=="FT8" and m_ihsym==m_earlyDecode and !m_diskData) dec_data.params.nzhsym=m_earlyDecode;
|
||||
QDateTime now {QDateTime::currentDateTimeUtc ()};
|
||||
m_dateTime = now.toString ("yyyy-MMM-dd hh:mm");
|
||||
if(!m_mode.startsWith ("WSPR")) decode(); //Start decoder
|
||||
if(m_mode=="FT8" and m_ihsym==m_earlyDecode and !m_diskData) return;
|
||||
|
||||
if(!m_diskData) { //Always save; may delete later
|
||||
if(m_mode=="FT8" or m_mode=="FT4") {
|
||||
@ -1458,8 +1460,6 @@ void MainWindow::dataSink(qint64 frames)
|
||||
if(n<(m_TRperiod/2)) n=n+m_TRperiod;
|
||||
auto const& period_start=now.addSecs(-n);
|
||||
m_fnameWE=m_config.save_directory().absoluteFilePath (period_start.toString("yyMMdd_hhmmss"));
|
||||
// qDebug() << "datasink 2" << QDateTime::currentDateTimeUtc().toString("ss.zzz")
|
||||
// << n << period_start.toString("ss.zzz");
|
||||
} else {
|
||||
auto const& period_start = now.addSecs (-(now.time ().minute () % (int(m_TRperiod) / 60)) * 60);
|
||||
m_fnameWE=m_config.save_directory ().absoluteFilePath (period_start.toString ("yyMMdd_hhmm"));
|
||||
@ -2843,6 +2843,8 @@ void MainWindow::decode() //decode()
|
||||
if(m_mode=="ISCAT" or m_mode=="MSK144" or m_bFast9 or m_mode=="FT8" or m_mode=="FT4") {
|
||||
qint64 ms=1000.0*(2.0-m_TRperiod);
|
||||
if(m_mode=="FT4") ms=1000.0*(2.0-m_TRperiod);
|
||||
//Adjust for FT8 early decode:
|
||||
if(m_mode=="FT8" and m_ihsym==m_earlyDecode and !m_diskData) ms+=(m_hsymStop-m_earlyDecode)*288;
|
||||
QDateTime t=QDateTime::currentDateTimeUtc().addMSecs(ms);
|
||||
ihr=t.toString("hh").toInt();
|
||||
imin=t.toString("mm").toInt();
|
||||
@ -2983,6 +2985,7 @@ void MainWindow::decode() //decode()
|
||||
} else {
|
||||
memcpy(to, from, qMin(mem_jt9->size(), size));
|
||||
QFile {m_config.temp_dir ().absoluteFilePath (".lock")}.remove (); // Allow jt9 to start
|
||||
// qDebug() << "aa" << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.s") << m_ihsym;
|
||||
decodeBusy(true);
|
||||
}
|
||||
}
|
||||
@ -3041,6 +3044,7 @@ void MainWindow::decodeDone ()
|
||||
decodeBusy(false);
|
||||
m_RxLog=0;
|
||||
m_blankLine=true;
|
||||
if(m_mode=="FT8" and dec_data.params.nzhsym==m_earlyDecode) m_blankLine=false;
|
||||
if(SpecOp::FOX == m_config.special_op_id()) houndCallers();
|
||||
}
|
||||
|
||||
@ -3048,6 +3052,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
{
|
||||
while(proc_jt9.canReadLine()) {
|
||||
auto line_read = proc_jt9.readLine ();
|
||||
// qDebug() << "cc" << line_read;
|
||||
if (auto p = std::strpbrk (line_read.constData (), "\n\r"))
|
||||
{
|
||||
// truncate before line ending chars
|
||||
|
@ -467,6 +467,7 @@ private:
|
||||
qint32 m_nFoxFreq; //Audio freq at which Hound received a call from Fox
|
||||
qint32 m_nSentFoxRrpt=0; //Serial number for next R+rpt Hound will send to Fox
|
||||
qint32 m_kin0=0;
|
||||
qint32 m_earlyDecode=35;
|
||||
|
||||
bool m_btxok; //True if OK to transmit
|
||||
bool m_diskData;
|
||||
|
Loading…
Reference in New Issue
Block a user