mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-24 02:12:37 -04:00
Tx may now be correct for B2, C2 modes. Still working on decoder.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@2548 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
fce75f9d07
commit
b689f177fe
@ -54,7 +54,7 @@ subroutine decode0(dd,ss,savg,nstandalone)
|
|||||||
call map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, &
|
call map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, &
|
||||||
mousedf,mousefqso,nagain,ndecdone,ndiskdat,nfshift,ndphi, &
|
mousedf,mousefqso,nagain,ndecdone,ndiskdat,nfshift,ndphi, &
|
||||||
nfcal,nkeep,mcall3b,nsum,nsave,nxant,rmsdd,mycall,mygrid, &
|
nfcal,nkeep,mcall3b,nsum,nsave,nxant,rmsdd,mycall,mygrid, &
|
||||||
neme,ndepth,hiscall,hisgrid,nhsym,nfsample,nxpol,mode65)
|
neme,ndepth,hiscall,hisgrid,nhsym,nfsample,nxpol,mode65,nfast)
|
||||||
|
|
||||||
call timer('map65a ',1)
|
call timer('map65a ',1)
|
||||||
call timer('decode0 ',1)
|
call timer('decode0 ',1)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
subroutine gen65(message,mode65,samfac,nsendingsh,msgsent,iwave,nwave)
|
subroutine gen65(message,mode65,nfast,samfac,nsendingsh,msgsent,iwave,nwave)
|
||||||
|
|
||||||
! Encodes a JT65 message into a wavefile.
|
! Encodes a JT65 message into a wavefile.
|
||||||
! Executes in 17 ms on opti-745.
|
! Executes in 17 ms on opti-745.
|
||||||
@ -41,9 +41,9 @@ subroutine gen65(message,mode65,samfac,nsendingsh,msgsent,iwave,nwave)
|
|||||||
call interleave63(sent,1) !Apply interleaving
|
call interleave63(sent,1) !Apply interleaving
|
||||||
call graycode(sent,63,1) !Apply Gray code
|
call graycode(sent,63,1) !Apply Gray code
|
||||||
nsym=126 !Symbols per transmission
|
nsym=126 !Symbols per transmission
|
||||||
nsps=4096
|
nsps=4096/nfast
|
||||||
else
|
else
|
||||||
nsym=32
|
nsym=32/nfast
|
||||||
nsps=16384
|
nsps=16384
|
||||||
nsendingsh=1 !Flag for shorthand message
|
nsendingsh=1 !Flag for shorthand message
|
||||||
endif
|
endif
|
||||||
|
@ -20,12 +20,12 @@ program m65
|
|||||||
nfast,nsave,mycall,mygrid,hiscall,hisgrid,datetime
|
nfast,nsave,mycall,mygrid,hiscall,hisgrid,datetime
|
||||||
|
|
||||||
nargs=iargc()
|
nargs=iargc()
|
||||||
if(nargs.lt.1) then
|
if(nargs.lt.1 .or. nargs.eq.2) then
|
||||||
print*,'Usage: m65 [95238] file1 [file2 ...]'
|
print*,'Usage: m65 <submode> <95238|96000> file1 [file2 ...]'
|
||||||
print*,' Reads data from *.tf2 files.'
|
print*,' (Reads data from *.tf2 files.)'
|
||||||
print*,''
|
print*,''
|
||||||
print*,' m65 -s'
|
print*,' m65 -s'
|
||||||
print*,' Gets data from shared memory region.'
|
print*,' (Gets data from MAP65, via shared memory region.)'
|
||||||
go to 999
|
go to 999
|
||||||
endif
|
endif
|
||||||
call getarg(1,arg)
|
call getarg(1,arg)
|
||||||
@ -34,16 +34,20 @@ program m65
|
|||||||
call ftnquit
|
call ftnquit
|
||||||
go to 999
|
go to 999
|
||||||
endif
|
endif
|
||||||
|
if(arg(1:1).eq.'A') mode65=1
|
||||||
|
if(arg(1:1).eq.'B') mode65=2
|
||||||
|
if(arg(1:1).eq.'C') mode65=4
|
||||||
|
nfast=1
|
||||||
|
if(arg(2:2).eq.'2') nfast=2
|
||||||
nfsample=96000
|
nfsample=96000
|
||||||
nxpol=1
|
call getarg(2,arg)
|
||||||
mode65=2
|
|
||||||
ifile1=1
|
|
||||||
if(arg.eq.'95238') then
|
if(arg.eq.'95238') then
|
||||||
nfsample=95238
|
nfsample=95238
|
||||||
call getarg(2,arg)
|
call getarg(3,arg)
|
||||||
ifile1=2
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
nxpol=1
|
||||||
|
ifile1=3
|
||||||
limtrace=0
|
limtrace=0
|
||||||
lu=12
|
lu=12
|
||||||
nfa=100
|
nfa=100
|
||||||
@ -69,7 +73,7 @@ program m65
|
|||||||
k=0
|
k=0
|
||||||
fcenter=144.125d0
|
fcenter=144.125d0
|
||||||
mousedf=0
|
mousedf=0
|
||||||
mousefqso=125
|
mousefqso=126
|
||||||
newdat=1
|
newdat=1
|
||||||
mycall='K1JT'
|
mycall='K1JT'
|
||||||
|
|
||||||
@ -95,8 +99,8 @@ program m65
|
|||||||
! Emit signal readyForFFT
|
! Emit signal readyForFFT
|
||||||
call timer('symspec ',0)
|
call timer('symspec ',0)
|
||||||
fgreen=-13.0
|
fgreen=-13.0
|
||||||
iqadjust=1
|
iqadjust=0
|
||||||
iqapply=1
|
iqapply=0
|
||||||
nbslider=100
|
nbslider=100
|
||||||
gainx=0.9962
|
gainx=0.9962
|
||||||
gainy=1.0265
|
gainy=1.0265
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, &
|
subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, &
|
||||||
mousedf,mousefqso,nagain,ndecdone,ndiskdat,nfshift,ndphi, &
|
mousedf,mousefqso,nagain,ndecdone,ndiskdat,nfshift,ndphi, &
|
||||||
nfcal,nkeep,mcall3b,nsum,nsave,nxant,rmsdd,mycall,mygrid, &
|
nfcal,nkeep,mcall3b,nsum,nsave,nxant,rmsdd,mycall,mygrid, &
|
||||||
neme,ndepth,hiscall,hisgrid,nhsym,nfsample,nxpol,mode65)
|
neme,ndepth,hiscall,hisgrid,nhsym,nfsample,nxpol,mode65,nfast)
|
||||||
|
|
||||||
! Processes timf2 data from Linrad to find and decode JT65 signals.
|
! Processes timf2 data from Linrad to find and decode JT65 signals.
|
||||||
|
|
||||||
|
@ -57,8 +57,8 @@ program mapsim
|
|||||||
open(12,file='msgs.txt',status='old')
|
open(12,file='msgs.txt',status='old')
|
||||||
|
|
||||||
write(*,1000)
|
write(*,1000)
|
||||||
1000 format(' N freq S/N pol Message'/ &
|
1000 format('File N freq S/N pol Message'/ &
|
||||||
'-----------------------------------------------')
|
'---------------------------------------------------')
|
||||||
|
|
||||||
do ifile=1,nfiles
|
do ifile=1,nfiles
|
||||||
nmin=ifile-1
|
nmin=ifile-1
|
||||||
@ -93,8 +93,8 @@ program mapsim
|
|||||||
snrdbx=snrdb
|
snrdbx=snrdb
|
||||||
if(snrdb.ge.-1.0) snrdbx=-15.0 - 15.0*(isig-1.0)/nsigs
|
if(snrdb.ge.-1.0) snrdbx=-15.0 - 15.0*(isig-1.0)/nsigs
|
||||||
sig=sqrt(2.2*2500.0/96000.0) * 10.0**(0.05*snrdbx)
|
sig=sqrt(2.2*2500.0/96000.0) * 10.0**(0.05*snrdbx)
|
||||||
write(*,1020) isig,0.001*f,snrdbx,nint(pol),msgsent
|
write(*,1020) ifile,isig,0.001*f,snrdbx,nint(pol),msgsent
|
||||||
1020 format(i3,f8.3,f7.1,i5,2x,a22)
|
1020 format(i3,i4,f8.3,f7.1,i5,2x,a22)
|
||||||
|
|
||||||
phi=0.
|
phi=0.
|
||||||
i0=fsample*(3.5d0+0.05d0*(isig-1))
|
i0=fsample*(3.5d0+0.05d0*(isig-1))
|
||||||
|
@ -1354,7 +1354,7 @@ void MainWindow::guiUpdate()
|
|||||||
int khsym=0;
|
int khsym=0;
|
||||||
|
|
||||||
double tx1=0.0;
|
double tx1=0.0;
|
||||||
double tx2=126.0*4096.0/11025.0 + 1.8; //### depend on TxDelay? ###
|
double tx2=126.0*4096.0/(m_nfast*11025.0) + 1.8; //### depend on TxDelay?
|
||||||
|
|
||||||
if(!m_txFirst) {
|
if(!m_txFirst) {
|
||||||
tx1 += m_TRperiod;
|
tx1 += m_TRperiod;
|
||||||
@ -1363,8 +1363,8 @@ void MainWindow::guiUpdate()
|
|||||||
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
|
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
|
||||||
int nsec=ms/1000;
|
int nsec=ms/1000;
|
||||||
double tsec=0.001*ms;
|
double tsec=0.001*ms;
|
||||||
double t120=fmod(tsec,120.0);
|
double t2p=fmod(tsec,120.0/m_nfast);
|
||||||
bool bTxTime = t120 >= tx1 && t120 < tx2;
|
bool bTxTime = t2p >= tx1 && t2p < tx2;
|
||||||
|
|
||||||
if(m_auto) {
|
if(m_auto) {
|
||||||
if(bTxTime and iptt==0 and !m_txMute) {
|
if(bTxTime and iptt==0 and !m_txMute) {
|
||||||
@ -1399,9 +1399,11 @@ void MainWindow::guiUpdate()
|
|||||||
ba2msg(ba,message);
|
ba2msg(ba,message);
|
||||||
int len1=22;
|
int len1=22;
|
||||||
int mode65=m_mode65;
|
int mode65=m_mode65;
|
||||||
|
int nfast=m_nfast;
|
||||||
double samfac=1.0;
|
double samfac=1.0;
|
||||||
|
|
||||||
gen65_(message,&mode65,&samfac,&nsendingsh,msgsent,iwave,&nwave,len1,len1);
|
gen65_(message,&mode65,&nfast,&samfac,&nsendingsh,msgsent,iwave,
|
||||||
|
&nwave,len1,len1);
|
||||||
msgsent[22]=0;
|
msgsent[22]=0;
|
||||||
|
|
||||||
if(m_restart) {
|
if(m_restart) {
|
||||||
@ -1819,7 +1821,9 @@ void MainWindow::msgtype(QString t, QLineEdit* tx) //msgtype()
|
|||||||
int i1=t.indexOf(" OOO");
|
int i1=t.indexOf(" OOO");
|
||||||
QByteArray s=t.toUpper().toLocal8Bit();
|
QByteArray s=t.toUpper().toLocal8Bit();
|
||||||
ba2msg(s,message);
|
ba2msg(s,message);
|
||||||
gen65_(message,&mode65,&samfac,&nsendingsh,msgsent,iwave,&mwave,len1,len1);
|
int nfast=m_nfast;
|
||||||
|
gen65_(message,&mode65,&nfast,&samfac,&nsendingsh,msgsent,iwave,
|
||||||
|
&mwave,len1,len1);
|
||||||
|
|
||||||
QPalette p(tx->palette());
|
QPalette p(tx->palette());
|
||||||
if(nsendingsh==1) {
|
if(nsendingsh==1) {
|
||||||
@ -1990,6 +1994,7 @@ void MainWindow::on_actionJT65B2_triggered()
|
|||||||
m_nfast=2;
|
m_nfast=2;
|
||||||
m_TRperiod=30;
|
m_TRperiod=30;
|
||||||
soundInThread.setPeriod(m_TRperiod);
|
soundInThread.setPeriod(m_TRperiod);
|
||||||
|
soundOutThread.setPeriod(m_TRperiod);
|
||||||
g_pWideGraph->setMode65(m_mode65);
|
g_pWideGraph->setMode65(m_mode65);
|
||||||
lab5->setText(m_mode);
|
lab5->setText(m_mode);
|
||||||
ui->actionJT65B2->setChecked(true);
|
ui->actionJT65B2->setChecked(true);
|
||||||
@ -2002,6 +2007,7 @@ void MainWindow::on_actionJT65C2_triggered()
|
|||||||
m_nfast=2;
|
m_nfast=2;
|
||||||
m_TRperiod=30;
|
m_TRperiod=30;
|
||||||
soundInThread.setPeriod(m_TRperiod);
|
soundInThread.setPeriod(m_TRperiod);
|
||||||
|
soundOutThread.setPeriod(m_TRperiod);
|
||||||
g_pWideGraph->setMode65(m_mode65);
|
g_pWideGraph->setMode65(m_mode65);
|
||||||
lab5->setText(m_mode);
|
lab5->setText(m_mode);
|
||||||
ui->actionJT65C2->setChecked(true);
|
ui->actionJT65C2->setChecked(true);
|
||||||
|
@ -274,8 +274,9 @@ extern "C" {
|
|||||||
float* py, float s[], int* nkhz, int* nhsym, int* nzap,
|
float* py, float s[], int* nkhz, int* nhsym, int* nzap,
|
||||||
float* slimit, uchar lstrong[]);
|
float* slimit, uchar lstrong[]);
|
||||||
|
|
||||||
void gen65_(char* msg, int* mode65, double* samfac, int* nsendingsh,
|
void gen65_(char* msg, int* mode65, int* nfast, double* samfac,
|
||||||
char* msgsent, short iwave[], int* nwave, int len1, int len2);
|
int* nsendingsh, char* msgsent, short iwave[], int* nwave,
|
||||||
|
int len1, int len2);
|
||||||
|
|
||||||
int ptt_(int* nport, int* itx, int* iptt);
|
int ptt_(int* nport, int* itx, int* iptt);
|
||||||
}
|
}
|
||||||
|
12
soundout.cpp
12
soundout.cpp
@ -30,7 +30,7 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer,
|
|||||||
unsigned int i,n;
|
unsigned int i,n;
|
||||||
static int ic=0;
|
static int ic=0;
|
||||||
static bool btxok0=false;
|
static bool btxok0=false;
|
||||||
static int nminStart=0;
|
static int nStart=0;
|
||||||
double tsec,tstart;
|
double tsec,tstart;
|
||||||
int nsec;
|
int nsec;
|
||||||
int nTRperiod=udata->nTRperiod;
|
int nTRperiod=udata->nTRperiod;
|
||||||
@ -45,12 +45,12 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer,
|
|||||||
tstart=tsec - n*nTRperiod - 1.0;
|
tstart=tsec - n*nTRperiod - 1.0;
|
||||||
|
|
||||||
if(tstart<1.0) {
|
if(tstart<1.0) {
|
||||||
ic=0; //Start of minute, set starting index to 0
|
ic=0; //Start of Tx cycle, set starting index to 0
|
||||||
nminStart=n;
|
nStart=n;
|
||||||
} else {
|
} else {
|
||||||
if(n != nminStart) { //Late start in new minute: compute starting index
|
if(n != nStart) { //Late start in new Tx cycle: compute starting index
|
||||||
ic=(int)(tstart*11025.0);
|
ic=(int)(tstart*11025.0);
|
||||||
nminStart=n;
|
nStart=n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,14 +95,12 @@ void SoundOutThread::run()
|
|||||||
outParam.hostApiSpecificStreamInfo=NULL;
|
outParam.hostApiSpecificStreamInfo=NULL;
|
||||||
|
|
||||||
udata.nTRperiod=m_TRperiod;
|
udata.nTRperiod=m_TRperiod;
|
||||||
|
|
||||||
paerr=Pa_IsFormatSupported(NULL,&outParam,11025.0);
|
paerr=Pa_IsFormatSupported(NULL,&outParam,11025.0);
|
||||||
if(paerr<0) {
|
if(paerr<0) {
|
||||||
qDebug() << "PortAudio says requested output format not supported.";
|
qDebug() << "PortAudio says requested output format not supported.";
|
||||||
qDebug() << paerr;
|
qDebug() << paerr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
paerr=Pa_OpenStream(&outStream, //Output stream
|
paerr=Pa_OpenStream(&outStream, //Output stream
|
||||||
NULL, //No input parameters
|
NULL, //No input parameters
|
||||||
&outParam, //Output parameters
|
&outParam, //Output parameters
|
||||||
|
Loading…
x
Reference in New Issue
Block a user