mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 12:48:40 -05:00
working on pxdb, spectra
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2645 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
a6a41824fa
commit
8106840d3b
104
lib/genmsk.f90
104
lib/genmsk.f90
@ -1,104 +0,0 @@
|
|||||||
!subroutine genms(msg28,samfac,iwave,cwave,isrch,nwave)
|
|
||||||
subroutine genmsk(msg28,iwave,nwave)
|
|
||||||
|
|
||||||
! Generate a JTMS wavefile.
|
|
||||||
|
|
||||||
parameter (NMAX=30*48000) !Max length of wave file
|
|
||||||
integer*2 iwave(NMAX) !Generated wave file
|
|
||||||
complex cwave(NMAX) !Alternative for searchms
|
|
||||||
character*28 msg28 !User message
|
|
||||||
character*29 msg
|
|
||||||
character cc*64
|
|
||||||
integer sent(203)
|
|
||||||
real*8 dt,phi,f,f0,dfgen,dphi,twopi,foffset,samfac
|
|
||||||
integer np(9)
|
|
||||||
data np/5,7,9,11,13,17,19,23,29/ !Permissible message lengths
|
|
||||||
! 1 2 3 4 5 6
|
|
||||||
! 0123456789012345678901234567890123456789012345678901234567890123
|
|
||||||
data cc/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ./?- _ @'/
|
|
||||||
|
|
||||||
!###
|
|
||||||
samfac=1.d0
|
|
||||||
isrch=0
|
|
||||||
!###
|
|
||||||
|
|
||||||
msg=msg28//' ' !Extend to 29 characters
|
|
||||||
do i=28,1,-1 !Find user's message length
|
|
||||||
if(msg(i:i).ne.' ') go to 1
|
|
||||||
enddo
|
|
||||||
1 iz=i+1 !Add one for space at EOM
|
|
||||||
msglen=iz
|
|
||||||
if(isrch.ne.0) go to 3
|
|
||||||
do i=1,9
|
|
||||||
if(np(i).ge.iz) go to 2
|
|
||||||
enddo
|
|
||||||
i=8
|
|
||||||
2 msglen=np(i)
|
|
||||||
|
|
||||||
! Convert message to a bit sequence, 7 bits per character (6 + odd parity)
|
|
||||||
! Use odd parity because then code 44 (from a 0-63 range) is the 7-bit
|
|
||||||
! Barker code.
|
|
||||||
3 sent=0
|
|
||||||
k=0
|
|
||||||
do j=1,msglen
|
|
||||||
if(msg(j:j).eq.' ') then
|
|
||||||
i=1 + 44
|
|
||||||
go to 5
|
|
||||||
else
|
|
||||||
do i=1,64
|
|
||||||
if(msg(j:j).eq.cc(i:i)) go to 5
|
|
||||||
enddo
|
|
||||||
endif
|
|
||||||
5 m=0
|
|
||||||
do n=5,0,-1 !Each character gets 6 bits
|
|
||||||
k=k+1
|
|
||||||
sent(k)=iand(1,ishft(i-1,-n))
|
|
||||||
m=m+sent(k)
|
|
||||||
enddo
|
|
||||||
k=k+1
|
|
||||||
sent(k) = 1 - iand(m,1) !Insert odd parity bit
|
|
||||||
enddo
|
|
||||||
nsym=k
|
|
||||||
|
|
||||||
! Set up necessary constants
|
|
||||||
twopi=8.d0*atan(1.d0)
|
|
||||||
nsps=24
|
|
||||||
dt=1.d0/(samfac*48000.d0)
|
|
||||||
f0=48000.d0/nsps
|
|
||||||
dfgen=0.5d0*f0
|
|
||||||
foffset=1500.d0 - f0
|
|
||||||
t=0.d0
|
|
||||||
k=0
|
|
||||||
phi=0.d0
|
|
||||||
nrpt=NMAX/(nsym*nsps)
|
|
||||||
if(isrch.ne.0) nrpt=1
|
|
||||||
|
|
||||||
do irpt=1,nrpt
|
|
||||||
do j=1,nsym
|
|
||||||
if(sent(j).eq.1) then
|
|
||||||
f=f0 + 0.5d0*dfgen + foffset
|
|
||||||
else
|
|
||||||
f=f0 - 0.5d0*dfgen + foffset
|
|
||||||
endif
|
|
||||||
dphi=twopi*f*dt
|
|
||||||
do i=1,nsps
|
|
||||||
k=k+1
|
|
||||||
phi=phi+dphi
|
|
||||||
if(isrch.eq.0) then
|
|
||||||
iwave(k)=nint(32767.0*sin(phi))
|
|
||||||
else
|
|
||||||
cwave(k)=cmplx(cos(phi),sin(phi))
|
|
||||||
endif
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
|
|
||||||
if(isrch.eq.0) iwave(k+1:)=0
|
|
||||||
nwave=k
|
|
||||||
|
|
||||||
! call makepings(iwave,nwave)
|
|
||||||
! write(71) iwave
|
|
||||||
! call flush(71)
|
|
||||||
|
|
||||||
return
|
|
||||||
end subroutine genmsk
|
|
60
lib/msgs.txt
Normal file
60
lib/msgs.txt
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
W1AAA K2BBB EM00
|
||||||
|
W2CCC K3DDD EM01
|
||||||
|
W3EEE K4FFF EM02
|
||||||
|
W5GGG K6HHH EM03
|
||||||
|
W7III K8JJJ EM04
|
||||||
|
W9KKK K0LLL EM05
|
||||||
|
G0MMM F1NNN JN06
|
||||||
|
G2OOO F3PPP JN07
|
||||||
|
G4QQQ F5RRR JN08
|
||||||
|
G6SSS F7TTT JN09
|
||||||
|
W1XAA K2XBB EM10
|
||||||
|
W2XCC K3XDD EM11
|
||||||
|
W3XEE K4XFF EM12
|
||||||
|
W5XGG K6XHH EM13
|
||||||
|
W7XII K8XJJ EM14
|
||||||
|
W9XKK K0XLL EM15
|
||||||
|
G0XMM F1XNN JN16
|
||||||
|
G2XOO F3XPP JN17
|
||||||
|
G4XQQ F5XRR JN18
|
||||||
|
G6XSS F7XTT JN19
|
||||||
|
W1YAA K2YBB EM20
|
||||||
|
W2YCC K3YDD EM21
|
||||||
|
W3YEE K4YFF EM22
|
||||||
|
W5YGG K6YHH EM23
|
||||||
|
W7YII K8YJJ EM24
|
||||||
|
W9YKK K0YLL EM25
|
||||||
|
G0YMM F1YNN JN26
|
||||||
|
G2YOO F3YPP JN27
|
||||||
|
G4YQQ F5YRR JN28
|
||||||
|
G6YSS F7YTT JN29
|
||||||
|
W1ZAA K2ZBB EM30
|
||||||
|
W2ZCC K3ZDD EM31
|
||||||
|
W3ZEE K4ZFF EM32
|
||||||
|
W5ZGG K6ZHH EM33
|
||||||
|
W7ZII K8ZJJ EM34
|
||||||
|
W9ZKK K0ZLL EM35
|
||||||
|
G0ZMM F1ZNN JN36
|
||||||
|
G2ZOO F3ZPP JN37
|
||||||
|
G4ZQQ F5ZRR JN38
|
||||||
|
G6ZSS F7ZTT JN39
|
||||||
|
W1AXA K2BXB EM40
|
||||||
|
W2CXC K3DXD EM41
|
||||||
|
W3EXE K4FXF EM42
|
||||||
|
W5GXG K6HXH EM43
|
||||||
|
W7IXI K8JXJ EM44
|
||||||
|
W9KXK K0LXL EM45
|
||||||
|
G0MXM F1NXN JN46
|
||||||
|
G2OXO F3PXP JN47
|
||||||
|
G4QXQ F5RXR JN48
|
||||||
|
G6SXS F7TXT JN49
|
||||||
|
W1AYA K2BYB EM50
|
||||||
|
W2CYC K3DYD EM51
|
||||||
|
W3EYE K4FYF EM52
|
||||||
|
W5GYG K6HYH EM53
|
||||||
|
W7IYI K8JYJ EM54
|
||||||
|
W9KYK K0LYL EM55
|
||||||
|
G0MYM F1NYN JN56
|
||||||
|
G2OYO F3PYP JN57
|
||||||
|
G4QYQ F5RYR JN58
|
||||||
|
G6SYS F7TYT JN59
|
@ -125,9 +125,20 @@ subroutine symspec(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb,s,f0a,df3, &
|
|||||||
cx(i)=c0(ja+i)
|
cx(i)=c0(ja+i)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
!###
|
||||||
|
! if(nzap/178.lt.50 .and. (ndiskdat.eq.0 .or. ihsym.lt.280)) then
|
||||||
|
nsum=nblks*kstep1 - nzap
|
||||||
|
if(nsum.le.0) nsum=1
|
||||||
|
rms=sqrt(0.5*px/nsum)
|
||||||
|
! endif
|
||||||
pxdb=0.
|
pxdb=0.
|
||||||
if(rmsx.gt.1.0) pxdb=20.0*log10(rmsx)
|
pxdb=20.0*log10(rms) + 166.0 !### ??? ###
|
||||||
if(pxdb.gt.60.0) pxdb=60.0
|
if(pxdb.gt.60.0) pxdb=60.0
|
||||||
|
! write(71,*) kstep1,nzap,nsum,px,rms,pxdb
|
||||||
|
! flush(71)
|
||||||
|
|
||||||
|
!###
|
||||||
|
|
||||||
|
|
||||||
ihsym=ihsym+1
|
ihsym=ihsym+1
|
||||||
call four2a(cx,nfft3,1,-1,1) !Third forward FFT (X)
|
call four2a(cx,nfft3,1,-1,1) !Third forward FFT (X)
|
||||||
|
@ -147,6 +147,7 @@ subroutine timf2(x0,k,nfft,nwindow,nb,peaklimit,faclim,x1, &
|
|||||||
do i=0,kstep-1
|
do i=0,kstep-1
|
||||||
px=px + xw(i)*xw(i)
|
px=px + xw(i)*xw(i)
|
||||||
enddo
|
enddo
|
||||||
|
px=px/kstep
|
||||||
|
|
||||||
x1(0:kstep-1)=xw(0:kstep-1) + xs(0:kstep-1) !Recombine weak + strong
|
x1(0:kstep-1)=xw(0:kstep-1) + xs(0:kstep-1) !Recombine weak + strong
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata,
|
|||||||
uchar lstrong[])
|
uchar lstrong[])
|
||||||
{
|
{
|
||||||
static float splot[NSMAX];
|
static float splot[NSMAX];
|
||||||
float swide[2048];
|
static float swide[2048];
|
||||||
float smax;
|
float smax;
|
||||||
// double df;
|
// double df;
|
||||||
int nbpp = ui->widePlot->binsPerPixel();
|
int nbpp = ui->widePlot->binsPerPixel();
|
||||||
@ -97,7 +97,8 @@ void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata,
|
|||||||
int w=ui->widePlot->plotWidth();
|
int w=ui->widePlot->plotWidth();
|
||||||
int i0=0; //###
|
int i0=0; //###
|
||||||
int i=i0;
|
int i=i0;
|
||||||
for (int j=0; j<2048; j++) {
|
int jz=1000.0/df3;
|
||||||
|
for (int j=0; j<jz; j++) {
|
||||||
/*
|
/*
|
||||||
smax=0;
|
smax=0;
|
||||||
for (int k=0; k<nbpp; k++) {
|
for (int k=0; k<nbpp; k++) {
|
||||||
@ -112,12 +113,10 @@ void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata,
|
|||||||
i++;
|
i++;
|
||||||
sum += splot[i];
|
sum += splot[i];
|
||||||
}
|
}
|
||||||
swide[j]=sum;
|
swide[j]=sum;
|
||||||
|
// if(lstrong[1 + i/32]!=0) swide[j]=-smax; //Tag strong signals
|
||||||
if(lstrong[1 + i/32]!=0) swide[j]=-smax; //Tag strong signals
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// qDebug() << "B" << ihsym << swide[1000] << splot[1000];
|
|
||||||
// Time according to this computer
|
// Time according to this computer
|
||||||
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
|
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
|
||||||
int ntr = (ms/1000) % m_TRperiod;
|
int ntr = (ms/1000) % m_TRperiod;
|
||||||
|
Loading…
Reference in New Issue
Block a user