mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-02-03 09:44:24 -05:00
Limit WSPR-LF frequency search range to 1600-1650 Hz. Enable S/N degradation.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7689 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
fdad9be46d
commit
9458acb01b
@ -1,15 +1,20 @@
|
|||||||
subroutine degrade_snr(d2,npts,db,bw)
|
subroutine degrade_snr(d2,npts,db,bw)
|
||||||
|
|
||||||
integer*2 d2(npts)
|
! Degrade S/N by specified number of dB.
|
||||||
real dat(60*12000)
|
|
||||||
|
|
||||||
dat(1:npts)=d2
|
integer*2 d2(npts)
|
||||||
p0=dot_product(dat(1:npts),dat(1:npts))/npts
|
|
||||||
|
p0=0.
|
||||||
|
do i=1,npts
|
||||||
|
x=d2(i)
|
||||||
|
p0=p0 + x*x
|
||||||
|
enddo
|
||||||
|
p0=p0/npts
|
||||||
if(bw.gt.0.0) p0=p0*6000.0/bw
|
if(bw.gt.0.0) p0=p0*6000.0/bw
|
||||||
s=sqrt(p0*(10.0**(0.1*db) - 1.0))
|
s=sqrt(p0*(10.0**(0.1*db) - 1.0))
|
||||||
fac=sqrt(p0/(p0+s*s))
|
fac=sqrt(p0/(p0+s*s))
|
||||||
do i=1,npts
|
do i=1,npts
|
||||||
d2(i)=nint(fac*(dat(i) + s*gran()))
|
d2(i)=nint(fac*(d2(i) + s*gran()))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -37,23 +37,24 @@ program wspr_fsk8d
|
|||||||
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
|
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
|
||||||
|
|
||||||
nargs=iargc()
|
nargs=iargc()
|
||||||
if(nargs.lt.2) then
|
if(nargs.lt.7) then
|
||||||
print*,'Usage: wspr_fsk8d [-a <data_dir>] [-f fMHz] file1 [file2 ...]'
|
print*,'Usage: wspr_fsk8d -d db -a data_dir -f fMHz file1 [file2 ...]'
|
||||||
go to 999
|
go to 999
|
||||||
endif
|
endif
|
||||||
iarg=1
|
call getarg(1,arg)
|
||||||
data_dir="."
|
if(arg(1:3).ne.'-d ') go to 999
|
||||||
call getarg(iarg,arg)
|
call getarg(2,arg)
|
||||||
if(arg(1:2).eq.'-a') then
|
read(arg,*) degrade
|
||||||
call getarg(iarg+1,data_dir)
|
rxbw=3000.
|
||||||
iarg=iarg+2
|
|
||||||
endif
|
call getarg(3,arg)
|
||||||
call getarg(iarg,arg)
|
if(arg(1:3).ne.'-f ') go to 999
|
||||||
if(arg(1:2).eq.'-f') then
|
call getarg(4,arg)
|
||||||
call getarg(iarg+1,arg)
|
read(arg,*) fMHz
|
||||||
read(arg,*) fMHz
|
|
||||||
iarg=iarg+2
|
call getarg(5,arg)
|
||||||
endif
|
if(arg(1:3).ne.'-a ') go to 999
|
||||||
|
call getarg(6,data_dir)
|
||||||
|
|
||||||
open(13,file=trim(data_dir)//'/ALL_WSPR.TXT',status='unknown', &
|
open(13,file=trim(data_dir)//'/ALL_WSPR.TXT',status='unknown', &
|
||||||
position='append')
|
position='append')
|
||||||
@ -77,7 +78,7 @@ program wspr_fsk8d
|
|||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
do ifile=iarg,nargs
|
do ifile=7,nargs
|
||||||
call getarg(ifile,infile)
|
call getarg(ifile,infile)
|
||||||
open(10,file=infile,status='old',access='stream')
|
open(10,file=infile,status='old',access='stream')
|
||||||
read(10,end=999) ihdr,iwave
|
read(10,end=999) ihdr,iwave
|
||||||
@ -85,10 +86,13 @@ program wspr_fsk8d
|
|||||||
j2=index(infile,'.wav')
|
j2=index(infile,'.wav')
|
||||||
read(infile(j2-4:j2-1),*) nutc
|
read(infile(j2-4:j2-1),*) nutc
|
||||||
datetime=infile(j2-11:j2-1)
|
datetime=infile(j2-11:j2-1)
|
||||||
|
if(degrade.gt.0.0) call degrade_snr(iwave,NMAX,degrade,rxbw)
|
||||||
call wspr_fsk8_downsample(iwave,c)
|
call wspr_fsk8_downsample(iwave,c)
|
||||||
|
|
||||||
pmax=0.
|
pmax=0.
|
||||||
df1=fs/(2*N7)
|
df1=fs/(2*N7)
|
||||||
|
ia=nint(100.0/df1)
|
||||||
|
ib=nint(150.0/df1)
|
||||||
ipk=0
|
ipk=0
|
||||||
jpk=0
|
jpk=0
|
||||||
! Get xdt and f0 from the sync arrays
|
! Get xdt and f0 from the sync arrays
|
||||||
@ -104,6 +108,9 @@ program wspr_fsk8d
|
|||||||
p=1.e-9*(real(c1(i))**2 + aimag(c1(i))**2 + &
|
p=1.e-9*(real(c1(i))**2 + aimag(c1(i))**2 + &
|
||||||
real(c2(i))**2 + aimag(c2(i))**2)
|
real(c2(i))**2 + aimag(c2(i))**2)
|
||||||
ss(i)=p
|
ss(i)=p
|
||||||
|
enddo
|
||||||
|
do i=ia,ib
|
||||||
|
p=ss(i)
|
||||||
if(p.gt.pmax) then
|
if(p.gt.pmax) then
|
||||||
pmax=p
|
pmax=p
|
||||||
ipk=i
|
ipk=i
|
||||||
@ -131,7 +138,8 @@ program wspr_fsk8d
|
|||||||
do j=1,ND
|
do j=1,ND
|
||||||
k=j+7
|
k=j+7
|
||||||
ps=s(0:7,k)
|
ps=s(0:7,k)
|
||||||
! ps=sqrt(ps) !### ??? ###
|
! ps=sqrt(ps) !### ??? ###
|
||||||
|
ps=log(ps)
|
||||||
r1=max(ps(1),ps(3),ps(5),ps(7))-max(ps(0),ps(2),ps(4),ps(6))
|
r1=max(ps(1),ps(3),ps(5),ps(7))-max(ps(0),ps(2),ps(4),ps(6))
|
||||||
r2=max(ps(2),ps(3),ps(6),ps(7))-max(ps(0),ps(1),ps(4),ps(5))
|
r2=max(ps(2),ps(3),ps(6),ps(7))-max(ps(0),ps(1),ps(4),ps(5))
|
||||||
r4=max(ps(4),ps(5),ps(6),ps(7))-max(ps(0),ps(1),ps(2),ps(3))
|
r4=max(ps(4),ps(5),ps(6),ps(7))-max(ps(0),ps(1),ps(2),ps(3))
|
||||||
@ -155,7 +163,8 @@ program wspr_fsk8d
|
|||||||
if(niterations.ge.0) call chkcrc10(decoded,nbadcrc)
|
if(niterations.ge.0) call chkcrc10(decoded,nbadcrc)
|
||||||
if(niterations.lt.0 .or. nbadcrc.ne.0) ifer=1
|
if(niterations.lt.0 .or. nbadcrc.ne.0) ifer=1
|
||||||
nsnr=nint(xsnr)
|
nsnr=nint(xsnr)
|
||||||
freq=fMHz + 1.d-6*f0
|
! freq=fMHz + 1.d-6*f0
|
||||||
|
freq=1.d-6*(f0+1500)
|
||||||
nfdot=0
|
nfdot=0
|
||||||
message=' '
|
message=' '
|
||||||
if(ifer.eq.0) then
|
if(ifer.eq.0) then
|
||||||
|
@ -1288,7 +1288,9 @@ void MainWindow::dataSink(qint64 frames)
|
|||||||
QString t3=cmnd;
|
QString t3=cmnd;
|
||||||
int i1=cmnd.indexOf("/wsprd ");
|
int i1=cmnd.indexOf("/wsprd ");
|
||||||
cmnd=t3.mid(0,i1+7) + t3.mid(i1+7);
|
cmnd=t3.mid(0,i1+7) + t3.mid(i1+7);
|
||||||
if(m_mode=="WSPR-LF") cmnd=cmnd.replace("/wsprd ","/wspr_fsk8d ");
|
QString degrade;
|
||||||
|
degrade.sprintf("-d %4.1f ",m_config.degrade());
|
||||||
|
if(m_mode=="WSPR-LF") cmnd=cmnd.replace("/wsprd ","/wspr_fsk8d "+degrade+t2);
|
||||||
if (ui) ui->DecodeButton->setChecked (true);
|
if (ui) ui->DecodeButton->setChecked (true);
|
||||||
m_cmndP1=QDir::toNativeSeparators(cmnd);
|
m_cmndP1=QDir::toNativeSeparators(cmnd);
|
||||||
p1Timer.start(1000);
|
p1Timer.start(1000);
|
||||||
@ -2226,7 +2228,6 @@ void MainWindow::diskDat() //diskDat()
|
|||||||
float db=m_config.degrade();
|
float db=m_config.degrade();
|
||||||
float bw=m_config.RxBandwidth();
|
float bw=m_config.RxBandwidth();
|
||||||
if(db > 0.0) degrade_snr_(dec_data.d2,&dec_data.params.kin,&db,&bw);
|
if(db > 0.0) degrade_snr_(dec_data.d2,&dec_data.params.kin,&db,&bw);
|
||||||
|
|
||||||
for(int n=1; n<=m_hsymStop; n++) { // Do the waterfall spectra
|
for(int n=1; n<=m_hsymStop; n++) { // Do the waterfall spectra
|
||||||
k=(n+1)*kstep;
|
k=(n+1)*kstep;
|
||||||
if(k > dec_data.params.kin) break;
|
if(k > dec_data.params.kin) break;
|
||||||
@ -5403,7 +5404,6 @@ void MainWindow::transmit (double snr)
|
|||||||
m_TRperiod);
|
m_TRperiod);
|
||||||
}
|
}
|
||||||
if (m_mode=="WSPR-LF") {
|
if (m_mode=="WSPR-LF") {
|
||||||
qDebug() << "a" << m_toneSpacing;
|
|
||||||
Q_EMIT sendMessage (NUM_WSPR_LF_SYMBOLS, 24576.0,
|
Q_EMIT sendMessage (NUM_WSPR_LF_SYMBOLS, 24576.0,
|
||||||
ui->TxFreqSpinBox->value(),
|
ui->TxFreqSpinBox->value(),
|
||||||
m_toneSpacing, m_soundOutput,
|
m_toneSpacing, m_soundOutput,
|
||||||
|
Loading…
Reference in New Issue
Block a user