QRA64 decoder is now basically functional with qra64_decode_fastfading(). Currently only submode A. More to come...

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7299 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-11-07 16:47:40 +00:00
parent 0df350262e
commit fe0aa5f9a6
3 changed files with 22 additions and 33 deletions

View File

@ -43,6 +43,9 @@ void qra64_dec_(float r[], int* nc1, int* nc2, int* ng2, int* APtype,
static int nc1z=-1;
float EbNodBEstimated;
int err=0;
int nSubmode=0;
int nFadingModel=1;
float b90=1.0;
#ifdef NICO_WANTS_SNR_DUMP
FILE *fout;
@ -53,7 +56,9 @@ void qra64_dec_(float r[], int* nc1, int* nc2, int* ng2, int* APtype,
if(err<0) printf("ERROR: qra64_apset returned %d\n",err);
if(*iset==0) {
*rc = qra64_decode(pqra64codec,&EbNodBEstimated,xdec,r);
// *rc = qra64_decode(pqra64codec,&EbNodBEstimated,xdec,r);
*rc = qra64_decode_fastfading(pqra64codec,&EbNodBEstimated,xdec,r,
nSubmode,b90,nFadingModel);
*snr = EbNodBEstimated - 31.0;
#ifdef NICO_WANTS_SNR_DUMP

View File

@ -2,7 +2,7 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mode64,mycall_12,hiscall_12, &
hisgrid_6,sync,nsnr,dtx,nfreq,decoded,nft)
use packjt
parameter (NFFT=2*6912,NZ=5760,NMAX=60*12000)
parameter (NFFT=2*6912,NZ=5760,NMAX=60*12000,LN=1152*63)
character decoded*22
character*12 mycall_12,hiscall_12
character*6 mycall,hiscall,hisgrid_6
@ -13,7 +13,7 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mode64,mycall_12,hiscall_12, &
! integer*8 count0,count1,clkfreq
real a(3)
real dd(NMAX) !Raw data sampled at 12000 Hz
real s3(0:63,1:63) !Symbol spectra
real s3(LN) !Symbol spectra
integer dat4(12) !Decoded message (as 12 integers)
data nc1z/-1/,nc2z/-1/,ng2z/-1/
save
@ -41,6 +41,8 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mode64,mycall_12,hiscall_12, &
npts2=216000
naptype=4
LL=64*(mode64+2)
NN=63
do itry0=1,3
idf0=itry0/2
if(mod(itry0,2).eq.0) idf0=-idf0
@ -52,7 +54,7 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mode64,mycall_12,hiscall_12, &
if(mod(itry1,2).eq.0) idf1=-idf1
a(2)=-0.67*(idf1 + 0.67*kpk)
call twkfreq(c00,c0,npts2,4000.0,a)
call spec64(c0,npts2,mode64,jpk,s3)
call spec64(c0,npts2,mode64,jpk,s3,LL,NN)
call qra64_dec(s3,nc1,nc2,ng2,naptype,0,dat4,snr2,irc)
decoded=' '
if(irc.ge.0) then

View File

@ -1,42 +1,24 @@
subroutine spec64(c0,npts2,mode64,jpk,s3a)
subroutine spec64(c0,npts2,mode64,jpk,s3,LL,NN)
parameter (NSPS=2304) !Samples per symbol at 4000 Hz
complex c0(0:360000) !Complex spectrum of dd()
complex cs(0:NSPS-1) !Complex symbol spectrum
real s3a(0:63,1:63) !Synchronized symbol spectra
real s3(LL,NN) !Synchronized symbol spectra
nfft4=221184
c0(npts2:)=0.
call four2a(c0,nfft4,1,-1,1) !Forward c2c
ndown=16/mode64
nfft5=nfft4/ndown
npts3=npts2/ndown
call four2a(c0,nfft5,1,1,1) !Inverse c2c, downsampled
nfft6=nsps/ndown
fsample=4000.0/ndown
nfft6=nsps
fsample=4000.0
df=fsample/nfft6
jpkd=nint(float(jpk)/ndown)
do j=1,63
jj=j+7 !Skip first Costas array
if(j.ge.32) jj=j+14 !Skip middle Costas array
ja=jpkd + (jj-1)*nfft6
jj=j+7 !Skip first Costas array
if(j.ge.32) jj=j+14 !Skip middle Costas array
ja=jpk + (jj-1)*nfft6
jb=ja+nfft6-1
cs(0:nfft6-1)=1.3e-8*c0(ja:jb)
call four2a(cs,nfft6,1,-1,1)
ia=-mode64/2 - mode64
do ii=0,63
ia=ia+mode64
ib=ia+mode64-1
s=0.
do i=ia,ib
if(i.ge.0) then
s=s + real(cs(i))**2 + aimag(cs(i))**2
else
s=s + real(cs(nfft6+i))**2 + aimag(cs(nfft6+i))**2
endif
enddo
s3a(ii,j)=s/mode64
do ii=1,LL
i=ii-65
if(i.lt.0) i=i+nfft6
s3(ii,j)=real(cs(i))**2 + aimag(cs(i))**2
enddo
enddo