From ce7d5b8d0270e7e4a7df456ebee53a88d667bf13 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 14 Feb 2024 11:49:59 -0500 Subject: [PATCH] Simplify a few parts of code used for SuperFox simulations. --- lib/superfox/sfox_mod.f90 | 17 +++++++++-------- lib/superfox/sfoxtest.f90 | 10 +++------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/superfox/sfox_mod.f90 b/lib/superfox/sfox_mod.f90 index 64cf1c5ec..4c84a9ae4 100644 --- a/lib/superfox/sfox_mod.f90 +++ b/lib/superfox/sfox_mod.f90 @@ -7,24 +7,25 @@ contains subroutine sfox_init(mm0,nn0,kk0,itu,fspread,delay) character*2 itu - integer isps(30) + integer isps(50) integer iloc(1) - data isps/1000,1008,1024,1050,1080,1120,1152,1176,1200,1260, & - 1280,1296,1344,1350,1372,1400,1440,1470,1500,1512, & - 1536,1568,1600,1620,1680,1728,1920,1944,1960,2000/ - + data isps/1000,1008,1024,1029,1050,1080,1120,1125,1134,1152, & + 1176,1200,1215,1225,1250,1260,1280,1296,1323,1344, & + 1350,1372,1400,1440,1458,1470,1500,1512,1536,1568, & + 1575,1600,1620,1680,1701,1715,1728,1750,1764,1792, & + 1800,1875,1890,1920,1944,1960,2000,2016,2025,2048/ MM=mm0 !Bits per symbol NQ=2**MM !Q, number of MFSK tones NN=nn0 !Channel symbols, before puncture KK=kk0 !Information symbols, before puncture ND1=25 !Data symbols before sync - ND2=NN-2-ND1 !Data symbols after sync - ND=ND1+ND2 !Total data symbols + ND2=NN-ND1 !Data symbols after sync + ND=NN !Total data symbols NFZ=3 !First zero tsync=2.0 - jsps=nint((12.6-tsync)*12000.0/ND) + jsps=nint((12.8-tsync)*12000.0/ND) iloc=minloc(abs(isps-jsps)) NSPS=isps(iloc(1)) !Samples per symbol NS=nint(tsync*12000.0/NSPS) diff --git a/lib/superfox/sfoxtest.f90 b/lib/superfox/sfoxtest.f90 index 0d9e33247..b624792c0 100644 --- a/lib/superfox/sfoxtest.f90 +++ b/lib/superfox/sfoxtest.f90 @@ -96,13 +96,9 @@ program sfoxtest ! Generate a message msg0=0 - do i=1,KK-2 -! msg0(i)=i-1 + do i=1,KK msg0(i)=int(NQ*ran1(idummy)) -! msg0(i)=0 -! if(i.gt.ND1) msg0(i)=NQ-1 enddo -! Append a CRC here ... call rs_init_sf(MM,NQ,NN,KK,NFZ) !Initialize the Karn codec call rs_encode_sf(msg0,parsym) !Compute parity symbols @@ -115,7 +111,7 @@ program sfoxtest ! Generate cdat, the SuperFox waveform call sfox_gen(chansym0,f0,fsample,syncwidth,cdat) - do isnr=0,-25,-1 + do isnr=-8,-20,-1 snr=isnr if(snrdb.ne.0.0) snr=snrdb sig=sqrt(2*bandwidth_ratio)*10.0**(0.05*snr) @@ -142,7 +138,7 @@ program sfoxtest f1=f0 if(f0.eq.0.0) then f1=1500.0 + 200.0*(ran1(idummy)-0.5) - xdt=2.0*(ran1(idummy)-0.5) + xdt=0.6*(ran1(idummy)-0.5) call sfox_gen(chansym0,f1,fsample,syncwidth,cdat,clo) endif