mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 04:11:16 -05:00
Now reading from files.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/jtms3@2495 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
20ba526656
commit
ac38b48549
@ -4,8 +4,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
extern qint16 id[4*60*96000];
|
||||
|
||||
void getfile(QString fname, bool xpol, int dbDgrd)
|
||||
{
|
||||
|
||||
@ -17,8 +15,10 @@ void getfile(QString fname, bool xpol, int dbDgrd)
|
||||
memset(datcom_.d2,0,2*npts);
|
||||
|
||||
if(fp != NULL) {
|
||||
// Should read WAV header first
|
||||
fread(datcom_.d2,2,npts,fp);
|
||||
// Read (and ignore) a 44-byte WAV header; then read data
|
||||
fread(datcom_.d2,1,44,fp);
|
||||
int nrd=fread(datcom_.d2,2,npts,fp);
|
||||
qDebug() << "Getfile" << npts << nrd;
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ sinc function for each bit, then multiplying by a 1500 Hz sine wave.
|
||||
|
||||
3. Receiving
|
||||
|
||||
a. Compute real-to-complex windowed FFTs, N=16384 (t=341 ms),
|
||||
stepped by 8k (say). Zap birdies, remove frequency components
|
||||
a. Compute real-to-complex windowed FFTs, N=8192 (t=170 ms),
|
||||
stepped by 4k (say). Zap birdies, remove frequency components
|
||||
outside the range 300 - 2700 Hz, and convert to analytic
|
||||
time-domain signal.
|
||||
|
||||
|
@ -193,7 +193,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
soundOutThread.setOutputDevice(m_paOutDevice);
|
||||
// soundOutThread.start(QThread::HighPriority);
|
||||
|
||||
m_monitoring=true; // Start with Monitoring ON
|
||||
m_monitoring=false; // Start with Monitoring OFF
|
||||
soundInThread.setMonitoring(m_monitoring);
|
||||
m_diskData=false;
|
||||
m_tol=500;
|
||||
@ -418,7 +418,6 @@ void MainWindow::dataSink(int k)
|
||||
}
|
||||
sqave=0.5*(sq+sq0);
|
||||
sq0=sq;
|
||||
// qDebug() << "rms:" << sqrt(sq/6192.0);
|
||||
px = 10.0*log10(sqave/6192.0);
|
||||
if(px>60.0) px=60.0;
|
||||
if(px<0.0) px=0.0;
|
||||
@ -452,7 +451,7 @@ void MainWindow::dataSink(int k)
|
||||
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
|
||||
int n300 = (ms/100) % 300;
|
||||
|
||||
qDebug() << "dataSink" << k << n300 << nwrite;
|
||||
qDebug() << "dataSink" << k << ms % 60000;
|
||||
if(n300 >= 295 and nwrite==0) {
|
||||
nwrite=1;
|
||||
if(m_saveAll) {
|
||||
@ -781,7 +780,7 @@ void MainWindow::on_actionOpen_triggered() //Open File
|
||||
on_stopButton_clicked();
|
||||
m_diskData=true;
|
||||
int dbDgrd=0;
|
||||
if(m_myCall=="K1JT" and m_idInt<0) dbDgrd=m_idInt;
|
||||
// if(m_myCall=="K1JT" and m_idInt<0) dbDgrd=m_idInt;
|
||||
*future1 = QtConcurrent::run(getfile, fname, m_xpol, dbDgrd);
|
||||
watcher1->setFuture(*future1);
|
||||
}
|
||||
@ -830,20 +829,17 @@ void MainWindow::on_actionDecode_remaining_files_in_directory_triggered()
|
||||
|
||||
void MainWindow::diskDat() //diskDat()
|
||||
{
|
||||
//These may be redundant??
|
||||
int kstep=4096;
|
||||
int nsteps;
|
||||
m_diskData=true;
|
||||
// datcom_.newdat=1;
|
||||
|
||||
/*
|
||||
double hsym;
|
||||
if(m_fs96000) hsym=2048.0*96000.0/11025.0; //Samples per JT65 half-symbol
|
||||
if(!m_fs96000) hsym=2048.0*95238.1/11025.0;
|
||||
for(int i=0; i<281; i++) { // Do the half-symbol FFTs
|
||||
int k = i*hsym + 2048.5;
|
||||
nsteps=29.5*48000/kstep;
|
||||
|
||||
for(int n=1; n<nsteps; n++) { // Do the half-symbol FFTs
|
||||
int k=(n+1)*kstep;
|
||||
dataSink(k);
|
||||
if(i%10 == 0) qApp->processEvents(); //Keep the GUI responsive
|
||||
if(n%10 == 0) qApp->processEvents(); //Keep the GUI responsive
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void MainWindow::diskWriteFinished() //diskWriteFinished
|
||||
|
Loading…
Reference in New Issue
Block a user