mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-06-03 15:22:29 -04:00
MOve the sync patterm 60 symbols (5.12 s) into the transmission.
This commit is contained in:
parent
27824dc45d
commit
aedc9ec3c1
@ -11,10 +11,10 @@ program synctest
|
|||||||
real*4 xnoise(NMAX) !Random noise
|
real*4 xnoise(NMAX) !Random noise
|
||||||
real*4 dat(NMAX) !Generated real data
|
real*4 dat(NMAX) !Generated real data
|
||||||
real ccf(-MMAX:MMAX,-JMAX:JMAX) !2D CCF: DT, dFreq offsets
|
real ccf(-MMAX:MMAX,-JMAX:JMAX) !2D CCF: DT, dFreq offsets
|
||||||
complex cdat(-15000:NMAX) !Generated complex waveform
|
complex cdat(NMAX) !Generated complex waveform
|
||||||
complex clo(NMAX) !Complex Local Oscillator
|
complex clo(NMAX) !Complex Local Oscillator
|
||||||
complex cnoise(NMAX) !Complex noise
|
complex cnoise(NMAX) !Complex noise
|
||||||
complex crcvd(-15000:NMAX) !Signal as received
|
complex crcvd(NMAX) !Signal as received
|
||||||
complex c(0:NFFT-1)
|
complex c(0:NFFT-1)
|
||||||
complex w,wstep,w0,wstep0
|
complex w,wstep,w0,wstep0
|
||||||
integer ipk(2)
|
integer ipk(2)
|
||||||
@ -37,18 +37,19 @@ program synctest
|
|||||||
call getarg(4,arg)
|
call getarg(4,arg)
|
||||||
read(arg,*) snrdb
|
read(arg,*) snrdb
|
||||||
|
|
||||||
|
nsps=1024
|
||||||
ntrperiod=15
|
ntrperiod=15
|
||||||
rms=100.
|
rms=100.
|
||||||
fsample=12000.d0 !Sample rate (Hz)
|
fsample=12000.0 !Sample rate (Hz)
|
||||||
npts=fsample*ntrperiod !Total samples in .wav file
|
npts=fsample*ntrperiod !Total samples in .wav file
|
||||||
twopi=8.d0*atan(1.d0)
|
twopi=8.0*atan(1.0)
|
||||||
tsync=2.0
|
tsync=2.0
|
||||||
nsync=fsample*tsync
|
nsync=fsample*tsync
|
||||||
nsym=125 !Number of channel symbols
|
nsym=125 !Number of channel symbols
|
||||||
nsps=1024
|
nsps=1024
|
||||||
nsync=tsync*fsample
|
nsync=tsync*fsample
|
||||||
|
|
||||||
baud=12000.d0/nsps !Keying rate (6.67 baud fot 15-s sequences)
|
baud=12000.0/nsps !Keying rate (6.67 baud fot 15-s sequences)
|
||||||
h=default_header(12000,npts)
|
h=default_header(12000,npts)
|
||||||
fname='000000_000001.wav'
|
fname='000000_000001.wav'
|
||||||
open(10,file=trim(fname),access='stream',status='unknown')
|
open(10,file=trim(fname),access='stream',status='unknown')
|
||||||
@ -73,11 +74,11 @@ program synctest
|
|||||||
a1=f0 + syncwidth/2.0 !Frequency at midpoint of sync waveform
|
a1=f0 + syncwidth/2.0 !Frequency at midpoint of sync waveform
|
||||||
a2=2.0*syncwidth/tsync !Frequency drift rate
|
a2=2.0*syncwidth/tsync !Frequency drift rate
|
||||||
|
|
||||||
! Generate complex sync signal
|
! Generate complex LO and sync signal
|
||||||
x0=0.5*(nsync+1)
|
x0=0.5*(nsync+1)
|
||||||
s=2.0/nsync
|
s=2.0/nsync
|
||||||
cdat=0.
|
cdat=0.
|
||||||
i0=xdt*12000.0
|
i0=nint(60.0*nsps + xdt*12000.0)
|
||||||
do i=1,nsync
|
do i=1,nsync
|
||||||
if(i.eq.nsync/2+1) a2=-a2 !Reverse sign of drift at midpoint
|
if(i.eq.nsync/2+1) a2=-a2 !Reverse sign of drift at midpoint
|
||||||
x=s*(i-x0)
|
x=s*(i-x0)
|
||||||
@ -98,14 +99,14 @@ program synctest
|
|||||||
write(10) h,iwave(1:npts) !Save the .wav file
|
write(10) h,iwave(1:npts) !Save the .wav file
|
||||||
close(10)
|
close(10)
|
||||||
|
|
||||||
crcvd(-1000:0)=0.
|
crcvd=0.
|
||||||
crcvd(1:NMAX)=cdat(1:NMAX) + cnoise
|
crcvd(1:NMAX)=cdat(1:NMAX) + cnoise
|
||||||
ccf=0.
|
ccf=0.
|
||||||
df=12000.0/NFFT !0.366211
|
df=12000.0/NFFT !0.366211
|
||||||
|
i1=60*nsps
|
||||||
do m=-MMAX,MMAX
|
do m=-MMAX,MMAX
|
||||||
lag=100*m
|
lag=100*m
|
||||||
! c(0:nsync-1)=crcvd(1+lag:nsync+lag)*conjg(cdat(1:nsync))
|
c(0:nsync-1)=crcvd(i1+1+lag:i1+nsync+lag)*clo(1:nsync)
|
||||||
c(0:nsync-1)=crcvd(1+lag:nsync+lag)*clo(1:nsync)
|
|
||||||
c(nsync:)=0.
|
c(nsync:)=0.
|
||||||
fac=1.e-3
|
fac=1.e-3
|
||||||
c=fac*c
|
c=fac*c
|
||||||
@ -119,6 +120,7 @@ program synctest
|
|||||||
|
|
||||||
ccf=ccf/maxval(ccf)
|
ccf=ccf/maxval(ccf)
|
||||||
ipk=maxloc(ccf)
|
ipk=maxloc(ccf)
|
||||||
|
print*,i0,ipk(1)
|
||||||
ipk(1)=ipk(1)-MMAX-1
|
ipk(1)=ipk(1)-MMAX-1
|
||||||
ipk(2)=ipk(2)-JMAX-1
|
ipk(2)=ipk(2)-JMAX-1
|
||||||
ma=ipk(1)-10
|
ma=ipk(1)-10
|
||||||
@ -133,10 +135,9 @@ program synctest
|
|||||||
write(*,1300) m/120.0,line
|
write(*,1300) m/120.0,line
|
||||||
1300 format(f6.3,2x,61a1)
|
1300 format(f6.3,2x,61a1)
|
||||||
enddo
|
enddo
|
||||||
dt=ipk(1)/120.0
|
t=ipk(1)/120.0
|
||||||
dfreq=ipk(2)*df
|
dfreq=ipk(2)*df
|
||||||
f=1500.0+dfreq
|
f=1500.0+dfreq
|
||||||
t=dt
|
|
||||||
write(*,1100) f0,xdt
|
write(*,1100) f0,xdt
|
||||||
1100 format(/'f0:',f7.1,' xdt:',f6.2)
|
1100 format(/'f0:',f7.1,' xdt:',f6.2)
|
||||||
write(*,1112) f,t
|
write(*,1112) f,t
|
||||||
|
Loading…
x
Reference in New Issue
Block a user