mirror of https://github.com/saitohirga/WSJT-X.git
Changes to allow transmission of multi-signal waveforms in Fox mode.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8249 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
601193b9d7
commit
d2dc0fdb00
|
@ -5,6 +5,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "soundout.h"
|
#include "soundout.h"
|
||||||
|
#include "commons.h"
|
||||||
|
|
||||||
#include "moc_Modulator.cpp"
|
#include "moc_Modulator.cpp"
|
||||||
|
|
||||||
|
@ -86,7 +87,8 @@ void Modulator::start (unsigned symbolsLength, double framesPerSymbol,
|
||||||
if(m_bFastMode) m_ic=0;
|
if(m_bFastMode) m_ic=0;
|
||||||
|
|
||||||
m_silentFrames = 0;
|
m_silentFrames = 0;
|
||||||
// calculate number of silent frames to send
|
// calculate number of silent frames to send, so that audio will start at
|
||||||
|
// the nominal time "delay_ms" into the Tx sequence.
|
||||||
if (synchronize && !m_tuning && !m_bFastMode) {
|
if (synchronize && !m_tuning && !m_bFastMode) {
|
||||||
m_silentFrames = m_ic + m_frameRate / (1000 / delay_ms) - (mstr * (m_frameRate / 1000));
|
m_silentFrames = m_ic + m_frameRate / (1000 / delay_ms) - (mstr * (m_frameRate / 1000));
|
||||||
}
|
}
|
||||||
|
@ -168,6 +170,7 @@ qint64 Modulator::readData (char * data, qint64 maxSize)
|
||||||
case Active:
|
case Active:
|
||||||
{
|
{
|
||||||
unsigned int isym=0;
|
unsigned int isym=0;
|
||||||
|
// qDebug() << "Mod A" << m_toneSpacing << m_ic;
|
||||||
if(!m_tuning) isym=m_ic/(4.0*m_nsps); // Actual fsample=48000
|
if(!m_tuning) isym=m_ic/(4.0*m_nsps); // Actual fsample=48000
|
||||||
bool slowCwId=((isym >= m_symbolsLength) && (icw[0] > 0)) && (!m_bFastMode);
|
bool slowCwId=((isym >= m_symbolsLength) && (icw[0] > 0)) && (!m_bFastMode);
|
||||||
if(m_TRperiod==3) slowCwId=false;
|
if(m_TRperiod==3) slowCwId=false;
|
||||||
|
@ -248,7 +251,7 @@ qint64 Modulator::readData (char * data, qint64 maxSize)
|
||||||
i0=i1-816;
|
i0=i1-816;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint16 sample;
|
||||||
for (unsigned i = 0; i < numFrames && m_ic <= i1; ++i) {
|
for (unsigned i = 0; i < numFrames && m_ic <= i1; ++i) {
|
||||||
isym=0;
|
isym=0;
|
||||||
if(!m_tuning and m_TRperiod!=3) isym=m_ic / (4.0 * m_nsps); //Actual
|
if(!m_tuning and m_TRperiod!=3) isym=m_ic / (4.0 * m_nsps); //Actual
|
||||||
|
@ -264,7 +267,7 @@ qint64 Modulator::readData (char * data, qint64 maxSize)
|
||||||
m_toneFrequency0=m_frequency + itone[isym]*m_toneSpacing;
|
m_toneFrequency0=m_frequency + itone[isym]*m_toneSpacing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// qDebug() << "B" << m_bFastMode << m_ic << numFrames << isym << itone[isym]
|
// qDebug() << "Mod B" << m_bFastMode << m_ic << numFrames << isym << itone[isym]
|
||||||
// << m_toneFrequency0 << m_nsps;
|
// << m_toneFrequency0 << m_nsps;
|
||||||
m_dphi = m_twoPi * m_toneFrequency0 / m_frameRate;
|
m_dphi = m_twoPi * m_toneFrequency0 / m_frameRate;
|
||||||
m_isym0 = isym;
|
m_isym0 = isym;
|
||||||
|
@ -285,7 +288,12 @@ qint64 Modulator::readData (char * data, qint64 maxSize)
|
||||||
if (m_ic > i0) m_amp = 0.98 * m_amp;
|
if (m_ic > i0) m_amp = 0.98 * m_amp;
|
||||||
if (m_ic > i1) m_amp = 0.0;
|
if (m_ic > i1) m_amp = 0.0;
|
||||||
|
|
||||||
samples = load (postProcessSample (m_amp * qSin (m_phi)), samples);
|
sample=qRound(m_amp*qSin(m_phi));
|
||||||
|
if(m_toneSpacing < 0) sample=qRound(m_amp*foxcom_.wave[m_ic]);
|
||||||
|
|
||||||
|
// if(m_ic < 100) qDebug() << "Mod C" << m_ic << m_amp << foxcom_.wave[m_ic] << sample;
|
||||||
|
|
||||||
|
samples = load(postProcessSample(sample), samples);
|
||||||
++framesGenerated;
|
++framesGenerated;
|
||||||
++m_ic;
|
++m_ic;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,10 @@ extern struct {
|
||||||
float red[4096];
|
float red[4096];
|
||||||
} echocom_;
|
} echocom_;
|
||||||
|
|
||||||
|
extern struct {
|
||||||
|
float wave[606720];
|
||||||
|
} foxcom_;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,6 +14,7 @@ subroutine foxgen(t)
|
||||||
real x(NFFT),y(NFFT)
|
real x(NFFT),y(NFFT)
|
||||||
real*8 dt,twopi,f0,fstep,dfreq,phi,dphi
|
real*8 dt,twopi,f0,fstep,dfreq,phi,dphi
|
||||||
complex cx(0:NH),cy(0:NH)
|
complex cx(0:NH),cy(0:NH)
|
||||||
|
common/foxcom/wave
|
||||||
equivalence (x,cx),(y,cy)
|
equivalence (x,cx),(y,cy)
|
||||||
|
|
||||||
call system_clock(count0,clkfreq)
|
call system_clock(count0,clkfreq)
|
||||||
|
@ -67,10 +68,14 @@ subroutine foxgen(t)
|
||||||
|
|
||||||
call system_clock(count1,clkfreq)
|
call system_clock(count1,clkfreq)
|
||||||
time=float(count1-count0)/float(clkfreq) !Cumulative execution time
|
time=float(count1-count0)/float(clkfreq) !Cumulative execution time
|
||||||
! write(*,3001) n,k,time,msgsent
|
write(*,3001) n,k,i,time,msgsent
|
||||||
!3001 format(i1,i8,f10.6,2x,a22)
|
3001 format(i1,i8,i4,f10.6,2x,a22)
|
||||||
|
if(i.ge.m) exit
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
fac=1.0/maxval(abs(wave))
|
||||||
|
wave=fac*wave
|
||||||
|
|
||||||
x(1:k)=wave
|
x(1:k)=wave
|
||||||
x(k+1:)=0.
|
x(k+1:)=0.
|
||||||
call four2a(x,nfft,1,-1,0)
|
call four2a(x,nfft,1,-1,0)
|
||||||
|
@ -88,11 +93,11 @@ subroutine foxgen(t)
|
||||||
! sy=sy + real(cy(k))**2 + aimag(cy(k))**2
|
! sy=sy + real(cy(k))**2 + aimag(cy(k))**2
|
||||||
enddo
|
enddo
|
||||||
freq=df*(k-nadd/2+0.5)
|
freq=df*(k-nadd/2+0.5)
|
||||||
! write(29,1022) freq,sx,sy,db(sx)-90.0,db(sy)-90.0
|
write(29,1022) freq,sx,sy,db(sx)-90.0,db(sy)-90.0
|
||||||
!1022 format(f10.3,2e12.3,2f10.3)
|
1022 format(f10.3,2e12.3,2f10.3)
|
||||||
if(freq.gt.3000.0) exit
|
if(freq.gt.3000.0) exit
|
||||||
enddo
|
enddo
|
||||||
! flush(29)
|
flush(29)
|
||||||
|
|
||||||
call system_clock(count1,clkfreq)
|
call system_clock(count1,clkfreq)
|
||||||
time=float(count1-count0)/float(clkfreq) !Cumulative execution time
|
time=float(count1-count0)/float(clkfreq) !Cumulative execution time
|
||||||
|
|
|
@ -3326,11 +3326,10 @@ void MainWindow::guiUpdate()
|
||||||
if(m_config.bFox()) {
|
if(m_config.bFox()) {
|
||||||
QString t=ui->textBrowser3->toPlainText();
|
QString t=ui->textBrowser3->toPlainText();
|
||||||
int len=t.length();
|
int len=t.length();
|
||||||
qint64 ms0=QDateTime::currentMSecsSinceEpoch();
|
// qint64 ms0=QDateTime::currentMSecsSinceEpoch();
|
||||||
foxgen_(const_cast <char *> (t.toLatin1().constData()),len);
|
foxgen_(const_cast <char *> (t.toLatin1().constData()),len);
|
||||||
qint64 ms=QDateTime::currentMSecsSinceEpoch();
|
// qint64 ms=QDateTime::currentMSecsSinceEpoch();
|
||||||
qDebug() << "aa" << m_Nslots << ms-ms0 << t;
|
// qDebug() << "aa" << m_Nslots << ms-ms0 << t;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
genft8_(message, MyGrid, &bcontest, &m_i3bit, msgsent, const_cast<char *> (ft8msgbits),
|
genft8_(message, MyGrid, &bcontest, &m_i3bit, msgsent, const_cast<char *> (ft8msgbits),
|
||||||
const_cast<int *> (itone), 22, 6, 22);
|
const_cast<int *> (itone), 22, 6, 22);
|
||||||
|
@ -6001,6 +6000,7 @@ void MainWindow::transmit (double snr)
|
||||||
if (m_modeTx == "FT8") {
|
if (m_modeTx == "FT8") {
|
||||||
toneSpacing=12000.0/1920.0;
|
toneSpacing=12000.0/1920.0;
|
||||||
if(m_config.x2ToneSpacing()) toneSpacing=2*12000.0/1920.0;
|
if(m_config.x2ToneSpacing()) toneSpacing=2*12000.0/1920.0;
|
||||||
|
if(m_config.bFox()) toneSpacing=-1;
|
||||||
Q_EMIT sendMessage (NUM_FT8_SYMBOLS,
|
Q_EMIT sendMessage (NUM_FT8_SYMBOLS,
|
||||||
1920.0, ui->TxFreqSpinBox->value () - m_XIT,
|
1920.0, ui->TxFreqSpinBox->value () - m_XIT,
|
||||||
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
||||||
|
|
Loading…
Reference in New Issue