From 9626c5f9a02a5e86e5673001cf89d74d92672e38 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 6 Jul 2012 20:31:42 +0000 Subject: [PATCH] Now reading from files. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/jtms3@2495 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- getfile.cpp | 8 ++++---- jtms3.txt | 4 ++-- mainwindow.cpp | 24 ++++++++++-------------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/getfile.cpp b/getfile.cpp index f14f8ed5a..9382152b6 100644 --- a/getfile.cpp +++ b/getfile.cpp @@ -4,8 +4,6 @@ #include #include -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); } } diff --git a/jtms3.txt b/jtms3.txt index f97ad83a3..ee254819d 100644 --- a/jtms3.txt +++ b/jtms3.txt @@ -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. diff --git a/mainwindow.cpp b/mainwindow.cpp index 33d5ee6f1..8b3a1641d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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; nprocessEvents(); //Keep the GUI responsive + if(n%10 == 0) qApp->processEvents(); //Keep the GUI responsive } - */ } void MainWindow::diskWriteFinished() //diskWriteFinished