mirror of https://github.com/pavel-demin/ft8d.git
set sample rate to 6000
This commit is contained in:
parent
60c33e05cf
commit
c18015f19d
|
@ -6,13 +6,13 @@ subroutine baseline(s,nfa,nfb,sbase)
|
||||||
|
|
||||||
include 'ft8_params.f90'
|
include 'ft8_params.f90'
|
||||||
implicit real*8 (a-h,o-z)
|
implicit real*8 (a-h,o-z)
|
||||||
real*4 s(NSPS)
|
real*4 s(NFFT1)
|
||||||
real*4 sbase(NSPS)
|
real*4 sbase(NFFT1)
|
||||||
real*4 base
|
real*4 base
|
||||||
real*8 x(1000),y(1000),a(5)
|
real*8 x(1000),y(1000),a(5)
|
||||||
data nseg/10/,npct/10/
|
data nseg/10/,npct/10/
|
||||||
|
|
||||||
df=12000.0/NFFT1 !3.125 Hz
|
df=6000.0/NFFT1 !3.125 Hz
|
||||||
ia=max(1,nint(nfa/df))
|
ia=max(1,nint(nfa/df))
|
||||||
ib=nint(nfb/df)
|
ib=nint(nfb/df)
|
||||||
do i=ia,ib
|
do i=ia,ib
|
||||||
|
|
|
@ -2,12 +2,12 @@ subroutine ft8_downsample(dd,newdat,f0,c1)
|
||||||
|
|
||||||
! Downconvert to complex data sampled at 200 Hz ==> 32 samples/symbol
|
! Downconvert to complex data sampled at 200 Hz ==> 32 samples/symbol
|
||||||
|
|
||||||
parameter (NMAX=15*12000,NSPS=1920)
|
parameter (NMAX=15*6000,NSPS=960)
|
||||||
parameter (NFFT1=192000,NFFT2=3200) !192000/60 = 3200
|
parameter (NFFT1=96000,NFFT2=3200) !96000/30 = 3200
|
||||||
|
|
||||||
logical newdat
|
logical newdat
|
||||||
complex c1(0:NFFT2-1)
|
complex c1(0:NFFT2-1)
|
||||||
complex cx(0:NFFT1/2)
|
complex cx(0:NFFT1)
|
||||||
complex dd(NMAX),x(NFFT1)
|
complex dd(NMAX),x(NFFT1)
|
||||||
equivalence (x,cx)
|
equivalence (x,cx)
|
||||||
save cx
|
save cx
|
||||||
|
@ -20,12 +20,17 @@ subroutine ft8_downsample(dd,newdat,f0,c1)
|
||||||
newdat=.false.
|
newdat=.false.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
df=12000.0/NFFT1
|
if(f0.lt.3000.0) then
|
||||||
baud=12000.0/NSPS
|
f=f0+3000.0
|
||||||
i0=nint(f0/df)
|
else
|
||||||
ft=f0+8.0*baud
|
f=f0-3000.0
|
||||||
it=min(nint(ft/df),NFFT1/2)
|
endif
|
||||||
fb=f0-1.0*baud
|
df=6000.0/NFFT1
|
||||||
|
baud=6000.0/NSPS
|
||||||
|
i0=nint(f/df)
|
||||||
|
ft=f+8.0*baud
|
||||||
|
it=min(nint(ft/df),NFFT1)
|
||||||
|
fb=f-1.0*baud
|
||||||
ib=max(1,nint(fb/df))
|
ib=max(1,nint(fb/df))
|
||||||
k=0
|
k=0
|
||||||
c1=0.
|
c1=0.
|
||||||
|
|
|
@ -3,10 +3,10 @@ parameter (KK=87) !Information bits (75 + CRC12)
|
||||||
parameter (ND=58) !Data symbols
|
parameter (ND=58) !Data symbols
|
||||||
parameter (NS=21) !Sync symbols (3 @ Costas 7x7)
|
parameter (NS=21) !Sync symbols (3 @ Costas 7x7)
|
||||||
parameter (NN=NS+ND) !Total channel symbols (79)
|
parameter (NN=NS+ND) !Total channel symbols (79)
|
||||||
parameter (NSPS=1920) !Samples per symbol at 12000 S/s
|
parameter (NSPS=960) !Samples per symbol at 6000 S/s
|
||||||
parameter (NZ=NSPS*NN) !Samples in full 15 s waveform (151,680)
|
parameter (NZ=NSPS*NN) !Samples in full 15 s waveform (75,840)
|
||||||
parameter (NMAX=15*12000) !Samples in iwave (180,000)
|
parameter (NMAX=15*6000) !Samples in iwave (90,000)
|
||||||
parameter (NFFT1=2*NSPS, NH1=NFFT1/2) !Length of FFTs for symbol spectra
|
parameter (NFFT1=2*NSPS, NH1=NFFT1/2) !Length of FFTs for symbol spectra
|
||||||
parameter (NSTEP=NSPS/4) !Rough time-sync step size
|
parameter (NSTEP=NSPS/4) !Rough time-sync step size
|
||||||
parameter (NHSYM=NMAX/NSTEP-3) !Number of symbol spectra (1/4-sym steps)
|
parameter (NHSYM=NMAX/NSTEP-3) !Number of symbol spectra (1/4-sym steps)
|
||||||
parameter (NDOWN=60) !Downsample factor
|
parameter (NDOWN=30) !Downsample factor
|
||||||
|
|
2
ft8b.f90
2
ft8b.f90
|
@ -76,7 +76,7 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
||||||
|
|
||||||
max_iterations=30
|
max_iterations=30
|
||||||
nharderrors=-1
|
nharderrors=-1
|
||||||
fs2=12000.0/NDOWN
|
fs2=6000.0/NDOWN
|
||||||
dt2=1.0/fs2
|
dt2=1.0/fs2
|
||||||
twopi=8.0*atan(1.0)
|
twopi=8.0*atan(1.0)
|
||||||
delfbest=0.
|
delfbest=0.
|
||||||
|
|
21
ft8d.f90
21
ft8d.f90
|
@ -7,9 +7,10 @@ program ft8d
|
||||||
character*22 allmessages(100)
|
character*22 allmessages(100)
|
||||||
character*12 mycall12,hiscall12
|
character*12 mycall12,hiscall12
|
||||||
character*6 mygrid6,hisgrid6
|
character*6 mygrid6,hisgrid6
|
||||||
real s(NH1,NHSYM)
|
real s(NFFT1,NHSYM)
|
||||||
real sbase(NH1)
|
real sbase(NFFT1)
|
||||||
real candidate(3,200)
|
real candidate(3,200)
|
||||||
|
real*8 dialfreq
|
||||||
complex dd(NMAX)
|
complex dd(NMAX)
|
||||||
logical newdat,lsubtract,ldupe,bcontest
|
logical newdat,lsubtract,ldupe,bcontest
|
||||||
integer apsym(KK)
|
integer apsym(KK)
|
||||||
|
@ -24,20 +25,20 @@ program ft8d
|
||||||
nfiles=nargs
|
nfiles=nargs
|
||||||
|
|
||||||
twopi=8.0*atan(1.0)
|
twopi=8.0*atan(1.0)
|
||||||
fs=12000.0 !Sample rate
|
fs=6000.0 !Sample rate
|
||||||
dt=1.0/fs !Sample interval (s)
|
dt=1.0/fs !Sample interval (s)
|
||||||
tt=NSPS*dt !Duration of "itone" symbols (s)
|
tt=NSPS*dt !Duration of "itone" symbols (s)
|
||||||
ts=2*NSPS*dt !Duration of OQPSK symbols (s)
|
ts=2*NSPS*dt !Duration of OQPSK symbols (s)
|
||||||
baud=1.0/tt !Keying rate (baud)
|
baud=1.0/tt !Keying rate (baud)
|
||||||
txt=NZ*dt !Transmission length (s)
|
txt=NZ*dt !Transmission length (s)
|
||||||
nfa=100
|
nfa=-2000
|
||||||
nfb=3000
|
nfb=+2000
|
||||||
nfqso=1500
|
nfqso=0
|
||||||
|
|
||||||
do ifile=1,nfiles
|
do ifile=1,nfiles
|
||||||
call getarg(ifile,infile)
|
call getarg(ifile,infile)
|
||||||
open(10,file=infile,status='old',access='stream')
|
open(10,file=infile,status='old',access='stream')
|
||||||
read(10,end=999) dd
|
read(10,end=999) dialfreq,dd
|
||||||
close(10)
|
close(10)
|
||||||
j2=index(infile,'.c2')
|
j2=index(infile,'.c2')
|
||||||
read(infile(j2-6:j2-1),*) nutc
|
read(infile(j2-6:j2-1),*) nutc
|
||||||
|
@ -61,14 +62,14 @@ program ft8d
|
||||||
if((ndecodes-n2).eq.0) cycle
|
if((ndecodes-n2).eq.0) cycle
|
||||||
lsubtract=.false.
|
lsubtract=.false.
|
||||||
endif
|
endif
|
||||||
call sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
|
call sync8(dd,nfa+3000,nfb+3000,syncmin,nfqso+3000,s,candidate,ncand,sbase)
|
||||||
do icand=1,ncand
|
do icand=1,ncand
|
||||||
sync=candidate(3,icand)
|
sync=candidate(3,icand)
|
||||||
f1=candidate(1,icand)
|
f1=candidate(1,icand)
|
||||||
xdt=candidate(2,icand)
|
xdt=candidate(2,icand)
|
||||||
xbase=10.0**(0.1*(sbase(nint(f1/3.125))-40.0))
|
xbase=10.0**(0.1*(sbase(nint(f1/3.125))-40.0))
|
||||||
nsnr0=min(99,nint(10.0*log10(sync) - 25.5)) ! ### empirical ###
|
nsnr0=min(99,nint(10.0*log10(sync) - 25.5)) ! ### empirical ###
|
||||||
call ft8b(dd,newdat,nQSOProgress,nfqso,nftx,ndepth,lft8apon, &
|
call ft8b(dd,newdat,nQSOProgress,nfqso+3000,nftx,ndepth,lft8apon, &
|
||||||
lapcqonly,napwid,lsubtract,nagain,iaptype,mycall12,mygrid6, &
|
lapcqonly,napwid,lsubtract,nagain,iaptype,mycall12,mygrid6, &
|
||||||
hiscall12,bcontest,sync,f1,xdt,xbase,apsym,nharderrors,dmin, &
|
hiscall12,bcontest,sync,f1,xdt,xbase,apsym,nharderrors,dmin, &
|
||||||
nbadcrc,iappass,iera,msg37,xsnr)
|
nbadcrc,iappass,iera,msg37,xsnr)
|
||||||
|
@ -92,7 +93,7 @@ program ft8d
|
||||||
endif
|
endif
|
||||||
write(*,1004) nutc,ncand,icand,ipass,iaptype,iappass, &
|
write(*,1004) nutc,ncand,icand,ipass,iaptype,iappass, &
|
||||||
nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), &
|
nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), &
|
||||||
xdt,nint(f1),message
|
xdt,nint(f1-3000+dialfreq),message
|
||||||
1004 format(i6.6,2i4,3i2,i3,3f6.1,i4,f6.2,i5,2x,a22)
|
1004 format(i6.6,2i4,3i2,i3,3f6.1,i4,f6.2,i5,2x,a22)
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
subroutine genft8refsig(itone,cref,f0)
|
subroutine genft8refsig(itone,cref,f0)
|
||||||
complex cref(79*1920)
|
complex cref(79*960)
|
||||||
integer itone(79)
|
integer itone(79)
|
||||||
real*8 twopi,phi,dphi,dt,xnsps
|
real*8 twopi,phi,dphi,dt,xnsps
|
||||||
data twopi/0.d0/
|
data twopi/0.d0/
|
||||||
save twopi
|
save twopi
|
||||||
if( twopi .lt. 0.1 ) twopi=8.d0*atan(1.d0)
|
if( twopi .lt. 0.1 ) twopi=8.d0*atan(1.d0)
|
||||||
|
|
||||||
xnsps=1920.d0
|
xnsps=960.d0
|
||||||
dt=1.d0/12000.d0
|
dt=1.d0/6000.d0
|
||||||
phi=0.d0
|
phi=0.d0
|
||||||
k=1
|
k=1
|
||||||
do i=1,79
|
do i=1,79
|
||||||
dphi=twopi*(f0*dt+itone(i)/xnsps)
|
dphi=twopi*(f0*dt+itone(i)/xnsps)
|
||||||
do is=1,1920
|
do is=1,960
|
||||||
cref(k)=cmplx(cos(phi),sin(phi))
|
cref(k)=cmplx(cos(phi),sin(phi))
|
||||||
phi=mod(phi+dphi,twopi)
|
phi=mod(phi+dphi,twopi)
|
||||||
k=k+1
|
k=k+1
|
||||||
|
|
|
@ -9,7 +9,7 @@ subroutine subtractft8(dd,itone,f0,dt)
|
||||||
|
|
||||||
use timer_module, only: timer
|
use timer_module, only: timer
|
||||||
|
|
||||||
parameter (NMAX=15*12000,NFRAME=1920*79)
|
parameter (NMAX=15*6000,NFRAME=960*79)
|
||||||
parameter (NFFT=NMAX,NFILT=1400)
|
parameter (NFFT=NMAX,NFILT=1400)
|
||||||
real*4 window(-NFILT/2:NFILT/2)
|
real*4 window(-NFILT/2:NFILT/2)
|
||||||
complex dd(NMAX)
|
complex dd(NMAX)
|
||||||
|
@ -20,7 +20,7 @@ subroutine subtractft8(dd,itone,f0,dt)
|
||||||
common/heap8/cref(NFRAME),camp(NMAX),cfilt(NMAX),cw(NMAX)
|
common/heap8/cref(NFRAME),camp(NMAX),cfilt(NMAX),cw(NMAX)
|
||||||
save first
|
save first
|
||||||
|
|
||||||
nstart=dt*12000+1
|
nstart=dt*6000+1
|
||||||
call genft8refsig(itone,cref,f0)
|
call genft8refsig(itone,cref,f0)
|
||||||
camp=0.
|
camp=0.
|
||||||
do i=1,nframe
|
do i=1,nframe
|
||||||
|
|
25
sync8.f90
25
sync8.f90
|
@ -3,18 +3,18 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
|
||||||
include 'ft8_params.f90'
|
include 'ft8_params.f90'
|
||||||
! Search over +/- 2.5s relative to 0.5s TX start time.
|
! Search over +/- 2.5s relative to 0.5s TX start time.
|
||||||
parameter (JZ=62)
|
parameter (JZ=62)
|
||||||
complex cx(0:NH1)
|
complex cx(0:NFFT1-1)
|
||||||
real s(NH1,NHSYM)
|
real s(NFFT1,NHSYM)
|
||||||
real savg(NH1)
|
real savg(NFFT1)
|
||||||
real sbase(NH1)
|
real sbase(NFFT1)
|
||||||
complex x(NFFT1)
|
complex x(NFFT1)
|
||||||
real sync2d(NH1,-JZ:JZ)
|
real sync2d(NFFT1,-JZ:JZ)
|
||||||
real red(NH1)
|
real red(NFFT1)
|
||||||
real candidate0(3,200)
|
real candidate0(3,200)
|
||||||
real candidate(3,200)
|
real candidate(3,200)
|
||||||
complex dd(NMAX)
|
complex dd(NMAX)
|
||||||
integer jpeak(NH1)
|
integer jpeak(NFFT1)
|
||||||
integer indx(NH1)
|
integer indx(NFFT1)
|
||||||
integer ii(1)
|
integer ii(1)
|
||||||
integer icos7(0:6)
|
integer icos7(0:6)
|
||||||
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
|
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
|
||||||
|
@ -22,8 +22,8 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
|
||||||
|
|
||||||
! Compute symbol spectra, stepping by NSTEP steps.
|
! Compute symbol spectra, stepping by NSTEP steps.
|
||||||
savg=0.
|
savg=0.
|
||||||
tstep=NSTEP/12000.0
|
tstep=NSTEP/6000.0
|
||||||
df=12000.0/NFFT1 !3.125 Hz
|
df=6000.0/NFFT1 !3.125 Hz
|
||||||
fac=1.0/300.0
|
fac=1.0/300.0
|
||||||
do j=1,NHSYM
|
do j=1,NHSYM
|
||||||
ia=(j-1)*NSTEP + 1
|
ia=(j-1)*NSTEP + 1
|
||||||
|
@ -32,9 +32,10 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
|
||||||
x(NSPS+1:)=0.
|
x(NSPS+1:)=0.
|
||||||
call four2a(x,NFFT1,1,-1,1) !c2c FFT
|
call four2a(x,NFFT1,1,-1,1) !c2c FFT
|
||||||
do i=1,NH1
|
do i=1,NH1
|
||||||
s(i,j)=real(cx(i))**2 + aimag(cx(i))**2
|
s(i,j)=real(cx(i+NH1))**2 + aimag(cx(i+NH1))**2
|
||||||
|
s(i+NH1,j)=real(cx(i))**2 + aimag(cx(i))**2
|
||||||
enddo
|
enddo
|
||||||
savg=savg + s(1:NH1,j) !Average spectrum
|
savg=savg + s(1:NFFT1,j) !Average spectrum
|
||||||
enddo
|
enddo
|
||||||
call baseline(savg,nfa,nfb,sbase)
|
call baseline(savg,nfa,nfb,sbase)
|
||||||
! savg=savg/NHSYM
|
! savg=savg/NHSYM
|
||||||
|
|
|
@ -2,7 +2,7 @@ subroutine sync8d(cd0,i0,ctwk,itwk,sync)
|
||||||
|
|
||||||
! Compute sync power for a complex, downsampled FT8 signal.
|
! Compute sync power for a complex, downsampled FT8 signal.
|
||||||
|
|
||||||
parameter(NP2=2812,NDOWN=60)
|
parameter(NP2=2812,NDOWN=30)
|
||||||
complex cd0(3125)
|
complex cd0(3125)
|
||||||
complex csync(0:6,32)
|
complex csync(0:6,32)
|
||||||
complex csync2(32)
|
complex csync2(32)
|
||||||
|
@ -19,7 +19,7 @@ subroutine sync8d(cd0,i0,ctwk,itwk,sync)
|
||||||
! Set some constants and compute the csync array.
|
! Set some constants and compute the csync array.
|
||||||
if( first ) then
|
if( first ) then
|
||||||
twopi=8.0*atan(1.0)
|
twopi=8.0*atan(1.0)
|
||||||
fs2=12000.0/NDOWN !Sample rate after downsampling
|
fs2=6000.0/NDOWN !Sample rate after downsampling
|
||||||
dt2=1/fs2 !Corresponding sample interval
|
dt2=1/fs2 !Corresponding sample interval
|
||||||
taus=32*dt2 !Symbol duration
|
taus=32*dt2 !Symbol duration
|
||||||
baud=1.0/taus !Keying rate
|
baud=1.0/taus !Keying rate
|
||||||
|
|
Loading…
Reference in New Issue