mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 20:58:55 -05:00
Further mods toward implementing JT8 modes.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2596 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
35e000d810
commit
61e3ffadc6
29
commons.h
29
commons.h
@ -5,15 +5,30 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
extern struct { //This is "common/mscom/..." in Fortran
|
extern struct {
|
||||||
short int d2[120*12000]; //Raw data from soundcard
|
short int d2[1800*12000]; //This is "common/jt8com/..." in fortran
|
||||||
float s1[215];
|
float ss[184*32768];
|
||||||
float s2[215];
|
float savg[32768];
|
||||||
|
double fcenter; //USB dial freq (kHz)
|
||||||
|
int nutc; //UTC as integer, HHMM
|
||||||
|
int mousedf; //User-selected DF
|
||||||
|
int mousefqso; //User-selected QSO freq (kHz)
|
||||||
|
int nagain; //1 ==> decode only at fQSO +/- Tol
|
||||||
|
int ndepth; //How much hinted decoding to do?
|
||||||
|
int ndiskdat; //1 ==> data read from *.tf2 or *.iq file
|
||||||
|
int newdat; //1 ==> new data, must do long FFT
|
||||||
|
int nfa; //Low decode limit (kHz)
|
||||||
|
int nfb; //High decode limit (kHz)
|
||||||
|
int ntol; //+/- decoding range around fQSO (Hz)
|
||||||
|
int map65RxLog; //Flags to control log files
|
||||||
|
int nfsample; //Input sample rate
|
||||||
|
int ntrperiod;
|
||||||
|
int nsave; //Number of s3(64,63) spectra saved
|
||||||
int kin;
|
int kin;
|
||||||
int ndiskdat;
|
|
||||||
int kline;
|
int kline;
|
||||||
int nutc;
|
char datetime[20];
|
||||||
} mscom_;
|
} jt8com_;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // COMMONS_H
|
#endif // COMMONS_H
|
||||||
|
10
getfile.cpp
10
getfile.cpp
@ -12,12 +12,12 @@ void getfile(QString fname, bool xpol, int dbDgrd)
|
|||||||
FILE* fp=fopen(name,"rb");
|
FILE* fp=fopen(name,"rb");
|
||||||
|
|
||||||
int npts=30*48000;
|
int npts=30*48000;
|
||||||
memset(mscom_.d2,0,2*npts);
|
memset(jt8com_.d2,0,2*npts);
|
||||||
|
|
||||||
if(fp != NULL) {
|
if(fp != NULL) {
|
||||||
// Read (and ignore) a 44-byte WAV header; then read data
|
// Read (and ignore) a 44-byte WAV header; then read data
|
||||||
fread(mscom_.d2,1,44,fp);
|
fread(jt8com_.d2,1,44,fp);
|
||||||
int nrd=fread(mscom_.d2,2,npts,fp);
|
int nrd=fread(jt8com_.d2,2,npts,fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,9 +75,9 @@ void savewav(QString fname)
|
|||||||
hdr.ndata=2*npts;
|
hdr.ndata=2*npts;
|
||||||
|
|
||||||
fwrite(&hdr,sizeof(hdr),1,fp);
|
fwrite(&hdr,sizeof(hdr),1,fp);
|
||||||
// memcpy(mscom_.d2,buf,2*npts);
|
// memcpy(jt8com_.d2,buf,2*npts);
|
||||||
// fwrite(buf,2,npts,fp);
|
// fwrite(buf,2,npts,fp);
|
||||||
fwrite(mscom_.d2,2,npts,fp);
|
fwrite(jt8com_.d2,2,npts,fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
// free(buf);
|
// free(buf);
|
||||||
|
@ -9,6 +9,7 @@ subroutine specjtms(k,px,pxsmo,spk0,f0)
|
|||||||
complex cx(MAXFFT),cx2(MAXFFT)
|
complex cx(MAXFFT),cx2(MAXFFT)
|
||||||
logical first
|
logical first
|
||||||
common/mscom/id(1440000),s1(215),s2(215),kin,ndiskdat,kline,nutc
|
common/mscom/id(1440000),s1(215),s2(215),kin,ndiskdat,kline,nutc
|
||||||
|
common/jt8com/nn(1800*12000),ss(184,32768),savg(32768)
|
||||||
data first/.true./
|
data first/.true./
|
||||||
save
|
save
|
||||||
|
|
||||||
|
@ -362,15 +362,15 @@ void MainWindow::dataSink(int k)
|
|||||||
|
|
||||||
if(m_diskData) {
|
if(m_diskData) {
|
||||||
ndiskdat=1;
|
ndiskdat=1;
|
||||||
mscom_.ndiskdat=1;
|
jt8com_.ndiskdat=1;
|
||||||
} else {
|
} else {
|
||||||
ndiskdat=0;
|
ndiskdat=0;
|
||||||
mscom_.ndiskdat=0;
|
jt8com_.ndiskdat=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
float d,sq=0;
|
float d,sq=0;
|
||||||
for(int i=0; i<2048; i++) {
|
for(int i=0; i<2048; i++) {
|
||||||
d=mscom_.d2[k-2048+i];
|
d=jt8com_.d2[k-2048+i];
|
||||||
sq += d*d;
|
sq += d*d;
|
||||||
}
|
}
|
||||||
px=10.0*log10(sq/2048.0) - 23.0;
|
px=10.0*log10(sq/2048.0) - 23.0;
|
||||||
|
@ -221,10 +221,10 @@ void CPlotter::draw(float s[], int i0, float splot[]) //draw()
|
|||||||
void CPlotter::UTCstr()
|
void CPlotter::UTCstr()
|
||||||
{
|
{
|
||||||
int ihr,imin,isec;
|
int ihr,imin,isec;
|
||||||
if(mscom_.ndiskdat != 0) {
|
if(jt8com_.ndiskdat != 0) {
|
||||||
ihr=mscom_.nutc/10000;
|
ihr=jt8com_.nutc/10000;
|
||||||
imin=(mscom_.nutc/100) % 100;
|
imin=(jt8com_.nutc/100) % 100;
|
||||||
isec=mscom_.nutc % 100;
|
isec=jt8com_.nutc % 100;
|
||||||
} else {
|
} else {
|
||||||
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
|
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
|
||||||
imin=ms/60000;
|
imin=ms/60000;
|
||||||
|
31
soundin.cpp
31
soundin.cpp
@ -1,20 +1,33 @@
|
|||||||
#include "soundin.h"
|
#include "soundin.h"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#define NFFT 32768
|
|
||||||
#define FRAMES_PER_BUFFER 1024
|
#define FRAMES_PER_BUFFER 1024
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <portaudio.h>
|
#include <portaudio.h>
|
||||||
extern struct {
|
extern struct {
|
||||||
short int d2[120*12000]; //This is "common/mscom/..." in fortran
|
short int d2[1800*12000]; //This is "common/jt8com/..." in fortran
|
||||||
float s1[215];
|
float ss[184*32768];
|
||||||
float s2[215];
|
float savg[32768];
|
||||||
|
double fcenter; //USB dial freq (kHz)
|
||||||
|
int nutc; //UTC as integer, HHMM
|
||||||
|
int mousedf; //User-selected DF
|
||||||
|
int mousefqso; //User-selected QSO freq (kHz)
|
||||||
|
int nagain; //1 ==> decode only at fQSO +/- Tol
|
||||||
|
int ndepth; //How much hinted decoding to do?
|
||||||
|
int ndiskdat; //1 ==> data read from *.tf2 or *.iq file
|
||||||
|
int newdat; //1 ==> new data, must do long FFT
|
||||||
|
int nfa; //Low decode limit (kHz)
|
||||||
|
int nfb; //High decode limit (kHz)
|
||||||
|
int ntol; //+/- decoding range around fQSO (Hz)
|
||||||
|
int map65RxLog; //Flags to control log files
|
||||||
|
int nfsample; //Input sample rate
|
||||||
|
int ntrperiod;
|
||||||
|
int nsave; //Number of s3(64,63) spectra saved
|
||||||
int kin;
|
int kin;
|
||||||
int ndiskdat;
|
|
||||||
int kline;
|
int kline;
|
||||||
int nutc;
|
char datetime[20];
|
||||||
} mscom_;
|
} jt8com_;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -53,9 +66,9 @@ extern "C" int a2dCallback( const void *inputBuffer, void *outputBuffer,
|
|||||||
|
|
||||||
nbytes=2*framesToProcess; //Bytes per frame
|
nbytes=2*framesToProcess; //Bytes per frame
|
||||||
k=udata->kin;
|
k=udata->kin;
|
||||||
memcpy(&mscom_.d2[k],inputBuffer,nbytes); //Copy all samples to d2
|
memcpy(&jt8com_.d2[k],inputBuffer,nbytes); //Copy all samples to d2
|
||||||
udata->kin += framesToProcess;
|
udata->kin += framesToProcess;
|
||||||
mscom_.kin=udata->kin;
|
jt8com_.kin=udata->kin;
|
||||||
|
|
||||||
return paContinue;
|
return paContinue;
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,7 @@ WideGraph::WideGraph(QWidget *parent) :
|
|||||||
m_waterfallAvg = settings.value("WaterfallAvg",10).toInt();
|
m_waterfallAvg = settings.value("WaterfallAvg",10).toInt();
|
||||||
ui->waterfallAvgSpinBox->setValue(m_waterfallAvg);
|
ui->waterfallAvgSpinBox->setValue(m_waterfallAvg);
|
||||||
ui->freqOffsetSpinBox->setValue(settings.value("FreqOffset",0).toInt());
|
ui->freqOffsetSpinBox->setValue(settings.value("FreqOffset",0).toInt());
|
||||||
m_bForceCenterFreq=settings.value("ForceCenterFreqBool",false).toBool();
|
m_dForceCenterFreq=settings.value("ForceCenterFreqMHz",473.000).toDouble();
|
||||||
m_dForceCenterFreq=settings.value("ForceCenterFreqMHz",144.125).toDouble();
|
|
||||||
// ui->cbFcenter->setChecked(m_bForceCenterFreq);
|
// ui->cbFcenter->setChecked(m_bForceCenterFreq);
|
||||||
ui->fCenterLineEdit->setText(QString::number(m_dForceCenterFreq));
|
ui->fCenterLineEdit->setText(QString::number(m_dForceCenterFreq));
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
@ -65,7 +64,6 @@ void WideGraph::saveSettings()
|
|||||||
settings.setValue("FreqSpan",ui->freqSpanSpinBox->value());
|
settings.setValue("FreqSpan",ui->freqSpanSpinBox->value());
|
||||||
settings.setValue("WaterfallAvg",ui->waterfallAvgSpinBox->value());
|
settings.setValue("WaterfallAvg",ui->waterfallAvgSpinBox->value());
|
||||||
settings.setValue("FreqOffset",ui->widePlot->freqOffset());
|
settings.setValue("FreqOffset",ui->widePlot->freqOffset());
|
||||||
settings.setValue("ForceCenterFreqBool",m_bForceCenterFreq);
|
|
||||||
settings.setValue("ForceCenterFreqMHz",m_dForceCenterFreq);
|
settings.setValue("ForceCenterFreqMHz",m_dForceCenterFreq);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
@ -262,29 +260,11 @@ void WideGraph::setMode65(int n)
|
|||||||
ui->widePlot->setMode65(n);
|
ui->widePlot->setMode65(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void WideGraph::on_cbFcenter_stateChanged(int n)
|
|
||||||
{
|
|
||||||
m_bForceCenterFreq = (n!=0);
|
|
||||||
if(m_bForceCenterFreq) {
|
|
||||||
ui->fCenterLineEdit->setEnabled(true);
|
|
||||||
ui->pbSetRxHardware->setEnabled(true);
|
|
||||||
} else {
|
|
||||||
ui->fCenterLineEdit->setDisabled(true);
|
|
||||||
ui->pbSetRxHardware->setDisabled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void WideGraph::on_fCenterLineEdit_editingFinished()
|
void WideGraph::on_fCenterLineEdit_editingFinished()
|
||||||
{
|
{
|
||||||
m_dForceCenterFreq=ui->fCenterLineEdit->text().toDouble();
|
m_dForceCenterFreq=ui->fCenterLineEdit->text().toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WideGraph::on_pbSetRxHardware_clicked()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void WideGraph::initIQplus()
|
void WideGraph::initIQplus()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,7 @@ public:
|
|||||||
explicit WideGraph(QWidget *parent = 0);
|
explicit WideGraph(QWidget *parent = 0);
|
||||||
~WideGraph();
|
~WideGraph();
|
||||||
|
|
||||||
bool m_bForceCenterFreq;
|
|
||||||
qint32 m_mult570;
|
|
||||||
double m_dForceCenterFreq;
|
double m_dForceCenterFreq;
|
||||||
double m_cal570;
|
|
||||||
|
|
||||||
void dataSink2(float s[], int nkhz, int ihsym, int ndiskdata,
|
void dataSink2(float s[], int nkhz, int ihsym, int ndiskdata,
|
||||||
uchar lstrong[]);
|
uchar lstrong[]);
|
||||||
@ -59,7 +56,6 @@ private slots:
|
|||||||
void on_autoZeroPushButton_clicked();
|
void on_autoZeroPushButton_clicked();
|
||||||
// void on_cbFcenter_stateChanged(int arg1);
|
// void on_cbFcenter_stateChanged(int arg1);
|
||||||
void on_fCenterLineEdit_editingFinished();
|
void on_fCenterLineEdit_editingFinished();
|
||||||
void on_pbSetRxHardware_clicked();
|
|
||||||
void on_cbSpec2d_toggled(bool checked);
|
void on_cbSpec2d_toggled(bool checked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
35
widegraph.ui
35
widegraph.ui
@ -83,13 +83,13 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> kHz</string>
|
<string> Hz</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-24</number>
|
<number>-500</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>24</number>
|
<number>500</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="singleStep">
|
<property name="singleStep">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
@ -149,19 +149,19 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> kHz</string>
|
<string> Hz</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>5</number>
|
<number>20</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>90</number>
|
<number>1000</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="singleStep">
|
<property name="singleStep">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>60</number>
|
<number>200</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -363,10 +363,17 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>USB Dial Freq (kHz)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="fCenterLineEdit">
|
<widget class="QLineEdit" name="fCenterLineEdit">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -381,17 +388,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>1296.065</string>
|
<string>473.000</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pbSetRxHardware">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Set Rx Freq</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user