New sync pattern for QRA64; implement fast-fading algorithm for QRA64A-C. Several things in QRA64 still need attention, in addition to submodes D and E!

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7301 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-11-08 20:11:02 +00:00
parent bf8e290bbd
commit 80787c0721
7 changed files with 68 additions and 14 deletions

View File

@ -8,6 +8,7 @@ subroutine genqra64(msg0,ichk,msgsent,itone,itype)
character*22 msgsent !Message as it will be received character*22 msgsent !Message as it will be received
integer itone(84) integer itone(84)
character*3 cok !' ' or 'OOO' character*3 cok !' ' or 'OOO'
logical old_qra_sync
integer dgen(13) integer dgen(13)
integer sent(63) integer sent(63)
integer icos7(0:6) integer icos7(0:6)
@ -39,11 +40,15 @@ subroutine genqra64(msg0,ichk,msgsent,itone,itype)
if(ichk.ne.0) go to 999 !Return if checking only if(ichk.ne.0) go to 999 !Return if checking only
call qra64_enc(dgen,sent) !Encode using QRA64 call qra64_enc(dgen,sent) !Encode using QRA64
itone(1:7)=10*icos7 !Insert 7x7 Costas array in 3 places nsync=10
inquire(file='old_qra_sync',exist=old_qra_sync)
if(old_qra_sync) nsync=1
itone(1:7)=nsync*icos7 !Insert 7x7 Costas array in 3 places
itone(8:39)=sent(1:32) itone(8:39)=sent(1:32)
itone(40:46)=10*icos7 itone(40:46)=nsync*icos7
itone(47:77)=sent(33:63) itone(47:77)=sent(33:63)
itone(78:84)=10*icos7 itone(78:84)=nsync*icos7
endif endif
999 return 999 return

View File

@ -69,3 +69,4 @@ void qra64_dec_(float r[], int* nc1, int* nc2, int* ng2, int* APtype,
#endif #endif
} }
} }

View File

@ -14,7 +14,9 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mode64,mycall_12,hiscall_12, &
real a(3) real a(3)
real dd(NMAX) !Raw data sampled at 12000 Hz real dd(NMAX) !Raw data sampled at 12000 Hz
real s3(LN) !Symbol spectra real s3(LN) !Symbol spectra
real s3a(LN) !Symbol spectra
integer dat4(12) !Decoded message (as 12 integers) integer dat4(12) !Decoded message (as 12 integers)
integer dat4x(12)
data nc1z/-1/,nc2z/-1/,ng2z/-1/ data nc1z/-1/,nc2z/-1/,ng2z/-1/
save save
@ -29,7 +31,7 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mode64,mycall_12,hiscall_12, &
call packgrid(hisgrid,ng2,ltext) call packgrid(hisgrid,ng2,ltext)
nSubmode=nint(log(float(mode64)/log(2.0))) nSubmode=nint(log(float(mode64)/log(2.0)))
b90=1.0 b90=1.0
nFadingModel=1 nFadingModel=0
if(nc1.ne.nc1z .or. nc2.ne.nc2z .or. ng2.ne.ng2z) then if(nc1.ne.nc1z .or. nc2.ne.nc2z .or. ng2.ne.ng2z) then
do naptype=0,5 do naptype=0,5
call qra64_dec(s3,nc1,nc2,ng2,naptype,1,nSubmode,b90, & call qra64_dec(s3,nc1,nc2,ng2,naptype,1,nSubmode,b90, &
@ -47,21 +49,46 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mode64,mycall_12,hiscall_12, &
naptype=4 naptype=4
LL=64*(mode64+2) LL=64*(mode64+2)
NN=63 NN=63
do itry0=1,3 ! do itry0=1,3
do itry0=1,1
idf0=itry0/2 idf0=itry0/2
if(mod(itry0,2).eq.0) idf0=-idf0 if(mod(itry0,2).eq.0) idf0=-idf0
a(1)=-(f0+0.248*(idf0-0.33*kpk)) a(1)=-(f0+0.248*(idf0-0.33*kpk))
nfreq=nint(-a(1)) nfreq=nint(-a(1))
a(3)=0. a(3)=0.
do itry1=1,3 ! do itry1=1,3
do itry1=1,1
idf1=itry1/2 idf1=itry1/2
if(mod(itry1,2).eq.0) idf1=-idf1 if(mod(itry1,2).eq.0) idf1=-idf1
a(2)=-0.67*(idf1 + 0.67*kpk) a(2)=-0.67*(idf1 + 0.67*kpk)
call twkfreq(c00,c0,npts2,4000.0,a) call twkfreq(c00,c0,npts2,4000.0,a)
call spec64(c0,npts2,mode64,jpk,s3,LL,NN) call spec64(c0,npts2,mode64,jpk,s3a,LL,NN)
ircmin=99
do iter=0,10
b90=1.728**iter
s3(1:LL*NN)=s3a(1:LL*NN)
call qra64_dec(s3,nc1,nc2,ng2,naptype,0,nSubmode,b90, & call qra64_dec(s3,nc1,nc2,ng2,naptype,0,nSubmode,b90, &
nFadingModel,dat4,snr2,irc) nFadingModel,dat4,snr2,irc)
decoded=' ' if(abs(snr2).gt.30.) snr2=-30.0
if(irc.eq.0) go to 10
! write(*,3001) iter,b90,snr2,irc
! write(72,3001) iter,b90,snr2,irc
!3001 format(i2,2f7.1,i4)
if(irc.ge.0 .and. irc.le.ircmin) then
dat4x=dat4
b90x=b90
snr2x=snr2
ircmin=irc
endif
enddo
if(ircmin.ne.99) then
dat4=dat4x
b90=b90x
snr2=snr2x
irc=ircmin
endif
10 decoded=' '
! write(73,3001) iter,b90,snr2,irc
if(irc.ge.0) then if(irc.ge.0) then
call unpackmsg(dat4,decoded) !Unpack the user message call unpackmsg(dat4,decoded) !Unpack the user message
call fmtmsg(decoded,iz) call fmtmsg(decoded,iz)

View File

@ -11,7 +11,7 @@ subroutine spec64(c0,npts2,mode64,jpk,s3,LL,NN)
if(j.ge.32) jj=j+14 !Skip middle Costas array if(j.ge.32) jj=j+14 !Skip middle Costas array
ja=jpk + (jj-1)*nfft6 ja=jpk + (jj-1)*nfft6
jb=ja+nfft6-1 jb=ja+nfft6-1
cs(0:nfft6-1)=1.3e-8*c0(ja:jb) cs(0:nfft6-1)=c0(ja:jb)
call four2a(cs,nfft6,1,-1,1) call four2a(cs,nfft6,1,-1,1)
do ii=1,LL do ii=1,LL
i=ii-65 i=ii-65
@ -20,5 +20,12 @@ subroutine spec64(c0,npts2,mode64,jpk,s3,LL,NN)
enddo enddo
enddo enddo
! df=4000.0/nfft6
! do i=1,LL
! freq=(i-65)*df
! write(73,3002) i-65,freq,(1.e-6*s3(i,j),j=1,5)
!3002 format(i5,6f10.3)
! enddo
return return
end subroutine spec64 end subroutine spec64

View File

@ -10,6 +10,7 @@ subroutine sync64(dd,nf1,nf2,nfqso,ntol,mode64,maxf1,dtx,f0,jpk,kpk,snrdb,c0)
real s0(0:NSPC-1) !Sum of s1+s2+s3 real s0(0:NSPC-1) !Sum of s1+s2+s3
real s0a(0:NSPC-1) !Best synchromized spectrum (saved) real s0a(0:NSPC-1) !Best synchromized spectrum (saved)
real s0b(0:NSPC-1) !tmp real s0b(0:NSPC-1) !tmp
logical old_qra_sync
integer icos7(0:6) !Costas 7x7 tones integer icos7(0:6) !Costas 7x7 tones
integer ipk0(1) integer ipk0(1)
complex cc(0:NSPC-1) !Costas waveform complex cc(0:NSPC-1) !Costas waveform
@ -22,12 +23,15 @@ subroutine sync64(dd,nf1,nf2,nfqso,ntol,mode64,maxf1,dtx,f0,jpk,kpk,snrdb,c0)
save save
if(mode64.ne.mode64z) then if(mode64.ne.mode64z) then
nsync=10
inquire(file='old_qra_sync',exist=old_qra_sync)
if(old_qra_sync) nsync=1
twopi=8.0*atan(1.0) twopi=8.0*atan(1.0)
dfgen=mode64*12000.0/6912.0 dfgen=mode64*12000.0/6912.0
k=-1 k=-1
phi=0. phi=0.
do j=0,6 !Compute complex Costas waveform do j=0,6 !Compute complex Costas waveform
dphi=twopi*10.0*icos7(j)*dfgen/4000.0 dphi=twopi*nsync*icos7(j)*dfgen/4000.0
do i=1,2304 do i=1,2304
phi=phi + dphi phi=phi + dphi
if(phi.gt.twopi) phi=phi-twopi if(phi.gt.twopi) phi=phi-twopi

View File

@ -655,6 +655,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
"1 W","2 W","5 W","10 W","20 W","50 W","100 W","200 W","500 W","1 kW"}; "1 W","2 W","5 W","10 W","20 W","50 W","100 W","200 W","500 W","1 kW"};
m_msg[0][0]=0; m_msg[0][0]=0;
m_bQRAsyncWarned=false;
for(int i=0; i<28; i++) { //Initialize dBm values for(int i=0; i<28; i++) { //Initialize dBm values
float dbm=(10.0*i)/3.0 - 30.0; float dbm=(10.0*i)/3.0 - 30.0;
@ -4186,6 +4187,13 @@ void MainWindow::on_actionQRA64_triggered()
ui->sbSubmode->setValue(m_nSubMode); ui->sbSubmode->setValue(m_nSubMode);
ui->actionInclude_averaging->setEnabled(false); ui->actionInclude_averaging->setEnabled(false);
ui->actionInclude_correlation->setEnabled(false); ui->actionInclude_correlation->setEnabled(false);
QFile f(m_appDir + "/old_qra_sync");
if(f.exists() and !m_bQRAsyncWarned) {
MessageBox::warning_message (this, tr ("*** WARNING *** "),
"Using old QRA64 sync pattern.");
m_bQRAsyncWarned=true;
}
} }
void MainWindow::on_actionISCAT_triggered() void MainWindow::on_actionISCAT_triggered()

View File

@ -422,6 +422,8 @@ private:
bool m_bFastDone; bool m_bFastDone;
bool m_bAltV; bool m_bAltV;
bool m_bNoMoreFiles; bool m_bNoMoreFiles;
bool m_bQRAsyncWarned;
float m_pctZap; float m_pctZap;
int m_ihsym; int m_ihsym;
int m_nzap; int m_nzap;