Calibrate the S/N generated by putting "#-27", etc., into the Tx6 message.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2722 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-11-12 21:30:00 +00:00
parent ee55b12e8f
commit 37f7ffe23e
2 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,4 @@
//--------------------------------------------------------------- MainWindow //-------------------------------------------------------------- MainWindow
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "devsetup.h" #include "devsetup.h"

View File

@ -57,7 +57,7 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer,
freq=udata->ntxfreq + itone[isym]*baud; freq=udata->ntxfreq + itone[isym]*baud;
dphi=twopi*freq/48000.0; dphi=twopi*freq/48000.0;
if(udata->txsnrdb < 0.0) { if(udata->txsnrdb < 0.0) {
snr=pow(10.0,0.05*(udata->txsnrdb-1.0)); snr=pow(10.0,0.05*(udata->txsnrdb-6.0));
fac=3000.0; fac=3000.0;
if(snr>1.0) fac=3000.0/snr; if(snr>1.0) fac=3000.0/snr;
} }
@ -66,7 +66,6 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer,
phi += dphi; phi += dphi;
if(phi>twopi) phi -= twopi; if(phi>twopi) phi -= twopi;
i2=32767.0*sin(phi); i2=32767.0*sin(phi);
// i2 = 500.0*(i2/32767.0 + 5.0*gran()); //Add noise (tests only!)
if(udata->txsnrdb < 0.0) { if(udata->txsnrdb < 0.0) {
int i4=fac*(gran() + i2*snr/32768.0); int i4=fac*(gran() + i2*snr/32768.0);
if(i4>32767) i4=32767; if(i4>32767) i4=32767;