2012-10-03 14:39:37 -04:00
|
|
|
subroutine spec9(c0,npts8,nsps,f0a,fpk,xdt,i1SoftSymbols)
|
2012-10-02 14:08:44 -04:00
|
|
|
|
|
|
|
parameter (MAXFFT=31500)
|
|
|
|
complex c0(0:npts8-1)
|
2012-10-03 12:42:48 -04:00
|
|
|
real ssym(0:7,69)
|
2012-10-02 14:08:44 -04:00
|
|
|
complex c(0:MAXFFT-1)
|
2012-10-03 08:39:07 -04:00
|
|
|
integer*1 i1SoftSymbolsScrambled(207)
|
|
|
|
integer*1 i1SoftSymbols(207)
|
2012-10-03 12:31:47 -04:00
|
|
|
integer isync(85) !Sync vector
|
|
|
|
data isync/ &
|
|
|
|
1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0, &
|
|
|
|
1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0, &
|
|
|
|
0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0, &
|
|
|
|
0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0, &
|
|
|
|
1,0,0,0,1/
|
2012-10-02 14:08:44 -04:00
|
|
|
integer ii(16) !Locations of sync symbols
|
|
|
|
data ii/1,6,11,16,21,26,31,39,45,51,57,63,69,75,81,85/
|
2012-10-03 08:39:07 -04:00
|
|
|
integer ig(0:7)
|
2012-10-03 12:31:47 -04:00
|
|
|
data ig/0,1,3,2,7,6,4,5/ !Gray code removal
|
|
|
|
save
|
2012-10-02 14:08:44 -04:00
|
|
|
|
2012-10-03 12:31:47 -04:00
|
|
|
nsps8=nsps/8
|
2012-10-03 13:47:55 -04:00
|
|
|
foffset=fpk-f0a
|
|
|
|
istart=1520
|
|
|
|
|
2012-10-03 14:39:37 -04:00
|
|
|
call peakdf9(c0,npts8,nsps8,istart,foffset,idf)
|
|
|
|
fpk=fpk + idf*0.1*1500.0/nsps8
|
|
|
|
foffset=foffset + idf*0.1*1500.0/nsps8
|
2012-10-03 13:47:55 -04:00
|
|
|
call peakdt9(c0,npts8,nsps8,istart,foffset,idt)
|
2012-10-03 14:39:37 -04:00
|
|
|
istart=istart + 0.0625*nsps8*idt
|
|
|
|
xdt=istart/1500.0 - 1.0
|
|
|
|
! write(*,3002) 0.0625*nsps8*idt/1500.0,idf*0.1*1500.0/nsps8
|
|
|
|
!3002 format(2f8.2)
|
2012-10-02 14:08:44 -04:00
|
|
|
|
2012-10-03 14:39:37 -04:00
|
|
|
|
|
|
|
fshift=foffset
|
2012-10-02 14:08:44 -04:00
|
|
|
twopi=8.0*atan(1.0)
|
|
|
|
dphi=twopi*fshift/1500.0
|
2012-10-03 12:31:47 -04:00
|
|
|
|
2012-10-02 14:08:44 -04:00
|
|
|
nfft=nsps8
|
|
|
|
nsym=min((npts8-istart)/nsps8,85)
|
|
|
|
|
2012-10-03 12:42:48 -04:00
|
|
|
k=0
|
2012-10-03 12:31:47 -04:00
|
|
|
do j=1,nsym
|
2012-10-03 12:42:48 -04:00
|
|
|
if(isync(j).eq.1) cycle
|
|
|
|
k=k+1
|
2012-10-03 12:31:47 -04:00
|
|
|
ia=(j-1)*nsps8 + istart
|
2012-10-02 14:08:44 -04:00
|
|
|
ib=ia+nsps8-1
|
|
|
|
c(0:nfft-1)=c0(ia:ib)
|
|
|
|
|
|
|
|
phi=0.
|
|
|
|
do i=0,nfft-1
|
|
|
|
phi=phi + dphi
|
|
|
|
c(i)=c(i) * cmplx(cos(phi),-sin(phi))
|
|
|
|
enddo
|
|
|
|
|
|
|
|
call four2a(c,nfft,1,-1,1)
|
|
|
|
do i=0,nfft-1
|
|
|
|
sx=real(c(i))**2 + aimag(c(i))**2
|
2012-10-03 12:42:48 -04:00
|
|
|
if(i.ge.1 .and. i.le.8) ssym(ig(i-1),k)=sx
|
2012-10-02 14:08:44 -04:00
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
m0=3
|
|
|
|
ntones=8
|
|
|
|
k=0
|
2012-10-03 12:42:48 -04:00
|
|
|
do j=1,69
|
2012-10-02 14:08:44 -04:00
|
|
|
do m=m0-1,0,-1 !Get bit-wise soft symbols
|
|
|
|
n=2**m
|
|
|
|
r1=0.
|
|
|
|
r2=0.
|
2012-10-03 08:39:07 -04:00
|
|
|
do i=0,ntones-1
|
2012-10-02 14:08:44 -04:00
|
|
|
if(iand(i,n).ne.0) then
|
2012-10-03 12:42:48 -04:00
|
|
|
r1=max(r1,ssym(i,j))
|
2012-10-02 14:08:44 -04:00
|
|
|
else
|
2012-10-03 12:42:48 -04:00
|
|
|
r2=max(r2,ssym(i,j))
|
2012-10-02 14:08:44 -04:00
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
k=k+1
|
2012-10-03 08:39:07 -04:00
|
|
|
i1SoftSymbolsScrambled(k)=min(127,max(-127,nint(10.0*(r1-r2)))) + 128
|
2012-10-02 14:08:44 -04:00
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
2012-10-03 08:39:07 -04:00
|
|
|
call interleave9(i1SoftSymbolsScrambled,-1,i1SoftSymbols)
|
2012-10-02 14:08:44 -04:00
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine spec9
|