Code cleanup and commenting.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7661 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-05-01 12:32:59 +00:00
parent ebccfbcc81
commit 2464009f46
5 changed files with 20 additions and 13 deletions

View File

@ -1,6 +1,6 @@
subroutine genwspr5(msg,ichk,msgsent,itone,itype)
!Encode a WSPR-LF message, produce itone() array.
! Encode a WSPR-LF message, producing array itone().
use crc
include 'wsprlf_params.f90'

View File

@ -1,5 +1,8 @@
subroutine wspr5_downsample(iwave,c)
! Input: i*2 data in iwave() at sample rate 12000 Hz
! Output: Complex data in c(), sampled at 400 Hz
include 'wsprlf_params.f90'
parameter (NMAX=300*12000,NFFT2=NMAX/30)
integer*2 iwave(NMAX)

View File

@ -1,5 +1,7 @@
subroutine wspr5_wav(baud,xdt,f0,itone,snrdb,iwave)
! Generate iwave() from itone().
include 'wsprlf_params.f90'
parameter (NMAX=300*12000)
integer itone(NN)

View File

@ -1,9 +1,9 @@
program wspr5d
! Simulate characteristics of a potential "WSPR-LF" mode using LDPC (300,60)
! code, OQPSK modulation, and 5 minute T/R sequences.
! Decode WSPR-LF data read from *.c5 or *.wav files.
! Q: Would it be better for central Sync array to use both I and Q channels?
! WSPR-LF is a potential WSPR-like mode intended for use at LF and MF.
! It uses an LDPC (300,60) code, OQPSK modulation, and 5 minute T/R sequences.
! Reception and Demodulation algorithm:
! 1. Compute coarse spectrum; find fc1 = approx carrier freq
@ -14,6 +14,8 @@ program wspr5d
! 6. Fit complex ploynomial for channel equalization
! 7. Get soft bits from equalized data
! Still to do: find and decode more than one signal in the specified passband.
include 'wsprlf_params.f90'
parameter (NMAX=300*12000)
character arg*8,message*22,cbits*50,infile*80,fname*16
@ -111,8 +113,7 @@ program wspr5d
a(2:5)=0.
call twkfreq1(c,NZ,fs,a,c) !Mix c down by fc1+fc2
!---------------------------------------------------------------- DT
! Not presently used:
! Find time offset xdt
amax=0.
jpk=0
iaa=0

View File

@ -1,6 +1,7 @@
program wspr5sim
! Generate simulated data for the 5-minute "WSPR-LF" mode.
! Generate simulated data for a 5-minute "WSPR-LF" mode. Output is saved
! to a *.c5 or *.wav file.
use wavhdr
include 'wsprlf_params.f90' !Set various constants
@ -12,7 +13,7 @@ program wspr5sim
complex c(0:NZ-1)
real*8 fMHz
integer itone(NN)
integer*2 iwave(NMAX) !Generated full-length waveform
integer*2 iwave(NMAX) !Generated full-length waveform
! Get command-line argument(s)
nargs=iargc()
@ -45,7 +46,7 @@ program wspr5sim
if(snrdb.gt.90.0) sig=1.0
txt=NN*NSPS0/12000.0
call genwspr5(msg,ichk,msgsent,itone,itype) !Encode the message, get itone()
call genwspr5(msg,ichk,msgsent,itone,itype) !Encode the message, get itone
write(*,1000) f0,xdt,txt,snrdb,nfiles,msgsent
1000 format('f0:',f9.3,' DT:',f6.2,' txt:',f6.1,' SNR:',f6.1, &
' nfiles:',i3,2x,a22)
@ -55,7 +56,7 @@ program wspr5sim
phi=0.0
c0=0.
k=-1 + nint(xdt/dt)
do j=1,NN
do j=1,NN !Generate OQPSK waveform from itone
dphi=dphi0
if(itone(j).eq.1) dphi=dphi1
if(k.eq.0) phi=-dphi
@ -67,7 +68,7 @@ program wspr5sim
if(k.ge.0 .and. k.lt.NZ) c0(k)=cmplx(cos(xphi),sin(xphi))
enddo
enddo
c0=sig*c0 !Scale to requested sig level
c0=sig*c0 !Scale to requested sig level
do ifile=1,nfiles
if(nwav.eq.0) then
@ -83,7 +84,7 @@ program wspr5sim
open(10,file=fname,status='unknown',access='stream')
fMHz=10.1387d0
nmin=5
write(10) fname,nmin,fMHz,c
write(10) fname,nmin,fMHz,c !Save to *.c5 file
close(10)
else
call wspr5_wav(baud,xdt,f0,itone,snrdb,iwave)
@ -91,7 +92,7 @@ program wspr5sim
write(fname,1102) ifile
1102 format('000000_',i4.4,'.wav')
open(10,file=fname,status='unknown',access='stream')
write(10) h,iwave !Save the .wav file
write(10) h,iwave !Save to *.wav file
close(10)
endif
write(*,1110) ifile,xdt,f0,snrdb,fname