2024-02-10 19:51:36 -05:00
|
|
|
subroutine sfox_hard(crcvd,f,t,chansym)
|
2024-01-31 14:02:33 -05:00
|
|
|
|
2024-02-08 10:45:43 -05:00
|
|
|
use sfox_mod
|
|
|
|
! include "sfox_params.f90"
|
2024-01-31 14:02:33 -05:00
|
|
|
complex crcvd(NMAX) !Signal as received
|
|
|
|
complex c(0:NSPS-1) !Work array, one symbol long
|
2024-02-10 13:35:06 -05:00
|
|
|
real s(0:NQ-1) !Power spectrum
|
|
|
|
integer chansym(NN) !Recovered hard-decision symbols
|
2024-01-31 14:02:33 -05:00
|
|
|
integer ipk(1)
|
|
|
|
|
|
|
|
i0=nint(12000.0*t)
|
|
|
|
df=12000.0/NSPS
|
2024-02-10 13:35:06 -05:00
|
|
|
j0=nint(f/df)-NQ/2
|
2024-01-31 14:02:33 -05:00
|
|
|
do n=1,ND !Loop over all symbols
|
|
|
|
ib=n*NSPS + i0
|
|
|
|
if(n.gt.ND1) ib=(NS+n)*NSPS + i0
|
|
|
|
ia=ib-NSPS+1
|
2024-01-31 18:59:41 -05:00
|
|
|
if(ia.lt.1 .or. ib.gt.NMAX) cycle
|
2024-01-31 14:02:33 -05:00
|
|
|
c=crcvd(ia:ib)
|
|
|
|
call four2a(c,NSPS,1,-1,1) !Compute symbol spectrum
|
2024-02-10 13:35:06 -05:00
|
|
|
do j=0,NQ-1
|
|
|
|
s(j)=real(c(j0+j))**2 + aimag(c(j0+j))**2
|
2024-01-31 14:02:33 -05:00
|
|
|
enddo
|
2024-02-10 09:29:57 -05:00
|
|
|
|
|
|
|
! Could we measure fspread, perhaps in the sync routine, and use that to
|
|
|
|
! decide whether to smooth spectra here?
|
|
|
|
! call smo121(s,NSPS) !Helps for LD, HM propagation...
|
|
|
|
! call smo121(s,NSPS)
|
|
|
|
|
2024-02-10 13:35:06 -05:00
|
|
|
ipk=maxloc(s(0:NQ-1))
|
|
|
|
chansym(n)=ipk(1) - 1
|
2024-01-31 14:02:33 -05:00
|
|
|
enddo
|
|
|
|
|
|
|
|
return
|
2024-02-10 19:51:36 -05:00
|
|
|
end subroutine sfox_hard
|