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