|
|
|
|
@ -38,9 +38,9 @@ TCPSrc::~TCPSrc()
@@ -38,9 +38,9 @@ TCPSrc::~TCPSrc()
|
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TCPSrc::configure(MessageQueue* messageQueue, SampleFormat sampleFormat, Real outputSampleRate, Real rfBandwidth, int tcpPort) |
|
|
|
|
void TCPSrc::configure(MessageQueue* messageQueue, SampleFormat sampleFormat, Real outputSampleRate, Real rfBandwidth, int tcpPort, int boost) |
|
|
|
|
{ |
|
|
|
|
Message* cmd = MsgTCPSrcConfigure::create(sampleFormat, outputSampleRate, rfBandwidth, tcpPort); |
|
|
|
|
Message* cmd = MsgTCPSrcConfigure::create(sampleFormat, outputSampleRate, rfBandwidth, tcpPort, boost); |
|
|
|
|
cmd->submit(messageQueue, this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -58,12 +58,15 @@ void TCPSrc::feed(SampleVector::const_iterator begin, SampleVector::const_iterat
@@ -58,12 +58,15 @@ void TCPSrc::feed(SampleVector::const_iterator begin, SampleVector::const_iterat
|
|
|
|
|
|
|
|
|
|
m_sampleBuffer.clear(); |
|
|
|
|
|
|
|
|
|
// Rtl-Sdr uses full 16-bit scale; FCDPP does not
|
|
|
|
|
int rescale = 20000 * m_boost * m_boost; |
|
|
|
|
|
|
|
|
|
for(SampleVector::const_iterator it = begin; it < end; ++it) { |
|
|
|
|
Complex c(it->real() / 32768.0, it->imag() / 32768.0); |
|
|
|
|
c *= m_nco.nextIQ(); |
|
|
|
|
|
|
|
|
|
if(m_interpolator.interpolate(&m_sampleDistanceRemain, c, &ci)) { |
|
|
|
|
m_sampleBuffer.push_back(Sample(ci.real() * 20000.0, ci.imag() * 20000.0)); |
|
|
|
|
m_sampleBuffer.push_back(Sample(ci.real() * rescale, ci.imag() * rescale)); |
|
|
|
|
m_sampleDistanceRemain += m_inputSampleRate / m_outputSampleRate; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -76,7 +79,7 @@ void TCPSrc::feed(SampleVector::const_iterator begin, SampleVector::const_iterat
@@ -76,7 +79,7 @@ void TCPSrc::feed(SampleVector::const_iterator begin, SampleVector::const_iterat
|
|
|
|
|
|
|
|
|
|
if((m_sampleFormat == FormatSSB) && (m_ssbSockets.count() > 0)) { |
|
|
|
|
for(SampleVector::const_iterator it = m_sampleBuffer.begin(); it != m_sampleBuffer.end(); ++it) { |
|
|
|
|
Complex cj(it->real() / 20000.0, it->imag() / 20000.0); |
|
|
|
|
Complex cj(it->real() / 30000.0, it->imag() / 30000.0); |
|
|
|
|
int n_out = TCPFilter->runSSB(cj, &sideband, true); |
|
|
|
|
if (n_out) { |
|
|
|
|
for (int i = 0; i < n_out; i+=2) { |
|
|
|
|
@ -93,7 +96,7 @@ void TCPSrc::feed(SampleVector::const_iterator begin, SampleVector::const_iterat
@@ -93,7 +96,7 @@ void TCPSrc::feed(SampleVector::const_iterator begin, SampleVector::const_iterat
|
|
|
|
|
|
|
|
|
|
if((m_sampleFormat == FormatNFM) && (m_ssbSockets.count() > 0)) { |
|
|
|
|
for(SampleVector::const_iterator it = m_sampleBuffer.begin(); it != m_sampleBuffer.end(); ++it) { |
|
|
|
|
Complex cj(it->real() / 20000.0, it->imag() / 20000.0); |
|
|
|
|
Complex cj(it->real() / 30000.0, it->imag() / 30000.0); |
|
|
|
|
int n_out = TCPFilter->runFilt(cj, &sideband); |
|
|
|
|
if (n_out) { |
|
|
|
|
Real sum = 1.0; |
|
|
|
|
@ -155,6 +158,7 @@ bool TCPSrc::handleMessage(Message* cmd)
@@ -155,6 +158,7 @@ bool TCPSrc::handleMessage(Message* cmd)
|
|
|
|
|
m_tcpServer->close(); |
|
|
|
|
m_tcpServer->listen(QHostAddress::Any, m_tcpPort); |
|
|
|
|
} |
|
|
|
|
m_boost = cfg->getBoost(); |
|
|
|
|
m_interpolator.create(16, m_inputSampleRate, m_rfBandwidth / 2.1); |
|
|
|
|
m_sampleDistanceRemain = m_inputSampleRate / m_outputSampleRate; |
|
|
|
|
TCPFilter->create_filter(0.048f / 48.0f, m_rfBandwidth / 2.0 / m_outputSampleRate); |
|
|
|
|
|