mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-31 05:02:26 -04:00
Replace many instances of 12000.0 with fsample.
This commit is contained in:
parent
2effe7e4c7
commit
d44d00453f
@ -4,7 +4,7 @@ module sfox_mod
|
|||||||
integer MM,NQ,NN,KK,ND1,ND2,NFZ,NSPS,NS,NSYNC,NZ,NFFT,NFFT1
|
integer MM,NQ,NN,KK,ND1,ND2,NFZ,NSPS,NS,NSYNC,NZ,NFFT,NFFT1
|
||||||
|
|
||||||
contains
|
contains
|
||||||
subroutine sfox_init(mm0,nn0,kk0,itu,fspread,delay)
|
subroutine sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample)
|
||||||
|
|
||||||
character*2 itu
|
character*2 itu
|
||||||
integer isps(50)
|
integer isps(50)
|
||||||
@ -24,10 +24,10 @@ contains
|
|||||||
NFZ=3 !First zero
|
NFZ=3 !First zero
|
||||||
|
|
||||||
tsync=2.0
|
tsync=2.0
|
||||||
jsps=nint((12.8-tsync)*12000.0/NN)
|
jsps=nint((12.8-tsync)*fsample/NN)
|
||||||
iloc=minloc(abs(isps-jsps))
|
iloc=minloc(abs(isps-jsps))
|
||||||
NSPS=isps(iloc(1)) !Samples per symbol
|
NSPS=isps(iloc(1)) !Samples per symbol
|
||||||
NS=nint(tsync*12000.0/NSPS)
|
NS=nint(tsync*fsample/NSPS)
|
||||||
if(mod(NS,2).eq.1) NS=NS+1
|
if(mod(NS,2).eq.1) NS=NS+1
|
||||||
NSYNC=NS*NSPS !Samples in sync waveform
|
NSYNC=NS*NSPS !Samples in sync waveform
|
||||||
NZ=NSPS*(NN+NS) !Samples in full Tx waveform
|
NZ=NSPS*(NN+NS) !Samples in full Tx waveform
|
||||||
|
@ -71,13 +71,14 @@ program sfoxtest
|
|||||||
call init_timer ('timer.out')
|
call init_timer ('timer.out')
|
||||||
call timer('sfoxtest',0)
|
call timer('sfoxtest',0)
|
||||||
|
|
||||||
call sfox_init(mm0,nn0,kk0,itu,fspread,delay)
|
fsample=12000.0 !Sample rate (Hz)
|
||||||
baud=12000.0/NSPS
|
call sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample)
|
||||||
|
baud=fsample/NSPS
|
||||||
tsym=1.0/baud
|
tsym=1.0/baud
|
||||||
bw=NQ*baud
|
bw=NQ*baud
|
||||||
maxerr=(NN-KK)/2
|
maxerr=(NN-KK)/2
|
||||||
tsync=NSYNC/12000.0
|
tsync=NSYNC/fsample
|
||||||
txt=(NN+NS)*NSPS/12000.0
|
txt=(NN+NS)*NSPS/fsample
|
||||||
|
|
||||||
write(*,1000) MM,NN,KK,NSPS,baud,bw,itu,fspread,delay,maxerr, &
|
write(*,1000) MM,NN,KK,NSPS,baud,bw,itu,fspread,delay,maxerr, &
|
||||||
tsync,txt
|
tsync,txt
|
||||||
@ -100,11 +101,9 @@ program sfoxtest
|
|||||||
allocate(correct(0:NN-1))
|
allocate(correct(0:NN-1))
|
||||||
|
|
||||||
rms=100.
|
rms=100.
|
||||||
fsample=12000.0 !Sample rate (Hz)
|
baud=fsample/nsps !Keying rate, 11.719 baud for nsps=1024
|
||||||
baud=12000.0/nsps !Keying rate, 11.719 baud for nsps=1024
|
|
||||||
h=default_header(12000,NMAX)
|
|
||||||
idummy=0
|
idummy=0
|
||||||
bandwidth_ratio=2500.0/12000.0
|
bandwidth_ratio=2500.0/fsample
|
||||||
fgood0=1.0
|
fgood0=1.0
|
||||||
|
|
||||||
! Generate a message
|
! Generate a message
|
||||||
@ -199,7 +198,7 @@ program sfoxtest
|
|||||||
a=0.
|
a=0.
|
||||||
a(1)=1500.0-f
|
a(1)=1500.0-f
|
||||||
call timer('twkfreq ',0)
|
call timer('twkfreq ',0)
|
||||||
call twkfreq(crcvd,crcvd,NMAX,12000.0,a)
|
call twkfreq(crcvd,crcvd,NMAX,fsample,a)
|
||||||
call timer('twkfreq ',1)
|
call timer('twkfreq ',1)
|
||||||
f=1500.0
|
f=1500.0
|
||||||
call timer('demod ',0)
|
call timer('demod ',0)
|
||||||
@ -224,6 +223,7 @@ program sfoxtest
|
|||||||
call timer('ftrsd3 ',1)
|
call timer('ftrsd3 ',1)
|
||||||
|
|
||||||
if(iand(nv,1).ne.0) then
|
if(iand(nv,1).ne.0) then
|
||||||
|
h=default_header(12000,NMAX)
|
||||||
fname='000000_000001.wav'
|
fname='000000_000001.wav'
|
||||||
write(fname(8:13),'(i6.6)') ifile
|
write(fname(8:13),'(i6.6)') ifile
|
||||||
open(10,file=trim(fname),access='stream',status='unknown')
|
open(10,file=trim(fname),access='stream',status='unknown')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user