mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-19 14:54:54 -04:00
Differentiate Rx and Tx DSP sample sizes
This commit is contained in:
parent
bacc6659b0
commit
2ddcb8c358
CMakeLists.txt
devices/plutosdr
plugins
channelrx
chanalyzer
chanalyzerng
demodam
demodatv
demodbfm
demoddsd
demodlora
demodnfm
demodssb
demodwfm
tcpsrc
udpsrc
channeltx
modam
modatv
modnfm
modssb
modwfm
udpsink
samplesink
bladerfoutput
filesink
hackrfoutput
limesdroutput
plutosdroutput
samplesource
airspy
airspyhf
bladerfinput
hackrfinput
limesdrinput
plutosdrinput
rtlsdr
sdrplay
testsource
sdrbase/dsp
sdrgui/dsp
@ -28,7 +28,7 @@ option(V4L-MSI "Use Linux Kernel MSI2500 Source." OFF)
|
|||||||
option(BUILD_TYPE "Build type (RELEASE, RELEASEWITHDBGINFO, DEBUG" RELEASE)
|
option(BUILD_TYPE "Build type (RELEASE, RELEASEWITHDBGINFO, DEBUG" RELEASE)
|
||||||
option(DEBUG_OUTPUT "Print debug messages" OFF)
|
option(DEBUG_OUTPUT "Print debug messages" OFF)
|
||||||
option(HOST_RPI "Compiling on RPi" OFF)
|
option(HOST_RPI "Compiling on RPi" OFF)
|
||||||
option(SAMPLE_24BIT "Internal 24 bit DSP" OFF)
|
option(RX_SAMPLE_24BIT "Internal 24 bit Rx DSP" OFF)
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
||||||
|
|
||||||
@ -187,8 +187,8 @@ elseif (${ARCHITECTURE} MATCHES "aarch64")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compiler flags.
|
# Compiler flags.
|
||||||
if (SAMPLE_24BIT)
|
if (RX_SAMPLE_24BIT)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSDR_SAMPLE_24BIT")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSDR_RX_SAMPLE_24BIT")
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fmax-errors=10 -ffast-math -ftree-vectorize ${EXTRA_FLAGS}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fmax-errors=10 -ffast-math -ftree-vectorize ${EXTRA_FLAGS}")
|
||||||
|
|
||||||
|
@ -639,7 +639,7 @@ void DevicePlutoSDRBox::formatFIRCoefficients(std::ostringstream& ostr, uint32_t
|
|||||||
WFIR::BasicFIR(fcoeffs, nbTaps, WFIR::LPF, normalizedBW, 0.0, normalizedBW < 0.2 ? WFIR::wtHAMMING : WFIR::wtBLACKMAN_HARRIS, 0.0);
|
WFIR::BasicFIR(fcoeffs, nbTaps, WFIR::LPF, normalizedBW, 0.0, normalizedBW < 0.2 ? WFIR::wtHAMMING : WFIR::wtBLACKMAN_HARRIS, 0.0);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < nbTaps; i++) {
|
for (unsigned int i = 0; i < nbTaps; i++) {
|
||||||
ostr << (int16_t) (fcoeffs[i] * SDR_SCALEF) << ", " << (int16_t) (fcoeffs[i] * SDR_SCALEF) << std::endl;
|
ostr << (int16_t) (fcoeffs[i] * 32768.0f) << ", " << (int16_t) (fcoeffs[i] * 32768.0f) << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] fcoeffs;
|
delete[] fcoeffs;
|
||||||
|
@ -114,8 +114,8 @@ void ChannelAnalyzer::feed(const SampleVector::const_iterator& begin, const Samp
|
|||||||
if (!(m_undersampleCount++ & decim_mask))
|
if (!(m_undersampleCount++ & decim_mask))
|
||||||
{
|
{
|
||||||
m_sum /= decim;
|
m_sum /= decim;
|
||||||
Real re = m_sum.real() / SDR_SCALED;
|
Real re = m_sum.real() / SDR_RX_SCALED;
|
||||||
Real im = m_sum.imag() / SDR_SCALED;
|
Real im = m_sum.imag() / SDR_RX_SCALED;
|
||||||
m_magsq = re*re + im*im;
|
m_magsq = re*re + im*im;
|
||||||
|
|
||||||
if (m_ssb & !m_usb)
|
if (m_ssb & !m_usb)
|
||||||
|
@ -229,8 +229,8 @@ private:
|
|||||||
if (!(m_undersampleCount++ & (decim - 1))) // counter LSB bit mask for decimation by 2^(m_scaleLog2 - 1)
|
if (!(m_undersampleCount++ & (decim - 1))) // counter LSB bit mask for decimation by 2^(m_scaleLog2 - 1)
|
||||||
{
|
{
|
||||||
m_sum /= decim;
|
m_sum /= decim;
|
||||||
Real re = m_sum.real() / SDR_SCALED;
|
Real re = m_sum.real() / SDR_RX_SCALED;
|
||||||
Real im = m_sum.imag() / SDR_SCALED;
|
Real im = m_sum.imag() / SDR_RX_SCALED;
|
||||||
m_magsq = re*re + im*im;
|
m_magsq = re*re + im*im;
|
||||||
|
|
||||||
if (m_running.m_ssb & !m_usb)
|
if (m_running.m_ssb & !m_usb)
|
||||||
|
@ -161,8 +161,8 @@ private:
|
|||||||
|
|
||||||
void processOneSample(Complex &ci)
|
void processOneSample(Complex &ci)
|
||||||
{
|
{
|
||||||
Real re = ci.real() / SDR_SCALED;
|
Real re = ci.real() / SDR_RX_SCALED;
|
||||||
Real im = ci.imag() / SDR_SCALED;
|
Real im = ci.imag() / SDR_RX_SCALED;
|
||||||
Real magsq = re*re + im*im;
|
Real magsq = re*re + im*im;
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
m_magsq = m_movingAverage.average();
|
m_magsq = m_movingAverage.average();
|
||||||
@ -210,7 +210,7 @@ private:
|
|||||||
|
|
||||||
Real attack = (m_squelchCount - 0.05f * m_settings.m_audioSampleRate) / (0.05f * m_settings.m_audioSampleRate);
|
Real attack = (m_squelchCount - 0.05f * m_settings.m_audioSampleRate) / (0.05f * m_settings.m_audioSampleRate);
|
||||||
sample = demod * attack * 2048 * m_settings.m_volume;
|
sample = demod * attack * 2048 * m_settings.m_volume;
|
||||||
if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(demod * attack * SDR_SCALEF);
|
if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(demod * attack * SDR_RX_SCALEF);
|
||||||
|
|
||||||
m_squelchOpen = true;
|
m_squelchOpen = true;
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,7 @@ void ATVDemod::demod(Complex& c)
|
|||||||
magSq = fltI*fltI + fltQ*fltQ;
|
magSq = fltI*fltI + fltQ*fltQ;
|
||||||
m_objMagSqAverage.feed(magSq);
|
m_objMagSqAverage.feed(magSq);
|
||||||
fltNorm = sqrt(magSq);
|
fltNorm = sqrt(magSq);
|
||||||
fltVal = fltNorm / SDR_SCALEF;
|
fltVal = fltNorm / SDR_RX_SCALEF;
|
||||||
|
|
||||||
//********** Mini and Maxi Amplitude tracking **********
|
//********** Mini and Maxi Amplitude tracking **********
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ void ATVDemodGUI::tick()
|
|||||||
if (m_atvDemod)
|
if (m_atvDemod)
|
||||||
{
|
{
|
||||||
m_objMagSqAverage.feed(m_atvDemod->getMagSq());
|
m_objMagSqAverage.feed(m_atvDemod->getMagSq());
|
||||||
double magSqDB = CalcDb::dbPower(m_objMagSqAverage.average() / (SDR_SCALED*SDR_SCALED));
|
double magSqDB = CalcDb::dbPower(m_objMagSqAverage.average() / (SDR_RX_SCALED*SDR_RX_SCALED));
|
||||||
ui->channePowerText->setText(tr("%1 dB").arg(magSqDB, 0, 'f', 1));
|
ui->channePowerText->setText(tr("%1 dB").arg(magSqDB, 0, 'f', 1));
|
||||||
|
|
||||||
if (m_atvDemod->getBFOLocked()) {
|
if (m_atvDemod->getBFOLocked()) {
|
||||||
|
@ -125,7 +125,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
|
|
||||||
for (SampleVector::const_iterator it = begin; it != end; ++it)
|
for (SampleVector::const_iterator it = begin; it != end; ++it)
|
||||||
{
|
{
|
||||||
Complex c(it->real() / SDR_SCALEF, it->imag() / SDR_SCALEF);
|
Complex c(it->real() / SDR_RX_SCALEF, it->imag() / SDR_RX_SCALEF);
|
||||||
c *= m_nco.nextIQ();
|
c *= m_nco.nextIQ();
|
||||||
|
|
||||||
rf_out = m_rfFilter->runFilt(c, &rf); // filter RF before demod
|
rf_out = m_rfFilter->runFilt(c, &rf); // filter RF before demod
|
||||||
@ -163,7 +163,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
|
|
||||||
if (!m_settings.m_showPilot)
|
if (!m_settings.m_showPilot)
|
||||||
{
|
{
|
||||||
m_sampleBuffer.push_back(Sample(demod * SDR_SCALEF, 0.0));
|
m_sampleBuffer.push_back(Sample(demod * SDR_RX_SCALEF, 0.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_settings.m_rdsActive)
|
if (m_settings.m_rdsActive)
|
||||||
@ -197,7 +197,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
|
|
||||||
if (m_settings.m_showPilot)
|
if (m_settings.m_showPilot)
|
||||||
{
|
{
|
||||||
m_sampleBuffer.push_back(Sample(m_pilotPLLSamples[1] * SDR_SCALEF, 0.0)); // debug 38 kHz pilot
|
m_sampleBuffer.push_back(Sample(m_pilotPLLSamples[1] * SDR_RX_SCALEF, 0.0)); // debug 38 kHz pilot
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_settings.m_lsbStereo)
|
if (m_settings.m_lsbStereo)
|
||||||
|
@ -128,8 +128,8 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
{
|
{
|
||||||
qint16 sample, delayedSample;
|
qint16 sample, delayedSample;
|
||||||
|
|
||||||
Real re = ci.real() / SDR_SCALED;
|
Real re = ci.real() / SDR_RX_SCALED;
|
||||||
Real im = ci.imag() / SDR_SCALED;
|
Real im = ci.imag() / SDR_RX_SCALED;
|
||||||
Real magsq = re*re + im*im;
|
Real magsq = re*re + im*im;
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
|
|
||||||
m_magsqCount++;
|
m_magsqCount++;
|
||||||
|
|
||||||
Real demod = SDR_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_demodGain;
|
Real demod = SDR_RX_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_demodGain;
|
||||||
m_sampleCount++;
|
m_sampleCount++;
|
||||||
|
|
||||||
// AF processing
|
// AF processing
|
||||||
|
@ -261,7 +261,7 @@ void LoRaDemod::feed(const SampleVector::const_iterator& begin, const SampleVect
|
|||||||
|
|
||||||
for(SampleVector::const_iterator it = begin; it < end; ++it)
|
for(SampleVector::const_iterator it = begin; it < end; ++it)
|
||||||
{
|
{
|
||||||
Complex c(it->real() / SDR_SCALEF, it->imag() / SDR_SCALEF);
|
Complex c(it->real() / SDR_RX_SCALEF, it->imag() / SDR_RX_SCALEF);
|
||||||
c *= m_nco.nextIQ();
|
c *= m_nco.nextIQ();
|
||||||
|
|
||||||
if(m_interpolator.decimate(&m_sampleDistanceRemain, c, &ci))
|
if(m_interpolator.decimate(&m_sampleDistanceRemain, c, &ci))
|
||||||
|
@ -153,7 +153,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
|
|
||||||
Real demod = m_phaseDiscri.phaseDiscriminatorDelta(ci, magsqRaw, deviation);
|
Real demod = m_phaseDiscri.phaseDiscriminatorDelta(ci, magsqRaw, deviation);
|
||||||
|
|
||||||
Real magsq = magsqRaw / (SDR_SCALED*SDR_SCALED);
|
Real magsq = magsqRaw / (SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
m_magsqSum += magsq;
|
m_magsqSum += magsq;
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) :
|
|||||||
m_magsqPeak = 0.0f;
|
m_magsqPeak = 0.0f;
|
||||||
m_magsqCount = 0;
|
m_magsqCount = 0;
|
||||||
|
|
||||||
m_agc.setClampMax(SDR_SCALED*SDR_SCALED);
|
m_agc.setClampMax(SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
m_agc.setClamping(m_agcClamping);
|
m_agc.setClamping(m_agcClamping);
|
||||||
|
|
||||||
SSBFilter = new fftfilt(m_LowCutoff / m_audioSampleRate, m_Bandwidth / m_audioSampleRate, ssbFftLen);
|
SSBFilter = new fftfilt(m_LowCutoff / m_audioSampleRate, m_Bandwidth / m_audioSampleRate, ssbFftLen);
|
||||||
@ -186,7 +186,7 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
{
|
{
|
||||||
Real avgr = m_sum.real() / decim;
|
Real avgr = m_sum.real() / decim;
|
||||||
Real avgi = m_sum.imag() / decim;
|
Real avgi = m_sum.imag() / decim;
|
||||||
m_magsq = (avgr * avgr + avgi * avgi) / (SDR_SCALED*SDR_SCALED);
|
m_magsq = (avgr * avgr + avgi * avgi) / (SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
|
|
||||||
m_magsqSum += m_magsq;
|
m_magsqSum += m_magsq;
|
||||||
|
|
||||||
@ -427,7 +427,7 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
|
|||||||
{
|
{
|
||||||
int agcNbSamples = 48 * (1<<settings.m_agcTimeLog2);
|
int agcNbSamples = 48 * (1<<settings.m_agcTimeLog2);
|
||||||
m_agc.setThresholdEnable(settings.m_agcPowerThreshold != -99);
|
m_agc.setThresholdEnable(settings.m_agcPowerThreshold != -99);
|
||||||
double agcPowerThreshold = CalcDb::powerFromdB(settings.m_agcPowerThreshold) * (SDR_SCALED*SDR_SCALED);
|
double agcPowerThreshold = CalcDb::powerFromdB(settings.m_agcPowerThreshold) * (SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
int agcThresholdGate = 48 * settings.m_agcThresholdGate; // ms
|
int agcThresholdGate = 48 * settings.m_agcThresholdGate; // ms
|
||||||
bool agcClamping = settings.m_agcClamping;
|
bool agcClamping = settings.m_agcClamping;
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ void WFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
for (int i = 0 ; i < rf_out; i++)
|
for (int i = 0 ; i < rf_out; i++)
|
||||||
{
|
{
|
||||||
demod = m_phaseDiscri.phaseDiscriminatorDelta(rf[i], msq, fmDev);
|
demod = m_phaseDiscri.phaseDiscriminatorDelta(rf[i], msq, fmDev);
|
||||||
Real magsq = msq / (SDR_SCALED*SDR_SCALED);
|
Real magsq = msq / (SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
|
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
m_magsqSum += magsq;
|
m_magsqSum += magsq;
|
||||||
|
@ -105,7 +105,7 @@ void TCPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
|
|
||||||
if(m_interpolator.decimate(&m_sampleDistanceRemain, c, &ci))
|
if(m_interpolator.decimate(&m_sampleDistanceRemain, c, &ci))
|
||||||
{
|
{
|
||||||
m_magsq = ((ci.real()*ci.real() + ci.imag()*ci.imag())*rescale*rescale) / (SDR_SCALED*SDR_SCALED);
|
m_magsq = ((ci.real()*ci.real() + ci.imag()*ci.imag())*rescale*rescale) / (SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
m_sampleBuffer.push_back(Sample(ci.real() * rescale, ci.imag() * rescale));
|
m_sampleBuffer.push_back(Sample(ci.real() * rescale, ci.imag() * rescale));
|
||||||
m_sampleDistanceRemain += m_inputSampleRate / m_outputSampleRate;
|
m_sampleDistanceRemain += m_inputSampleRate / m_outputSampleRate;
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ void TCPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
|
|
||||||
if((m_sampleFormat == TCPSrcSettings::FormatNFM) && (m_ssbSockets.count() > 0)) {
|
if((m_sampleFormat == TCPSrcSettings::FormatNFM) && (m_ssbSockets.count() > 0)) {
|
||||||
for(SampleVector::const_iterator it = m_sampleBuffer.begin(); it != m_sampleBuffer.end(); ++it) {
|
for(SampleVector::const_iterator it = m_sampleBuffer.begin(); it != m_sampleBuffer.end(); ++it) {
|
||||||
Complex cj(it->real() / SDR_SCALEF, it->imag() / SDR_SCALEF);
|
Complex cj(it->real() / SDR_RX_SCALEF, it->imag() / SDR_RX_SCALEF);
|
||||||
// An FFT filter here is overkill, but was already set up for SSB
|
// An FFT filter here is overkill, but was already set up for SSB
|
||||||
int n_out = TCPFilter->runFilt(cj, &sideband);
|
int n_out = TCPFilter->runFilt(cj, &sideband);
|
||||||
if (n_out) {
|
if (n_out) {
|
||||||
|
@ -92,7 +92,7 @@ UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) :
|
|||||||
qWarning("UDPSrc::UDPSrc: cannot bind audio port");
|
qWarning("UDPSrc::UDPSrc: cannot bind audio port");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_agc.setClampMax(SDR_SCALED*SDR_SCALED);
|
m_agc.setClampMax(SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
m_agc.setClamping(true);
|
m_agc.setClamping(true);
|
||||||
|
|
||||||
//DSPEngine::instance()->addAudioSink(&m_audioFifo);
|
//DSPEngine::instance()->addAudioSink(&m_audioFifo);
|
||||||
@ -158,7 +158,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
inMagSq = ci.real()*ci.real() + ci.imag()*ci.imag();
|
inMagSq = ci.real()*ci.real() + ci.imag()*ci.imag();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_inMovingAverage.feed(inMagSq / (SDR_SCALED*SDR_SCALED));
|
m_inMovingAverage.feed(inMagSq / (SDR_RX_SCALED*SDR_RX_SCALED));
|
||||||
m_inMagsq = m_inMovingAverage.average();
|
m_inMagsq = m_inMovingAverage.average();
|
||||||
|
|
||||||
Sample ss(ci.real(), ci.imag());
|
Sample ss(ci.real(), ci.imag());
|
||||||
@ -180,7 +180,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
l = m_squelchOpen ? sideband[i].real() * m_settings.m_gain : 0;
|
l = m_squelchOpen ? sideband[i].real() * m_settings.m_gain : 0;
|
||||||
r = m_squelchOpen ? sideband[i].imag() * m_settings.m_gain : 0;
|
r = m_squelchOpen ? sideband[i].imag() * m_settings.m_gain : 0;
|
||||||
m_udpBuffer->write(Sample(l, r));
|
m_udpBuffer->write(Sample(l, r));
|
||||||
m_outMovingAverage.feed((l*l + r*r) / (SDR_SCALED*SDR_SCALED));
|
m_outMovingAverage.feed((l*l + r*r) / (SDR_RX_SCALED*SDR_RX_SCALED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -196,21 +196,21 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
l = m_squelchOpen ? sideband[i].real() * m_settings.m_gain : 0;
|
l = m_squelchOpen ? sideband[i].real() * m_settings.m_gain : 0;
|
||||||
r = m_squelchOpen ? sideband[i].imag() * m_settings.m_gain : 0;
|
r = m_squelchOpen ? sideband[i].imag() * m_settings.m_gain : 0;
|
||||||
m_udpBuffer->write(Sample(l, r));
|
m_udpBuffer->write(Sample(l, r));
|
||||||
m_outMovingAverage.feed((l*l + r*r) / (SDR_SCALED*SDR_SCALED));
|
m_outMovingAverage.feed((l*l + r*r) / (SDR_RX_SCALED*SDR_RX_SCALED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatNFM)
|
else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatNFM)
|
||||||
{
|
{
|
||||||
double demod = m_squelchOpen ? SDR_SCALED * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain : 0;
|
double demod = m_squelchOpen ? SDR_RX_SCALED * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain : 0;
|
||||||
m_udpBuffer->write(Sample(demod, demod));
|
m_udpBuffer->write(Sample(demod, demod));
|
||||||
m_outMovingAverage.feed((demod * demod) / (SDR_SCALED*SDR_SCALED));
|
m_outMovingAverage.feed((demod * demod) / (SDR_RX_SCALED*SDR_RX_SCALED));
|
||||||
}
|
}
|
||||||
else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatNFMMono)
|
else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatNFMMono)
|
||||||
{
|
{
|
||||||
FixReal demod = m_squelchOpen ? (FixReal) (SDR_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain) : 0;
|
FixReal demod = m_squelchOpen ? (FixReal) (SDR_RX_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain) : 0;
|
||||||
m_udpBufferMono->write(demod);
|
m_udpBufferMono->write(demod);
|
||||||
m_outMovingAverage.feed((demod * demod) / 1073741824.0);
|
m_outMovingAverage.feed((demod * demod) / SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
}
|
}
|
||||||
else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatLSBMono) // Monaural LSB
|
else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatLSBMono) // Monaural LSB
|
||||||
{
|
{
|
||||||
@ -223,7 +223,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
{
|
{
|
||||||
l = m_squelchOpen ? (sideband[i].real() + sideband[i].imag()) * 0.7 * m_settings.m_gain : 0;
|
l = m_squelchOpen ? (sideband[i].real() + sideband[i].imag()) * 0.7 * m_settings.m_gain : 0;
|
||||||
m_udpBufferMono->write(l);
|
m_udpBufferMono->write(l);
|
||||||
m_outMovingAverage.feed((l * l) / (SDR_SCALED*SDR_SCALED));
|
m_outMovingAverage.feed((l * l) / (SDR_RX_SCALED*SDR_RX_SCALED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
{
|
{
|
||||||
l = m_squelchOpen ? (sideband[i].real() + sideband[i].imag()) * 0.7 * m_settings.m_gain : 0;
|
l = m_squelchOpen ? (sideband[i].real() + sideband[i].imag()) * 0.7 * m_settings.m_gain : 0;
|
||||||
m_udpBufferMono->write(l);
|
m_udpBufferMono->write(l);
|
||||||
m_outMovingAverage.feed((l * l) / (SDR_SCALED*SDR_SCALED));
|
m_outMovingAverage.feed((l * l) / (SDR_RX_SCALED*SDR_RX_SCALED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -246,7 +246,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
{
|
{
|
||||||
FixReal demod = m_squelchOpen ? (FixReal) (sqrt(inMagSq) * agcFactor * m_settings.m_gain) : 0;
|
FixReal demod = m_squelchOpen ? (FixReal) (sqrt(inMagSq) * agcFactor * m_settings.m_gain) : 0;
|
||||||
m_udpBufferMono->write(demod);
|
m_udpBufferMono->write(demod);
|
||||||
m_outMovingAverage.feed((demod * demod) / 1073741824.0);
|
m_outMovingAverage.feed((demod * demod) / SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
}
|
}
|
||||||
else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatAMNoDCMono)
|
else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatAMNoDCMono)
|
||||||
{
|
{
|
||||||
@ -256,7 +256,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
m_amMovingAverage.feed(demodf);
|
m_amMovingAverage.feed(demodf);
|
||||||
FixReal demod = (FixReal) ((demodf - m_amMovingAverage.average()) * agcFactor * m_settings.m_gain);
|
FixReal demod = (FixReal) ((demodf - m_amMovingAverage.average()) * agcFactor * m_settings.m_gain);
|
||||||
m_udpBufferMono->write(demod);
|
m_udpBufferMono->write(demod);
|
||||||
m_outMovingAverage.feed((demod * demod) / 1073741824.0);
|
m_outMovingAverage.feed((demod * demod) / SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -273,7 +273,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
demodf /= 301.0;
|
demodf /= 301.0;
|
||||||
FixReal demod = (FixReal) (demodf * agcFactor * m_settings.m_gain);
|
FixReal demod = (FixReal) (demodf * agcFactor * m_settings.m_gain);
|
||||||
m_udpBufferMono->write(demod);
|
m_udpBufferMono->write(demod);
|
||||||
m_outMovingAverage.feed((demod * demod) / 1073741824.0);
|
m_outMovingAverage.feed((demod * demod) / SDR_RX_SCALED*SDR_RX_SCALED);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -287,7 +287,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
{
|
{
|
||||||
Sample s(ci.real() * m_settings.m_gain, ci.imag() * m_settings.m_gain);
|
Sample s(ci.real() * m_settings.m_gain, ci.imag() * m_settings.m_gain);
|
||||||
m_udpBuffer->write(s);
|
m_udpBuffer->write(s);
|
||||||
m_outMovingAverage.feed((inMagSq*m_settings.m_gain*m_settings.m_gain) / (SDR_SCALED*SDR_SCALED));
|
m_outMovingAverage.feed((inMagSq*m_settings.m_gain*m_settings.m_gain) / (SDR_RX_SCALED*SDR_RX_SCALED));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -130,7 +130,7 @@ void AMMod::pull(Sample& sample)
|
|||||||
m_settingsMutex.unlock();
|
m_settingsMutex.unlock();
|
||||||
|
|
||||||
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
||||||
magsq /= (SDR_SCALED*SDR_SCALED);
|
magsq /= (SDR_TX_SCALED*SDR_TX_SCALED);
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
m_magsq = m_movingAverage.average();
|
m_magsq = m_movingAverage.average();
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ void ATVMod::pullFinalize(Complex& ci, Sample& sample)
|
|||||||
m_settingsMutex.unlock();
|
m_settingsMutex.unlock();
|
||||||
|
|
||||||
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
||||||
magsq /= (SDR_SCALED*SDR_SCALED);
|
magsq /= (SDR_TX_SCALED*SDR_TX_SCALED);
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
|
|
||||||
sample.m_real = (FixReal) ci.real();
|
sample.m_real = (FixReal) ci.real();
|
||||||
|
@ -43,7 +43,7 @@ void ATVModSettings::resetToDefaults()
|
|||||||
m_cameraPlay = false;
|
m_cameraPlay = false;
|
||||||
m_channelMute = false;
|
m_channelMute = false;
|
||||||
m_invertedVideo = false;
|
m_invertedVideo = false;
|
||||||
m_rfScalingFactor = 0.891235351562f * SDR_SCALEF; // -1dB
|
m_rfScalingFactor = 0.891235351562f * SDR_TX_SCALEF; // -1dB
|
||||||
m_fmExcursion = 0.5f; // half bandwidth
|
m_fmExcursion = 0.5f; // half bandwidth
|
||||||
m_forceDecimator = false;
|
m_forceDecimator = false;
|
||||||
m_overlayText = "ATV";
|
m_overlayText = "ATV";
|
||||||
|
@ -136,7 +136,7 @@ void NFMMod::pull(Sample& sample)
|
|||||||
m_settingsMutex.unlock();
|
m_settingsMutex.unlock();
|
||||||
|
|
||||||
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
||||||
magsq /= (SDR_SCALED*SDR_SCALED);
|
magsq /= (SDR_TX_SCALED*SDR_TX_SCALED);
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
m_magsq = m_movingAverage.average();
|
m_magsq = m_movingAverage.average();
|
||||||
|
|
||||||
@ -175,8 +175,8 @@ void NFMMod::modulateSample()
|
|||||||
m_modPhasor += (m_settings.m_fmDeviation / (float) m_settings.m_audioSampleRate) * m_bandpass.filter(t) * (M_PI / 378.0f);
|
m_modPhasor += (m_settings.m_fmDeviation / (float) m_settings.m_audioSampleRate) * m_bandpass.filter(t) * (M_PI / 378.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_modSample.real(cos(m_modPhasor) * 0.891235351562f * SDR_SCALEF); // -1 dB
|
m_modSample.real(cos(m_modPhasor) * 0.891235351562f * SDR_TX_SCALEF); // -1 dB
|
||||||
m_modSample.imag(sin(m_modPhasor) * 0.891235351562f * SDR_SCALEF);
|
m_modSample.imag(sin(m_modPhasor) * 0.891235351562f * SDR_TX_SCALEF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NFMMod::pullAF(Real& sample)
|
void NFMMod::pullAF(Real& sample)
|
||||||
|
@ -160,12 +160,12 @@ void SSBMod::pull(Sample& sample)
|
|||||||
m_interpolatorDistanceRemain += m_interpolatorDistance;
|
m_interpolatorDistanceRemain += m_interpolatorDistance;
|
||||||
|
|
||||||
ci *= m_carrierNco.nextIQ(); // shift to carrier frequency
|
ci *= m_carrierNco.nextIQ(); // shift to carrier frequency
|
||||||
ci *= 0.891235351562f * SDR_SCALEF; //scaling at -1 dB to account for possible filter overshoot
|
ci *= 0.891235351562f * SDR_TX_SCALEF; //scaling at -1 dB to account for possible filter overshoot
|
||||||
|
|
||||||
m_settingsMutex.unlock();
|
m_settingsMutex.unlock();
|
||||||
|
|
||||||
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
||||||
magsq /= (SDR_SCALED*SDR_SCALED);
|
magsq /= (SDR_TX_SCALED*SDR_TX_SCALED);
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
m_magsq = m_movingAverage.average();
|
m_magsq = m_movingAverage.average();
|
||||||
|
|
||||||
@ -298,13 +298,13 @@ void SSBMod::pullAF(Complex& sample)
|
|||||||
{
|
{
|
||||||
if (m_settings.m_audioFlipChannels)
|
if (m_settings.m_audioFlipChannels)
|
||||||
{
|
{
|
||||||
ci.real((m_audioBuffer[m_audioBufferFill].r / SDR_SCALEF) * m_settings.m_volumeFactor);
|
ci.real((m_audioBuffer[m_audioBufferFill].r / SDR_TX_SCALEF) * m_settings.m_volumeFactor);
|
||||||
ci.imag((m_audioBuffer[m_audioBufferFill].l / SDR_SCALEF) * m_settings.m_volumeFactor);
|
ci.imag((m_audioBuffer[m_audioBufferFill].l / SDR_TX_SCALEF) * m_settings.m_volumeFactor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ci.real((m_audioBuffer[m_audioBufferFill].l / SDR_SCALEF) * m_settings.m_volumeFactor);
|
ci.real((m_audioBuffer[m_audioBufferFill].l / SDR_TX_SCALEF) * m_settings.m_volumeFactor);
|
||||||
ci.imag((m_audioBuffer[m_audioBufferFill].r / SDR_SCALEF) * m_settings.m_volumeFactor);
|
ci.imag((m_audioBuffer[m_audioBufferFill].r / SDR_TX_SCALEF) * m_settings.m_volumeFactor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -419,8 +419,8 @@ void SSBMod::pullAF(Complex& sample)
|
|||||||
|
|
||||||
if (!(m_undersampleCount++ & decim_mask))
|
if (!(m_undersampleCount++ & decim_mask))
|
||||||
{
|
{
|
||||||
Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_SCALEF; //scaling at -1 dB to account for possible filter overshoot
|
Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_TX_SCALEF; //scaling at -1 dB to account for possible filter overshoot
|
||||||
Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_SCALEF;
|
Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_TX_SCALEF;
|
||||||
|
|
||||||
if (!m_settings.m_dsb & !m_settings.m_usb)
|
if (!m_settings.m_dsb & !m_settings.m_usb)
|
||||||
{ // invert spectrum for LSB
|
{ // invert spectrum for LSB
|
||||||
@ -443,8 +443,8 @@ void SSBMod::pullAF(Complex& sample)
|
|||||||
|
|
||||||
if (!(m_undersampleCount++ & decim_mask))
|
if (!(m_undersampleCount++ & decim_mask))
|
||||||
{
|
{
|
||||||
Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_SCALEF; //scaling at -1 dB to account for possible filter overshoot
|
Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_TX_SCALEF; //scaling at -1 dB to account for possible filter overshoot
|
||||||
Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_SCALEF;
|
Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_TX_SCALEF;
|
||||||
|
|
||||||
if (!m_settings.m_dsb & !m_settings.m_usb)
|
if (!m_settings.m_dsb & !m_settings.m_usb)
|
||||||
{ // invert spectrum for LSB
|
{ // invert spectrum for LSB
|
||||||
|
@ -139,8 +139,8 @@ void WFMMod::pull(Sample& sample)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_modPhasor += (m_settings.m_fmDeviation / (float) m_outputSampleRate) * ri.real() * M_PI * 2.0f;
|
m_modPhasor += (m_settings.m_fmDeviation / (float) m_outputSampleRate) * ri.real() * M_PI * 2.0f;
|
||||||
ci.real(cos(m_modPhasor) * 0.891235351562f * SDR_SCALEF); // -1 dB
|
ci.real(cos(m_modPhasor) * 0.891235351562f * SDR_TX_SCALEF); // -1 dB
|
||||||
ci.imag(sin(m_modPhasor) * 0.891235351562f * SDR_SCALEF);
|
ci.imag(sin(m_modPhasor) * 0.891235351562f * SDR_TX_SCALEF);
|
||||||
|
|
||||||
// RF filtering
|
// RF filtering
|
||||||
rf_out = m_rfFilter->runFilt(ci, &rf);
|
rf_out = m_rfFilter->runFilt(ci, &rf);
|
||||||
@ -158,7 +158,7 @@ void WFMMod::pull(Sample& sample)
|
|||||||
m_settingsMutex.unlock();
|
m_settingsMutex.unlock();
|
||||||
|
|
||||||
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
||||||
magsq /= (SDR_SCALED*SDR_SCALED);
|
magsq /= (SDR_TX_SCALED*SDR_TX_SCALED);
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
m_magsq = m_movingAverage.average();
|
m_magsq = m_movingAverage.average();
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ void UDPSink::pull(Sample& sample)
|
|||||||
m_settingsMutex.unlock();
|
m_settingsMutex.unlock();
|
||||||
|
|
||||||
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
|
||||||
magsq /= (SDR_SCALED*SDR_SCALED);
|
magsq /= (SDR_TX_SCALED*SDR_TX_SCALED);
|
||||||
m_movingAverage.feed(magsq);
|
m_movingAverage.feed(magsq);
|
||||||
m_magsq = m_movingAverage.average();
|
m_magsq = m_movingAverage.average();
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ void UDPSink::modulateSample()
|
|||||||
m_udpHandler.readSample(s);
|
m_udpHandler.readSample(s);
|
||||||
|
|
||||||
uint64_t magsq = s.m_real * s.m_real + s.m_imag * s.m_imag;
|
uint64_t magsq = s.m_real * s.m_real + s.m_imag * s.m_imag;
|
||||||
m_inMovingAverage.feed(magsq/1073741824.0);
|
m_inMovingAverage.feed(magsq/(SDR_TX_SCALED*SDR_TX_SCALED));
|
||||||
m_inMagsq = m_inMovingAverage.average();
|
m_inMagsq = m_inMovingAverage.average();
|
||||||
|
|
||||||
calculateSquelch(m_inMagsq);
|
calculateSquelch(m_inMagsq);
|
||||||
@ -180,9 +180,9 @@ void UDPSink::modulateSample()
|
|||||||
|
|
||||||
if (m_squelchOpen)
|
if (m_squelchOpen)
|
||||||
{
|
{
|
||||||
m_modPhasor += (m_settings.m_fmDeviation / m_settings.m_inputSampleRate) * (t / SDR_SCALEF) * M_PI * 2.0f;
|
m_modPhasor += (m_settings.m_fmDeviation / m_settings.m_inputSampleRate) * (t / SDR_TX_SCALEF) * M_PI * 2.0f;
|
||||||
m_modSample.real(cos(m_modPhasor) * 0.3162292f * SDR_SCALEF * m_settings.m_gainOut);
|
m_modSample.real(cos(m_modPhasor) * 0.3162292f * SDR_TX_SCALEF * m_settings.m_gainOut);
|
||||||
m_modSample.imag(sin(m_modPhasor) * 0.3162292f * SDR_SCALEF * m_settings.m_gainOut);
|
m_modSample.imag(sin(m_modPhasor) * 0.3162292f * SDR_TX_SCALEF * m_settings.m_gainOut);
|
||||||
calculateLevel(m_modSample);
|
calculateLevel(m_modSample);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -195,14 +195,14 @@ void UDPSink::modulateSample()
|
|||||||
{
|
{
|
||||||
FixReal t;
|
FixReal t;
|
||||||
readMonoSample(t);
|
readMonoSample(t);
|
||||||
m_inMovingAverage.feed((t*t)/(SDR_SCALED*SDR_SCALED));
|
m_inMovingAverage.feed((t*t)/(SDR_TX_SCALED*SDR_TX_SCALED));
|
||||||
m_inMagsq = m_inMovingAverage.average();
|
m_inMagsq = m_inMovingAverage.average();
|
||||||
|
|
||||||
calculateSquelch(m_inMagsq);
|
calculateSquelch(m_inMagsq);
|
||||||
|
|
||||||
if (m_squelchOpen)
|
if (m_squelchOpen)
|
||||||
{
|
{
|
||||||
m_modSample.real(((t / SDR_SCALEF)*m_settings.m_amModFactor*m_settings.m_gainOut + 1.0f) * (SDR_SCALEF/2)); // modulate and scale zero frequency carrier
|
m_modSample.real(((t / SDR_TX_SCALEF)*m_settings.m_amModFactor*m_settings.m_gainOut + 1.0f) * (SDR_TX_SCALEF/2)); // modulate and scale zero frequency carrier
|
||||||
m_modSample.imag(0.0f);
|
m_modSample.imag(0.0f);
|
||||||
calculateLevel(m_modSample);
|
calculateLevel(m_modSample);
|
||||||
}
|
}
|
||||||
@ -220,14 +220,14 @@ void UDPSink::modulateSample()
|
|||||||
int n_out = 0;
|
int n_out = 0;
|
||||||
|
|
||||||
readMonoSample(t);
|
readMonoSample(t);
|
||||||
m_inMovingAverage.feed((t*t)/1073741824.0);
|
m_inMovingAverage.feed((t*t)/(SDR_TX_SCALED*SDR_TX_SCALED));
|
||||||
m_inMagsq = m_inMovingAverage.average();
|
m_inMagsq = m_inMovingAverage.average();
|
||||||
|
|
||||||
calculateSquelch(m_inMagsq);
|
calculateSquelch(m_inMagsq);
|
||||||
|
|
||||||
if (m_squelchOpen)
|
if (m_squelchOpen)
|
||||||
{
|
{
|
||||||
ci.real((t / SDR_SCALEF) * m_settings.m_gainOut);
|
ci.real((t / SDR_TX_SCALEF) * m_settings.m_gainOut);
|
||||||
ci.imag(0.0f);
|
ci.imag(0.0f);
|
||||||
|
|
||||||
n_out = m_SSBFilter->runSSB(ci, &filtered, (m_settings.m_sampleFormat == UDPSinkSettings::FormatUSB));
|
n_out = m_SSBFilter->runSSB(ci, &filtered, (m_settings.m_sampleFormat == UDPSinkSettings::FormatUSB));
|
||||||
@ -239,8 +239,8 @@ void UDPSink::modulateSample()
|
|||||||
}
|
}
|
||||||
|
|
||||||
c = m_SSBFilterBuffer[m_SSBFilterBufferIndex];
|
c = m_SSBFilterBuffer[m_SSBFilterBufferIndex];
|
||||||
m_modSample.real(m_SSBFilterBuffer[m_SSBFilterBufferIndex].real() * SDR_SCALEF);
|
m_modSample.real(m_SSBFilterBuffer[m_SSBFilterBufferIndex].real() * SDR_TX_SCALEF);
|
||||||
m_modSample.imag(m_SSBFilterBuffer[m_SSBFilterBufferIndex].imag() * SDR_SCALEF);
|
m_modSample.imag(m_SSBFilterBuffer[m_SSBFilterBufferIndex].imag() * SDR_TX_SCALEF);
|
||||||
m_SSBFilterBufferIndex++;
|
m_SSBFilterBufferIndex++;
|
||||||
|
|
||||||
calculateLevel(m_modSample);
|
calculateLevel(m_modSample);
|
||||||
@ -305,8 +305,8 @@ void UDPSink::calculateLevel(Complex sample)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qreal rmsLevel = m_levelSum > 0.0 ? sqrt((m_levelSum/(SDR_SCALED*SDR_SCALED)) / m_levelNbSamples) : 0.0;
|
qreal rmsLevel = m_levelSum > 0.0 ? sqrt((m_levelSum/(SDR_TX_SCALED*SDR_TX_SCALED)) / m_levelNbSamples) : 0.0;
|
||||||
emit levelChanged(rmsLevel, m_peakLevel / SDR_SCALEF, m_levelNbSamples);
|
emit levelChanged(rmsLevel, m_peakLevel / SDR_TX_SCALEF, m_levelNbSamples);
|
||||||
m_peakLevel = 0.0f;
|
m_peakLevel = 0.0f;
|
||||||
m_levelSum = 0.0f;
|
m_levelSum = 0.0f;
|
||||||
m_levelCalcCount = 0;
|
m_levelCalcCount = 0;
|
||||||
|
@ -51,7 +51,7 @@ private:
|
|||||||
unsigned int m_log2Interp;
|
unsigned int m_log2Interp;
|
||||||
int m_fcPos;
|
int m_fcPos;
|
||||||
|
|
||||||
Interpolators<qint16, SDR_SAMP_SZ, 12> m_interpolators;
|
Interpolators<qint16, SDR_TX_SAMP_SZ, 12> m_interpolators;
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
void callback(qint16* buf, qint32 len);
|
void callback(qint16* buf, qint32 len);
|
||||||
|
@ -70,7 +70,7 @@ private:
|
|||||||
QElapsedTimer m_elapsedTimer;
|
QElapsedTimer m_elapsedTimer;
|
||||||
bool m_throttleToggle;
|
bool m_throttleToggle;
|
||||||
|
|
||||||
Interpolators<qint16, SDR_SAMP_SZ, 16> m_interpolators;
|
Interpolators<qint16, SDR_TX_SAMP_SZ, 16> m_interpolators;
|
||||||
int16_t *m_buf;
|
int16_t *m_buf;
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -49,7 +49,7 @@ private:
|
|||||||
|
|
||||||
unsigned int m_log2Interp;
|
unsigned int m_log2Interp;
|
||||||
|
|
||||||
Interpolators<qint8, SDR_SAMP_SZ, 8> m_interpolators;
|
Interpolators<qint8, SDR_TX_SAMP_SZ, 8> m_interpolators;
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
void callback(qint8* buf, qint32 len);
|
void callback(qint8* buf, qint32 len);
|
||||||
|
@ -56,7 +56,7 @@ private:
|
|||||||
unsigned int m_log2Interp; // soft decimation
|
unsigned int m_log2Interp; // soft decimation
|
||||||
int m_fcPos;
|
int m_fcPos;
|
||||||
|
|
||||||
Interpolators<qint16, SDR_SAMP_SZ, 12> m_interpolators;
|
Interpolators<qint16, SDR_TX_SAMP_SZ, 12> m_interpolators;
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
void callback(qint16* buf, qint32 len);
|
void callback(qint16* buf, qint32 len);
|
||||||
|
@ -54,7 +54,7 @@ private:
|
|||||||
|
|
||||||
unsigned int m_log2Interp; // soft interpolation
|
unsigned int m_log2Interp; // soft interpolation
|
||||||
|
|
||||||
Interpolators<qint16, SDR_SAMP_SZ, 12> m_interpolators;
|
Interpolators<qint16, SDR_TX_SAMP_SZ, 12> m_interpolators;
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
void convert(qint16* buf, qint32 len);
|
void convert(qint16* buf, qint32 len);
|
||||||
|
@ -55,10 +55,10 @@ private:
|
|||||||
int m_fcPos;
|
int m_fcPos;
|
||||||
static AirspyThread *m_this;
|
static AirspyThread *m_this;
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
Decimators<qint64, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#else
|
#else
|
||||||
Decimators<qint32, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -53,10 +53,10 @@ private:
|
|||||||
unsigned int m_log2Decim;
|
unsigned int m_log2Decim;
|
||||||
static AirspyHFThread *m_this;
|
static AirspyHFThread *m_this;
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
Decimators<qint64, qint16, SDR_SAMP_SZ, 16> m_decimators;
|
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 16> m_decimators;
|
||||||
#else
|
#else
|
||||||
Decimators<qint32, qint16, SDR_SAMP_SZ, 16> m_decimators;
|
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 16> m_decimators;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -51,10 +51,10 @@ private:
|
|||||||
unsigned int m_log2Decim;
|
unsigned int m_log2Decim;
|
||||||
int m_fcPos;
|
int m_fcPos;
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
Decimators<qint64, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#else
|
#else
|
||||||
Decimators<qint32, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -54,10 +54,10 @@ private:
|
|||||||
unsigned int m_log2Decim;
|
unsigned int m_log2Decim;
|
||||||
int m_fcPos;
|
int m_fcPos;
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
Decimators<qint64, qint8, SDR_SAMP_SZ, 8> m_decimators;
|
Decimators<qint64, qint8, SDR_RX_SAMP_SZ, 8> m_decimators;
|
||||||
#else
|
#else
|
||||||
Decimators<qint32, qint8, SDR_SAMP_SZ, 8> m_decimators;
|
Decimators<qint32, qint8, SDR_RX_SAMP_SZ, 8> m_decimators;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -55,10 +55,10 @@ private:
|
|||||||
|
|
||||||
unsigned int m_log2Decim; // soft decimation
|
unsigned int m_log2Decim; // soft decimation
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
Decimators<qint64, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#else
|
#else
|
||||||
Decimators<qint32, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -59,10 +59,10 @@ private:
|
|||||||
int m_fcPos;
|
int m_fcPos;
|
||||||
float m_phasor;
|
float m_phasor;
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
Decimators<qint64, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#else
|
#else
|
||||||
Decimators<qint32, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -52,10 +52,10 @@ private:
|
|||||||
unsigned int m_log2Decim;
|
unsigned int m_log2Decim;
|
||||||
int m_fcPos;
|
int m_fcPos;
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
DecimatorsU<qint64, quint8, SDR_SAMP_SZ, 8, 127> m_decimators;
|
DecimatorsU<qint64, quint8, SDR_RX_SAMP_SZ, 8, 127> m_decimators;
|
||||||
#else
|
#else
|
||||||
DecimatorsU<qint32, quint8, SDR_SAMP_SZ, 8, 127> m_decimators;
|
DecimatorsU<qint32, quint8, SDR_RX_SAMP_SZ, 8, 127> m_decimators;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -52,10 +52,10 @@ private:
|
|||||||
unsigned int m_log2Decim;
|
unsigned int m_log2Decim;
|
||||||
int m_fcPos;
|
int m_fcPos;
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
Decimators<qint64, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#else
|
#else
|
||||||
Decimators<qint32, qint16, SDR_SAMP_SZ, 12> m_decimators;
|
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -85,14 +85,14 @@ private:
|
|||||||
bool m_throttleToggle;
|
bool m_throttleToggle;
|
||||||
QMutex m_mutex;
|
QMutex m_mutex;
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
Decimators<qint64, qint16, SDR_SAMP_SZ, 8> m_decimators_8;
|
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 8> m_decimators_8;
|
||||||
Decimators<qint64, qint16, SDR_SAMP_SZ, 12> m_decimators_12;
|
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators_12;
|
||||||
Decimators<qint64, qint16, SDR_SAMP_SZ, 16> m_decimators_16;
|
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 16> m_decimators_16;
|
||||||
#else
|
#else
|
||||||
Decimators<qint32, qint16, SDR_SAMP_SZ, 8> m_decimators_8;
|
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 8> m_decimators_8;
|
||||||
Decimators<qint32, qint16, SDR_SAMP_SZ, 12> m_decimators_12;
|
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators_12;
|
||||||
Decimators<qint32, qint16, SDR_SAMP_SZ, 16> m_decimators_16;
|
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 16> m_decimators_16;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#define INCLUDE_GPL_DSP_DECIMATORS_H_
|
#define INCLUDE_GPL_DSP_DECIMATORS_H_
|
||||||
|
|
||||||
#include "dsp/dsptypes.h"
|
#include "dsp/dsptypes.h"
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
#include "dsp/inthalfbandfilterdb.h"
|
#include "dsp/inthalfbandfilterdb.h"
|
||||||
#else
|
#else
|
||||||
#ifdef USE_SSE4_1
|
#ifdef USE_SSE4_1
|
||||||
@ -240,7 +240,7 @@ public:
|
|||||||
void decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
|
void decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator2; // 1st stages
|
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator2; // 1st stages
|
||||||
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator4; // 2nd stages
|
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator4; // 2nd stages
|
||||||
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator8; // 3rd stages
|
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator8; // 3rd stages
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#define INCLUDE_GPL_DSP_DECIMATORSU_H_
|
#define INCLUDE_GPL_DSP_DECIMATORSU_H_
|
||||||
|
|
||||||
#include "dsp/dsptypes.h"
|
#include "dsp/dsptypes.h"
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
#include "dsp/inthalfbandfilterdb.h"
|
#include "dsp/inthalfbandfilterdb.h"
|
||||||
#else
|
#else
|
||||||
#ifdef USE_SSE4_1
|
#ifdef USE_SSE4_1
|
||||||
@ -206,7 +206,7 @@ public:
|
|||||||
void decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len);
|
void decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator2; // 1st stages
|
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator2; // 1st stages
|
||||||
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator4; // 2nd stages
|
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator4; // 2nd stages
|
||||||
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator8; // 3rd stages
|
IntHalfbandFilterDB<qint64, DECIMATORS_HB_FILTER_ORDER> m_decimator8; // 3rd stages
|
||||||
|
@ -192,7 +192,7 @@ void DownChannelizer::applyConfiguration()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
DownChannelizer::FilterStage::FilterStage(Mode mode) :
|
DownChannelizer::FilterStage::FilterStage(Mode mode) :
|
||||||
m_filter(new IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>),
|
m_filter(new IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>),
|
||||||
m_workFunction(0),
|
m_workFunction(0),
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include "util/export.h"
|
#include "util/export.h"
|
||||||
#include "util/message.h"
|
#include "util/message.h"
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
#include "dsp/inthalfbandfilterdb.h"
|
#include "dsp/inthalfbandfilterdb.h"
|
||||||
#else
|
#else
|
||||||
#ifdef USE_SSE4_1
|
#ifdef USE_SSE4_1
|
||||||
@ -82,7 +82,7 @@ protected:
|
|||||||
ModeUpperHalf
|
ModeUpperHalf
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
typedef bool (IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
|
typedef bool (IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
|
||||||
IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
|
IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
|
||||||
#else
|
#else
|
||||||
|
@ -22,18 +22,22 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
#ifdef SDR_SAMPLE_24BIT
|
#ifdef SDR_RX_SAMPLE_24BIT
|
||||||
#define SDR_SAMP_SZ 24 // internal fixed arithmetic sample size
|
#define SDR_RX_SAMP_SZ 24 // internal fixed arithmetic sample size
|
||||||
#define SDR_SCALEF 8388608.0f
|
#define SDR_RX_SCALEF 8388608.0f
|
||||||
#define SDR_SCALED 8388608.0
|
#define SDR_RX_SCALED 8388608.0
|
||||||
typedef qint32 FixReal;
|
typedef qint32 FixReal;
|
||||||
#else
|
#else
|
||||||
#define SDR_SAMP_SZ 16 // internal fixed arithmetic sample size
|
#define SDR_RX_SAMP_SZ 16 // internal fixed arithmetic sample size
|
||||||
#define SDR_SCALEF 32768.0f
|
#define SDR_RX_SCALEF 32768.0f
|
||||||
#define SDR_SCALED 32768.0
|
#define SDR_RX_SCALED 32768.0
|
||||||
typedef qint16 FixReal;
|
typedef qint16 FixReal;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define SDR_TX_SAMP_SZ 16
|
||||||
|
#define SDR_TX_SCALEF 32768.0f
|
||||||
|
#define SDR_TX_SCALED 32768.0
|
||||||
|
|
||||||
typedef float Real;
|
typedef float Real;
|
||||||
typedef std::complex<Real> Complex;
|
typedef std::complex<Real> Complex;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect
|
|||||||
|
|
||||||
for(int i = 0; i < count; ++i)
|
for(int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
*it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF);
|
*it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF);
|
||||||
++begin;
|
++begin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect
|
|||||||
|
|
||||||
for(int i = 0; i < count; ++i)
|
for(int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
*it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF);
|
*it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF);
|
||||||
++begin;
|
++begin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ void ScopeVis::setSampleRate(int sampleRate)
|
|||||||
|
|
||||||
bool ScopeVis::triggerCondition(SampleVector::const_iterator& it)
|
bool ScopeVis::triggerCondition(SampleVector::const_iterator& it)
|
||||||
{
|
{
|
||||||
Complex c(it->real()/SDR_SCALEF, it->imag()/SDR_SCALEF);
|
Complex c(it->real()/SDR_RX_SCALEF, it->imag()/SDR_RX_SCALEF);
|
||||||
m_traceback.push_back(c); // store into trace memory FIFO
|
m_traceback.push_back(c); // store into trace memory FIFO
|
||||||
|
|
||||||
if (m_tracebackCount < m_traceback.size())
|
if (m_tracebackCount < m_traceback.size())
|
||||||
|
@ -556,7 +556,7 @@ private:
|
|||||||
switch (m_projectionType)
|
switch (m_projectionType)
|
||||||
{
|
{
|
||||||
case ProjectionImag:
|
case ProjectionImag:
|
||||||
v = s.m_imag / SDR_SCALEF;
|
v = s.m_imag / SDR_RX_SCALEF;
|
||||||
break;
|
break;
|
||||||
case ProjectionMagLin:
|
case ProjectionMagLin:
|
||||||
{
|
{
|
||||||
@ -590,7 +590,7 @@ private:
|
|||||||
break;
|
break;
|
||||||
case ProjectionReal:
|
case ProjectionReal:
|
||||||
default:
|
default:
|
||||||
v = s.m_real / SDR_SCALEF;
|
v = s.m_real / SDR_RX_SCALEF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ private:
|
|||||||
switch (m_projectionType)
|
switch (m_projectionType)
|
||||||
{
|
{
|
||||||
case ProjectionImag:
|
case ProjectionImag:
|
||||||
v = s.m_imag / SDR_SCALEF;
|
v = s.m_imag / SDR_RX_SCALEF;
|
||||||
break;
|
break;
|
||||||
case ProjectionMagLin:
|
case ProjectionMagLin:
|
||||||
{
|
{
|
||||||
@ -579,7 +579,7 @@ private:
|
|||||||
break;
|
break;
|
||||||
case ProjectionReal:
|
case ProjectionReal:
|
||||||
default:
|
default:
|
||||||
v = s.m_real / SDR_SCALEF;
|
v = s.m_real / SDR_RX_SCALEF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV
|
|||||||
|
|
||||||
for (std::size_t i = 0; i < samplesNeeded; ++i, ++begin)
|
for (std::size_t i = 0; i < samplesNeeded; ++i, ++begin)
|
||||||
{
|
{
|
||||||
*it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF);
|
*it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF);
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply fft window (and copy from m_fftBuffer to m_fftIn)
|
// apply fft window (and copy from m_fftBuffer to m_fftIn)
|
||||||
@ -144,7 +144,7 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV
|
|||||||
// not enough samples for FFT - just fill in new data and return
|
// not enough samples for FFT - just fill in new data and return
|
||||||
for(std::vector<Complex>::iterator it = m_fftBuffer.begin() + m_fftBufferFill; begin < end; ++begin)
|
for(std::vector<Complex>::iterator it = m_fftBuffer.begin() + m_fftBufferFill; begin < end; ++begin)
|
||||||
{
|
{
|
||||||
*it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF);
|
*it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_fftBufferFill += todo;
|
m_fftBufferFill += todo;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user