1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-08-04 23:12:25 -04:00

PVS-Studio static analysis corrections (3) issue #137

This commit is contained in:
f4exb 2018-02-24 10:29:27 +01:00
parent 9c3986ecbb
commit 2e5cfcafee
52 changed files with 187 additions and 229 deletions

View File

@ -180,10 +180,10 @@ bool DeviceLimeSDR::SetRBBPGA_dB(lms_device_t *device, std::size_t chan, float v
int rcc_ctl_pga_rbb = (430.0*pow(0.65, (g_pga_rbb/10.0))-110.35)/20.4516 + 16; int rcc_ctl_pga_rbb = (430.0*pow(0.65, (g_pga_rbb/10.0))-110.35)/20.4516 + 16;
int c_ctl_pga_rbb = 0; int c_ctl_pga_rbb = 0;
if (0 <= g_pga_rbb && g_pga_rbb < 8) c_ctl_pga_rbb = 3; if (g_pga_rbb < 8) { c_ctl_pga_rbb = 3; }
if (8 <= g_pga_rbb && g_pga_rbb < 13) c_ctl_pga_rbb = 2; if (8 <= g_pga_rbb && g_pga_rbb < 13) { c_ctl_pga_rbb = 2; }
if (13 <= g_pga_rbb && g_pga_rbb < 21) c_ctl_pga_rbb = 1; if (13 <= g_pga_rbb && g_pga_rbb < 21) { c_ctl_pga_rbb = 1; }
if (21 <= g_pga_rbb) c_ctl_pga_rbb = 0; if (21 <= g_pga_rbb) { c_ctl_pga_rbb = 0; }
if (LMS_WriteParam(device, LMS7param(RCC_CTL_PGA_RBB), rcc_ctl_pga_rbb) < 0) if (LMS_WriteParam(device, LMS7param(RCC_CTL_PGA_RBB), rcc_ctl_pga_rbb) < 0)
{ {

View File

@ -53,6 +53,29 @@ struct DeviceLimeSDRParams
m_rxFrequency(1e6), m_rxFrequency(1e6),
m_txFrequency(1e6) m_txFrequency(1e6)
{ {
m_lpfRangeRx.max = 0.0f;
m_lpfRangeRx.min = 0.0f;
m_lpfRangeRx.step = 0.0f;
m_lpfRangeTx.max = 0.0f;
m_lpfRangeTx.min = 0.0f;
m_lpfRangeTx.step = 0.0f;
m_loRangeRx.max = 0.0f;
m_loRangeRx.min = 0.0f;
m_loRangeRx.step = 0.0f;
m_loRangeTx.max = 0.0f;
m_loRangeTx.min = 0.0f;
m_loRangeTx.step = 0.0f;
m_srRangeRx.max = 0.0f;
m_srRangeRx.min = 0.0f;
m_srRangeRx.step = 0.0f;
m_srRangeTx.max = 0.0f;
m_srRangeTx.min = 0.0f;
m_srRangeTx.step = 0.0f;
} }
/** /**

View File

@ -232,18 +232,12 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
Real deemph_l, deemph_r; // Pre-emphasis is applied on each channel before multiplexing Real deemph_l, deemph_r; // Pre-emphasis is applied on each channel before multiplexing
m_deemphasisFilterX.process(ci.real() + sampleStereo, deemph_l); m_deemphasisFilterX.process(ci.real() + sampleStereo, deemph_l);
m_deemphasisFilterY.process(ci.real() - sampleStereo, deemph_r); m_deemphasisFilterY.process(ci.real() - sampleStereo, deemph_r);
if (m_settings.m_lsbStereo) m_audioBuffer[m_audioBufferFill].l = (qint16)(deemph_l * (1<<12) * m_settings.m_volume);
{ m_audioBuffer[m_audioBufferFill].r = (qint16)(deemph_r * (1<<12) * m_settings.m_volume);
m_audioBuffer[m_audioBufferFill].l = (qint16)(deemph_l * (1<<12) * m_settings.m_volume);
m_audioBuffer[m_audioBufferFill].r = (qint16)(deemph_r * (1<<12) * m_settings.m_volume); if (m_settings.m_copyAudioToUDP) {
if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(m_audioBuffer[m_audioBufferFill]); m_udpBufferAudio->write(m_audioBuffer[m_audioBufferFill]);
} }
else
{
m_audioBuffer[m_audioBufferFill].l = (qint16)(deemph_l * (1<<12) * m_settings.m_volume);
m_audioBuffer[m_audioBufferFill].r = (qint16)(deemph_r * (1<<12) * m_settings.m_volume);
if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(m_audioBuffer[m_audioBufferFill]);
}
} }
else else
{ {
@ -252,7 +246,10 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
quint16 sample = (qint16)(deemph * (1<<12) * m_settings.m_volume); quint16 sample = (qint16)(deemph * (1<<12) * m_settings.m_volume);
m_audioBuffer[m_audioBufferFill].l = sample; m_audioBuffer[m_audioBufferFill].l = sample;
m_audioBuffer[m_audioBufferFill].r = sample; m_audioBuffer[m_audioBufferFill].r = sample;
if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(m_audioBuffer[m_audioBufferFill]);
if (m_settings.m_copyAudioToUDP) {
m_udpBufferAudio->write(m_audioBuffer[m_audioBufferFill]);
}
} }
++m_audioBufferFill; ++m_audioBufferFill;

View File

@ -448,7 +448,7 @@ void ATVMod::pullVideo(Real& sample)
resizeCamera(); resizeCamera();
} }
if (camera.m_videoFPSCount < camera.m_videoFPSManualEnable ? camera.m_videoFPSManual : camera.m_videoFPS) if (camera.m_videoFPSCount < (camera.m_videoFPSManualEnable ? camera.m_videoFPSManual : camera.m_videoFPS))
{ {
camera.m_videoPrevFPSCount = (int) camera.m_videoFPSCount; camera.m_videoPrevFPSCount = (int) camera.m_videoFPSCount;
camera.m_videoFPSCount += (camera.m_videoFPSManualEnable ? camera.m_videoFPSqManual : camera.m_videoFPSq); camera.m_videoFPSCount += (camera.m_videoFPSManualEnable ? camera.m_videoFPSqManual : camera.m_videoFPSq);
@ -456,7 +456,7 @@ void ATVMod::pullVideo(Real& sample)
else else
{ {
camera.m_videoPrevFPSCount = 0; camera.m_videoPrevFPSCount = 0;
camera.m_videoFPSCount = camera.m_videoFPSManualEnable ? camera.m_videoFPSqManual : camera.m_videoFPSq; camera.m_videoFPSCount = (camera.m_videoFPSManualEnable ? camera.m_videoFPSqManual : camera.m_videoFPSq);
} }
} }
} }

View File

@ -16,6 +16,7 @@
#include <QDebug> #include <QDebug>
#include <stdint.h> #include <stdint.h>
#include <algorithm>
#include "udpsinkmsg.h" #include "udpsinkmsg.h"
#include "udpsinkudphandler.h" #include "udpsinkudphandler.h"
@ -41,6 +42,7 @@ UDPSinkUDPHandler::UDPSinkUDPHandler() :
m_feedbackMessageQueue(0) m_feedbackMessageQueue(0)
{ {
m_udpBuf = new udpBlk_t[m_minNbUDPFrames]; m_udpBuf = new udpBlk_t[m_minNbUDPFrames];
std::fill(m_udpDump, m_udpDump + m_udpBlockSize + 8192, 0);
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages())); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages()));
} }
@ -180,7 +182,8 @@ void UDPSinkUDPHandler::advanceReadPointer(int nbBytes)
else else
{ {
m_rwDelta = m_writeIndex; // raw R/W delta estimate m_rwDelta = m_writeIndex; // raw R/W delta estimate
float d = (m_rwDelta - (m_nbUDPFrames/2))/(float) m_nbUDPFrames; int nbUDPFrames2 = m_nbUDPFrames/2;
float d = (m_rwDelta - nbUDPFrames2)/(float) m_nbUDPFrames;
//qDebug("UDPSinkUDPHandler::advanceReadPointer: w: %02d d: %f", m_writeIndex, d); //qDebug("UDPSinkUDPHandler::advanceReadPointer: w: %02d d: %f", m_writeIndex, d);
if ((d < -0.45) || (d > 0.45)) if ((d < -0.45) || (d > 0.45))

View File

@ -134,12 +134,7 @@ bool BladerfOutput::start()
if (m_running) stop(); if (m_running) stop();
if((m_bladerfThread = new BladerfOutputThread(m_dev, &m_sampleSourceFifo)) == 0) m_bladerfThread = new BladerfOutputThread(m_dev, &m_sampleSourceFifo);
{
qCritical("BladerfOutput::start: out of memory");
stop();
return false;
}
// mutexLocker.unlock(); // mutexLocker.unlock();
applySettings(m_settings, true); applySettings(m_settings, true);

View File

@ -58,23 +58,23 @@ PluginInterface::SamplingDevices BladerfOutputPlugin::enumSampleSinks()
int count = bladerf_get_device_list(&devinfo); int count = bladerf_get_device_list(&devinfo);
for(int i = 0; i < count; i++)
{
QString displayedName(QString("BladeRF[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));
result.append(SamplingDevice(displayedName,
m_hardwareID,
m_deviceTypeID,
QString(devinfo[i].serial),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
false,
1,
0));
}
if (devinfo) if (devinfo)
{ {
for(int i = 0; i < count; i++)
{
QString displayedName(QString("BladeRF[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));
result.append(SamplingDevice(displayedName,
m_hardwareID,
m_deviceTypeID,
QString(devinfo[i].serial),
i,
PluginInterface::SamplingDevice::PhysicalDevice,
false,
1,
0));
}
bladerf_free_device_list(devinfo); // Valgrind memcheck bladerf_free_device_list(devinfo); // Valgrind memcheck
} }

View File

@ -16,6 +16,7 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <algorithm>
#include "bladerfoutputthread.h" #include "bladerfoutputthread.h"
@ -28,6 +29,7 @@ BladerfOutputThread::BladerfOutputThread(struct bladerf* dev, SampleSourceFifo*
m_log2Interp(0), m_log2Interp(0),
m_fcPos(0) m_fcPos(0)
{ {
std::fill(m_buf, m_buf + 2*BLADERFOUTPUT_BLOCKSIZE, 0);
} }
BladerfOutputThread::~BladerfOutputThread() BladerfOutputThread::~BladerfOutputThread()

View File

@ -90,13 +90,7 @@ bool FileSinkOutput::start()
openFileStream(); openFileStream();
if((m_fileSinkThread = new FileSinkThread(&m_ofstream, &m_sampleSourceFifo)) == 0) m_fileSinkThread = new FileSinkThread(&m_ofstream, &m_sampleSourceFifo);
{
qCritical("out of memory");
stop();
return false;
}
m_fileSinkThread->setSamplerate(m_settings.m_sampleRate); m_fileSinkThread->setSamplerate(m_settings.m_sampleRate);
m_fileSinkThread->setLog2Interpolation(m_settings.m_log2Interp); m_fileSinkThread->setLog2Interpolation(m_settings.m_log2Interp);
m_fileSinkThread->connectTimer(m_masterTimer); m_fileSinkThread->connectTimer(m_masterTimer);

View File

@ -116,12 +116,7 @@ bool HackRFOutput::start()
if (m_running) stop(); if (m_running) stop();
if((m_hackRFThread = new HackRFOutputThread(m_dev, &m_sampleSourceFifo)) == 0) m_hackRFThread = new HackRFOutputThread(m_dev, &m_sampleSourceFifo);
{
qCritical("HackRFOutput::start: out of memory");
stop();
return false;
}
// mutexLocker.unlock(); // mutexLocker.unlock();

View File

@ -29,6 +29,7 @@ HackRFOutputThread::HackRFOutputThread(hackrf_device* dev, SampleSourceFifo* sam
m_sampleFifo(sampleFifo), m_sampleFifo(sampleFifo),
m_log2Interp(0) m_log2Interp(0)
{ {
std::fill(m_buf, m_buf + 2*HACKRF_BLOCKSIZE, 0);
} }
HackRFOutputThread::~HackRFOutputThread() HackRFOutputThread::~HackRFOutputThread()

View File

@ -111,9 +111,6 @@ bool LimeSDROutput::openDevice()
// check if the requested channel is busy and abort if so (should not happen if device management is working correctly) // check if the requested channel is busy and abort if so (should not happen if device management is working correctly)
char *busyChannels = new char[deviceParams->m_nbTxChannels];
memset(busyChannels, 0, deviceParams->m_nbTxChannels);
for (unsigned int i = 0; i < m_deviceAPI->getSinkBuddies().size(); i++) for (unsigned int i = 0; i < m_deviceAPI->getSinkBuddies().size(); i++)
{ {
DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[i]; DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[i];
@ -122,13 +119,11 @@ bool LimeSDROutput::openDevice()
if (buddyShared->m_channel == requestedChannel) if (buddyShared->m_channel == requestedChannel)
{ {
qCritical("LimeSDROutput::openDevice: cannot open busy channel %u", requestedChannel); qCritical("LimeSDROutput::openDevice: cannot open busy channel %u", requestedChannel);
delete[] busyChannels;
return false; return false;
} }
} }
m_deviceShared.m_channel = requestedChannel; // acknowledge the requested channel m_deviceShared.m_channel = requestedChannel; // acknowledge the requested channel
delete[] busyChannels;
} }
// look for Rx buddies and get reference to common parameters // look for Rx buddies and get reference to common parameters
// take the first Rx channel // take the first Rx channel
@ -370,20 +365,12 @@ bool LimeSDROutput::start()
return false; return false;
} }
applySettings(m_settings, true);
// start / stop streaming is done in the thread. // start / stop streaming is done in the thread.
if ((m_limeSDROutputThread = new LimeSDROutputThread(&m_streamId, &m_sampleSourceFifo)) == 0) m_limeSDROutputThread = new LimeSDROutputThread(&m_streamId, &m_sampleSourceFifo);
{ qDebug("LimeSDROutput::start: thread created");
qCritical("LimeSDROutput::start: cannot create thread");
stop(); applySettings(m_settings, true);
return false;
}
else
{
qDebug("LimeSDROutput::start: thread created");
}
m_limeSDROutputThread->setLog2Interpolation(m_settings.m_log2SoftInterp); m_limeSDROutputThread->setLog2Interpolation(m_settings.m_log2SoftInterp);

View File

@ -15,6 +15,7 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include <errno.h> #include <errno.h>
#include <algorithm>
#include "limesdroutputthread.h" #include "limesdroutputthread.h"
#include "limesdroutputsettings.h" #include "limesdroutputsettings.h"
@ -27,6 +28,7 @@ LimeSDROutputThread::LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifo*
m_log2Interp(0), m_log2Interp(0),
m_fcPos(LimeSDROutputSettings::FC_POS_CENTER) m_fcPos(LimeSDROutputSettings::FC_POS_CENTER)
{ {
std::fill(m_buf, m_buf + 2*LIMESDROUTPUT_BLOCKSIZE, 0);
} }
LimeSDROutputThread::~LimeSDROutputThread() LimeSDROutputThread::~LimeSDROutputThread()

View File

@ -42,6 +42,13 @@ PlutoSDROutput::PlutoSDROutput(DeviceSinkAPI *deviceAPI) :
m_plutoTxBuffer(0), m_plutoTxBuffer(0),
m_plutoSDROutputThread(0) m_plutoSDROutputThread(0)
{ {
m_deviceSampleRates.m_addaConnvRate = 0;
m_deviceSampleRates.m_bbRateHz = 0;
m_deviceSampleRates.m_firRate = 0;
m_deviceSampleRates.m_hb1Rate = 0;
m_deviceSampleRates.m_hb2Rate = 0;
m_deviceSampleRates.m_hb3Rate = 0;
suspendBuddies(); suspendBuddies();
openDevice(); openDevice();
resumeBuddies(); resumeBuddies();
@ -72,20 +79,12 @@ bool PlutoSDROutput::start()
if (m_running) stop(); if (m_running) stop();
applySettings(m_settings, true);
// start / stop streaming is done in the thread. // start / stop streaming is done in the thread.
if ((m_plutoSDROutputThread = new PlutoSDROutputThread(PLUTOSDR_BLOCKSIZE_SAMPLES, m_deviceShared.m_deviceParams->getBox(), &m_sampleSourceFifo)) == 0) m_plutoSDROutputThread = new PlutoSDROutputThread(PLUTOSDR_BLOCKSIZE_SAMPLES, m_deviceShared.m_deviceParams->getBox(), &m_sampleSourceFifo);
{ qDebug("PlutoSDROutput::start: thread created");
qCritical("PlutoSDROutput::start: cannot create thread");
stop(); applySettings(m_settings, true);
return false;
}
else
{
qDebug("PlutoSDROutput::start: thread created");
}
m_plutoSDROutputThread->setLog2Interpolation(m_settings.m_log2Interp); m_plutoSDROutputThread->setLog2Interpolation(m_settings.m_log2Interp);
m_plutoSDROutputThread->startWork(); m_plutoSDROutputThread->startWork();
@ -257,11 +256,9 @@ bool PlutoSDROutput::openDevice()
m_deviceAPI->setBuddySharedPtr(&m_deviceShared); // propagate common parameters to API m_deviceAPI->setBuddySharedPtr(&m_deviceShared); // propagate common parameters to API
// acquire the channel // acquire the channel
suspendBuddies();
DevicePlutoSDRBox *plutoBox = m_deviceShared.m_deviceParams->getBox(); DevicePlutoSDRBox *plutoBox = m_deviceShared.m_deviceParams->getBox();
plutoBox->openTx(); plutoBox->openTx();
m_plutoTxBuffer = plutoBox->createTxBuffer(PLUTOSDR_BLOCKSIZE_SAMPLES, false); // PlutoSDR buffer size is counted in number of (I,Q) samples m_plutoTxBuffer = plutoBox->createTxBuffer(PLUTOSDR_BLOCKSIZE_SAMPLES, false); // PlutoSDR buffer size is counted in number of (I,Q) samples
resumeBuddies();
return true; return true;
} }

View File

@ -601,15 +601,11 @@ void SDRdaemonSinkGui::tick()
samplesCorr = 127*8; samplesCorr = 127*8;
quickStart = true; quickStart = true;
} }
else if (queueLength < 8) else if (queueLength < 16)
{ {
samplesCorr = ((8 - queueLength)*16)/m_nbSinceLastFlowCheck; samplesCorr = ((8 - queueLength)*16)/m_nbSinceLastFlowCheck;
} }
else if (queueLength > 8) else
{
samplesCorr = ((8 - queueLength)*16)/m_nbSinceLastFlowCheck;
}
else if (queueLength > 16)
{ {
samplesCorr = -127*16; samplesCorr = -127*16;
quickStart = true; quickStart = true;

View File

@ -64,12 +64,7 @@ bool SDRdaemonSinkOutput::start()
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
qDebug() << "SDRdaemonSinkOutput::start"; qDebug() << "SDRdaemonSinkOutput::start";
if((m_sdrDaemonSinkThread = new SDRdaemonSinkThread(&m_sampleSourceFifo)) == 0) m_sdrDaemonSinkThread = new SDRdaemonSinkThread(&m_sampleSourceFifo);
{
qCritical("out of memory");
stop();
return false;
}
m_sdrDaemonSinkThread->setRemoteAddress(m_settings.m_address, m_settings.m_dataPort); m_sdrDaemonSinkThread->setRemoteAddress(m_settings.m_address, m_settings.m_dataPort);
m_sdrDaemonSinkThread->setCenterFrequency(m_settings.m_centerFrequency); m_sdrDaemonSinkThread->setCenterFrequency(m_settings.m_centerFrequency);
m_sdrDaemonSinkThread->setSamplerate(m_settings.m_sampleRate); m_sdrDaemonSinkThread->setSamplerate(m_settings.m_sampleRate);

View File

@ -63,7 +63,7 @@ public:
private: private:
QMutex m_startWaitMutex; QMutex m_startWaitMutex;
QWaitCondition m_startWaiter; QWaitCondition m_startWaiter;
bool m_running; volatile bool m_running;
int m_samplesChunkSize; int m_samplesChunkSize;
SampleSourceFifo* m_sampleFifo; SampleSourceFifo* m_sampleFifo;

View File

@ -115,7 +115,7 @@ void UDPSinkFEC::write(const SampleVector::iterator& begin, uint32_t sampleChunk
metaData.m_crc32 = crc32.checksum(); metaData.m_crc32 = crc32.checksum();
memset((void *) &m_superBlock, 0, m_udpSize); memset((void *) &m_superBlock, 0, sizeof(m_superBlock));
m_superBlock.header.frameIndex = m_frameCount; m_superBlock.header.frameIndex = m_frameCount;
m_superBlock.header.blockIndex = m_txBlockIndex; m_superBlock.header.blockIndex = m_txBlockIndex;

View File

@ -244,7 +244,7 @@ private slots:
private: private:
void encodeAndTransmit(UDPSinkFEC::SuperBlock *txBlockx, uint16_t frameIndex, uint32_t nbBlocksFEC, uint32_t txDelay); void encodeAndTransmit(UDPSinkFEC::SuperBlock *txBlockx, uint16_t frameIndex, uint32_t nbBlocksFEC, uint32_t txDelay);
bool m_running; volatile bool m_running;
CM256 m_cm256; //!< CM256 library object CM256 m_cm256; //!< CM256 library object
bool m_cm256Valid; //!< true if CM256 library is initialized correctly bool m_cm256Valid; //!< true if CM256 library is initialized correctly
UDPSocket m_socket; UDPSocket m_socket;

View File

@ -161,15 +161,9 @@ bool AirspyInput::start()
return false; return false;
} }
if (m_running) stop(); if (m_running) { stop(); }
if((m_airspyThread = new AirspyThread(m_dev, &m_sampleFifo)) == 0)
{
qCritical("AirspyInput::start: out of memory");
stop();
return false;
}
m_airspyThread = new AirspyThread(m_dev, &m_sampleFifo);
m_airspyThread->setSamplerate(m_sampleRates[m_settings.m_devSampleRateIndex]); m_airspyThread->setSamplerate(m_sampleRates[m_settings.m_devSampleRateIndex]);
m_airspyThread->setLog2Decimation(m_settings.m_log2Decim); m_airspyThread->setLog2Decimation(m_settings.m_log2Decim);
m_airspyThread->setFcPos((int) m_settings.m_fcPos); m_airspyThread->setFcPos((int) m_settings.m_fcPos);

View File

@ -16,6 +16,7 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <algorithm>
#include "airspythread.h" #include "airspythread.h"
@ -34,6 +35,7 @@ AirspyThread::AirspyThread(struct airspy_device* dev, SampleSinkFifo* sampleFifo
m_fcPos(0) m_fcPos(0)
{ {
m_this = this; m_this = this;
std::fill(m_buf, m_buf + 2*AIRSPY_BLOCKSIZE, 0);
} }
AirspyThread::~AirspyThread() AirspyThread::~AirspyThread()

View File

@ -146,12 +146,7 @@ bool BladerfInput::start()
if (m_running) stop(); if (m_running) stop();
if((m_bladerfThread = new BladerfInputThread(m_dev, &m_sampleFifo)) == 0) { m_bladerfThread = new BladerfInputThread(m_dev, &m_sampleFifo);
qCritical("BladerfInput::start: out of memory");
stop();
return false;
}
m_bladerfThread->setLog2Decimation(m_settings.m_log2Decim); m_bladerfThread->setLog2Decimation(m_settings.m_log2Decim);
m_bladerfThread->setFcPos((int) m_settings.m_fcPos); m_bladerfThread->setFcPos((int) m_settings.m_fcPos);

View File

@ -59,23 +59,23 @@ PluginInterface::SamplingDevices BlderfInputPlugin::enumSampleSources()
int count = bladerf_get_device_list(&devinfo); int count = bladerf_get_device_list(&devinfo);
for(int i = 0; i < count; i++) if (devinfo)
{ {
QString displayedName(QString("BladeRF[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial)); for(int i = 0; i < count; i++)
{
QString displayedName(QString("BladeRF[%1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));
result.append(SamplingDevice(displayedName, result.append(SamplingDevice(displayedName,
m_hardwareID, m_hardwareID,
m_deviceTypeID, m_deviceTypeID,
QString(devinfo[i].serial), QString(devinfo[i].serial),
i, i,
PluginInterface::SamplingDevice::PhysicalDevice, PluginInterface::SamplingDevice::PhysicalDevice,
true, true,
1, 1,
0)); 0));
} }
if (devinfo)
{
bladerf_free_device_list(devinfo); // Valgrind memcheck bladerf_free_device_list(devinfo); // Valgrind memcheck
} }

View File

@ -18,6 +18,7 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <algorithm>
#include "dsp/samplesinkfifo.h" #include "dsp/samplesinkfifo.h"
@ -31,6 +32,7 @@ BladerfInputThread::BladerfInputThread(struct bladerf* dev, SampleSinkFifo* samp
m_log2Decim(0), m_log2Decim(0),
m_fcPos(0) m_fcPos(0)
{ {
std::fill(m_buf, m_buf + 2*BLADERF_BLOCKSIZE, 0);
} }
BladerfInputThread::~BladerfInputThread() BladerfInputThread::~BladerfInputThread()

View File

@ -121,12 +121,7 @@ bool FCDProInput::start()
return false; return false;
} }
if ((m_FCDThread = new FCDProThread(&m_sampleFifo)) == NULL) m_FCDThread = new FCDProThread(&m_sampleFifo);
{
qCritical("out of memory");
return false;
}
m_FCDThread->startWork(); m_FCDThread->startWork();
// mutexLocker.unlock(); // mutexLocker.unlock();

View File

@ -115,12 +115,7 @@ bool FCDProPlusInput::start()
return false; return false;
} }
if ((m_FCDThread = new FCDProPlusThread(&m_sampleFifo)) == NULL) m_FCDThread = new FCDProPlusThread(&m_sampleFifo);
{
qCritical("out of memory");
return false;
}
m_FCDThread->startWork(); m_FCDThread->startWork();
// mutexLocker.unlock(); // mutexLocker.unlock();

View File

@ -145,12 +145,7 @@ bool FileSourceInput::start()
//openFileStream(); //openFileStream();
if((m_fileSourceThread = new FileSourceThread(&m_ifstream, &m_sampleFifo)) == NULL) { m_fileSourceThread = new FileSourceThread(&m_ifstream, &m_sampleFifo);
qCritical("out of memory");
stop();
return false;
}
m_fileSourceThread->setSampleRateAndSize(m_sampleRate, m_sampleSize); m_fileSourceThread->setSampleRateAndSize(m_sampleRate, m_sampleSize);
m_fileSourceThread->connectTimer(m_masterTimer); m_fileSourceThread->connectTimer(m_masterTimer);
m_fileSourceThread->startWork(); m_fileSourceThread->startWork();

View File

@ -132,12 +132,7 @@ bool HackRFInput::start()
if (m_running) stop(); if (m_running) stop();
if ((m_hackRFThread = new HackRFInputThread(m_dev, &m_sampleFifo)) == 0) m_hackRFThread = new HackRFInputThread(m_dev, &m_sampleFifo);
{
qCritical("HackRFInput::start: out of memory");
stop();
return false;
}
// mutexLocker.unlock(); // mutexLocker.unlock();

View File

@ -19,6 +19,7 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <algorithm>
#include "dsp/samplesinkfifo.h" #include "dsp/samplesinkfifo.h"
@ -32,6 +33,7 @@ HackRFInputThread::HackRFInputThread(hackrf_device* dev, SampleSinkFifo* sampleF
m_log2Decim(0), m_log2Decim(0),
m_fcPos(0) m_fcPos(0)
{ {
std::fill(m_buf, m_buf + 2*HACKRF_BLOCKSIZE, 0);
} }
HackRFInputThread::~HackRFInputThread() HackRFInputThread::~HackRFInputThread()

View File

@ -129,9 +129,6 @@ bool LimeSDRInput::openDevice()
// check if the requested channel is busy and abort if so (should not happen if device management is working correctly) // check if the requested channel is busy and abort if so (should not happen if device management is working correctly)
char *busyChannels = new char[deviceParams->m_nbRxChannels];
memset(busyChannels, 0, deviceParams->m_nbRxChannels);
for (unsigned int i = 0; i < m_deviceAPI->getSourceBuddies().size(); i++) for (unsigned int i = 0; i < m_deviceAPI->getSourceBuddies().size(); i++)
{ {
DeviceSourceAPI *buddy = m_deviceAPI->getSourceBuddies()[i]; DeviceSourceAPI *buddy = m_deviceAPI->getSourceBuddies()[i];
@ -140,13 +137,11 @@ bool LimeSDRInput::openDevice()
if (buddyShared->m_channel == requestedChannel) if (buddyShared->m_channel == requestedChannel)
{ {
qCritical("LimeSDRInput::openDevice: cannot open busy channel %u", requestedChannel); qCritical("LimeSDRInput::openDevice: cannot open busy channel %u", requestedChannel);
delete[] busyChannels;
return false; return false;
} }
} }
m_deviceShared.m_channel = requestedChannel; // acknowledge the requested channel m_deviceShared.m_channel = requestedChannel; // acknowledge the requested channel
delete[] busyChannels;
} }
// look for Tx buddies and get reference to common parameters // look for Tx buddies and get reference to common parameters
// take the first Rx channel // take the first Rx channel
@ -389,20 +384,12 @@ bool LimeSDRInput::start()
return false; return false;
} }
applySettings(m_settings, true);
// start / stop streaming is done in the thread. // start / stop streaming is done in the thread.
if ((m_limeSDRInputThread = new LimeSDRInputThread(&m_streamId, &m_sampleFifo)) == 0) m_limeSDRInputThread = new LimeSDRInputThread(&m_streamId, &m_sampleFifo);
{ qDebug("LimeSDRInput::start: thread created");
qCritical("LimeSDRInput::start: cannot create thread");
stop(); applySettings(m_settings, true);
return false;
}
else
{
qDebug("LimeSDRInput::start: thread created");
}
m_limeSDRInputThread->setLog2Decimation(m_settings.m_log2SoftDecim); m_limeSDRInputThread->setLog2Decimation(m_settings.m_log2SoftDecim);

View File

@ -15,6 +15,7 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include <errno.h> #include <errno.h>
#include <algorithm>
#include "limesdrinputsettings.h" #include "limesdrinputsettings.h"
#include "limesdrinputthread.h" #include "limesdrinputthread.h"
@ -27,6 +28,7 @@ LimeSDRInputThread::LimeSDRInputThread(lms_stream_t* stream, SampleSinkFifo* sam
m_sampleFifo(sampleFifo), m_sampleFifo(sampleFifo),
m_log2Decim(0) m_log2Decim(0)
{ {
std::fill(m_buf, m_buf + 2*LIMESDR_BLOCKSIZE, 0);
} }
LimeSDRInputThread::~LimeSDRInputThread() LimeSDRInputThread::~LimeSDRInputThread()

View File

@ -68,20 +68,12 @@ bool PerseusInput::start()
{ {
if (m_running) stop(); if (m_running) stop();
applySettings(m_settings, true);
// start / stop streaming is done in the thread. // start / stop streaming is done in the thread.
if ((m_perseusThread = new PerseusThread(m_perseusDescriptor, &m_sampleFifo)) == 0) m_perseusThread = new PerseusThread(m_perseusDescriptor, &m_sampleFifo);
{ qDebug("PerseusInput::start: thread created");
qCritical("PerseusInput::start: cannot create thread");
stop(); applySettings(m_settings, true);
return false;
}
else
{
qDebug("PerseusInput::start: thread created");
}
m_perseusThread->setLog2Decimation(m_settings.m_log2Decim); m_perseusThread->setLog2Decimation(m_settings.m_log2Decim);
m_perseusThread->startWork(); m_perseusThread->startWork();

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB // // Copyright (C) 2018 Edouard Griffiths, F4EXB //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -15,6 +15,7 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include <QtGlobal> #include <QtGlobal>
#include <algorithm>
#include "perseusthread.h" #include "perseusthread.h"
PerseusThread *PerseusThread::m_this = 0; PerseusThread *PerseusThread::m_this = 0;
@ -28,6 +29,7 @@ PerseusThread::PerseusThread(perseus_descr* dev, SampleSinkFifo* sampleFifo, QOb
m_log2Decim(0) m_log2Decim(0)
{ {
m_this = this; m_this = this;
std::fill(m_buf, m_buf + 2*PERSEUS_NBSAMPLES, 0);
} }
PerseusThread::~PerseusThread() PerseusThread::~PerseusThread()

View File

@ -42,7 +42,7 @@ public:
private: private:
QMutex m_startWaitMutex; QMutex m_startWaitMutex;
QWaitCondition m_startWaiter; QWaitCondition m_startWaiter;
bool m_running; volatile bool m_running;
perseus_descr* m_dev; perseus_descr* m_dev;
qint32 m_buf[2*PERSEUS_NBSAMPLES]; qint32 m_buf[2*PERSEUS_NBSAMPLES];

View File

@ -44,6 +44,13 @@ PlutoSDRInput::PlutoSDRInput(DeviceSourceAPI *deviceAPI) :
m_plutoRxBuffer(0), m_plutoRxBuffer(0),
m_plutoSDRInputThread(0) m_plutoSDRInputThread(0)
{ {
m_deviceSampleRates.m_addaConnvRate = 0;
m_deviceSampleRates.m_bbRateHz = 0;
m_deviceSampleRates.m_firRate = 0;
m_deviceSampleRates.m_hb1Rate = 0;
m_deviceSampleRates.m_hb2Rate = 0;
m_deviceSampleRates.m_hb3Rate = 0;
suspendBuddies(); suspendBuddies();
openDevice(); openDevice();
resumeBuddies(); resumeBuddies();
@ -81,20 +88,12 @@ bool PlutoSDRInput::start()
if (m_running) stop(); if (m_running) stop();
applySettings(m_settings, true);
// start / stop streaming is done in the thread. // start / stop streaming is done in the thread.
if ((m_plutoSDRInputThread = new PlutoSDRInputThread(PLUTOSDR_BLOCKSIZE_SAMPLES, m_deviceShared.m_deviceParams->getBox(), &m_sampleFifo)) == 0) m_plutoSDRInputThread = new PlutoSDRInputThread(PLUTOSDR_BLOCKSIZE_SAMPLES, m_deviceShared.m_deviceParams->getBox(), &m_sampleFifo);
{ qDebug("PlutoSDRInput::start: thread created");
qCritical("PlutoSDRInput::start: cannot create thread");
stop(); applySettings(m_settings, true);
return false;
}
else
{
qDebug("PlutoSDRInput::start: thread created");
}
m_plutoSDRInputThread->setLog2Decimation(m_settings.m_log2Decim); m_plutoSDRInputThread->setLog2Decimation(m_settings.m_log2Decim);
m_plutoSDRInputThread->startWork(); m_plutoSDRInputThread->startWork();
@ -287,11 +286,9 @@ bool PlutoSDRInput::openDevice()
m_deviceAPI->setBuddySharedPtr(&m_deviceShared); // propagate common parameters to API m_deviceAPI->setBuddySharedPtr(&m_deviceShared); // propagate common parameters to API
// acquire the channel // acquire the channel
suspendBuddies();
DevicePlutoSDRBox *plutoBox = m_deviceShared.m_deviceParams->getBox(); DevicePlutoSDRBox *plutoBox = m_deviceShared.m_deviceParams->getBox();
plutoBox->openRx(); plutoBox->openRx();
m_plutoRxBuffer = plutoBox->createRxBuffer(PLUTOSDR_BLOCKSIZE_SAMPLES, false); m_plutoRxBuffer = plutoBox->createRxBuffer(PLUTOSDR_BLOCKSIZE_SAMPLES, false);
resumeBuddies();
return true; return true;
} }

View File

@ -187,13 +187,7 @@ bool RTLSDRInput::start()
if (m_running) stop(); if (m_running) stop();
if ((m_rtlSDRThread = new RTLSDRThread(m_dev, &m_sampleFifo)) == NULL) m_rtlSDRThread = new RTLSDRThread(m_dev, &m_sampleFifo);
{
qCritical("RTLSDRInput::start: out of memory");
stop();
return false;
}
m_rtlSDRThread->setSamplerate(m_settings.m_devSampleRate); m_rtlSDRThread->setSamplerate(m_settings.m_devSampleRate);
m_rtlSDRThread->setLog2Decimation(m_settings.m_log2Decim); m_rtlSDRThread->setLog2Decimation(m_settings.m_log2Decim);
m_rtlSDRThread->setFcPos((int) m_settings.m_fcPos); m_rtlSDRThread->setFcPos((int) m_settings.m_fcPos);

View File

@ -18,6 +18,7 @@
#include <cassert> #include <cassert>
#include <cstring> #include <cstring>
#include <cmath> #include <cmath>
#include <algorithm>
#include <boost/crc.hpp> #include <boost/crc.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include "sdrdaemonsourcebuffer.h" #include "sdrdaemonsourcebuffer.h"
@ -62,6 +63,9 @@ SDRdaemonSourceBuffer::SDRdaemonSourceBuffer(uint32_t throttlems) :
} else { } else {
m_cm256_OK = true; m_cm256_OK = true;
} }
std::fill(m_decoderSlots, m_decoderSlots + nbDecoderSlots, DecoderSlot());
std::fill(m_frames, m_frames + nbDecoderSlots, BufferFrame());
} }
SDRdaemonSourceBuffer::~SDRdaemonSourceBuffer() SDRdaemonSourceBuffer::~SDRdaemonSourceBuffer()

View File

@ -31,6 +31,7 @@ SDRdaemonSourceUDPHandler::SDRdaemonSourceUDPHandler(SampleSinkFifo *sampleFifo,
m_masterTimer(deviceAPI->getMasterTimer()), m_masterTimer(deviceAPI->getMasterTimer()),
m_masterTimerConnected(false), m_masterTimerConnected(false),
m_running(false), m_running(false),
m_rateDivider(1000/SDRDAEMONSOURCE_THROTTLE_MS),
m_sdrDaemonBuffer(m_rateDivider), m_sdrDaemonBuffer(m_rateDivider),
m_dataSocket(0), m_dataSocket(0),
m_dataAddress(QHostAddress::LocalHost), m_dataAddress(QHostAddress::LocalHost),
@ -54,7 +55,6 @@ SDRdaemonSourceUDPHandler::SDRdaemonSourceUDPHandler(SampleSinkFifo *sampleFifo,
m_converterBuffer(0), m_converterBuffer(0),
m_converterBufferNbSamples(0), m_converterBufferNbSamples(0),
m_throttleToggle(false), m_throttleToggle(false),
m_rateDivider(1000/SDRDAEMONSOURCE_THROTTLE_MS),
m_autoCorrBuffer(true) m_autoCorrBuffer(true)
{ {
m_udpBuf = new char[SDRdaemonSourceBuffer::m_udpPayloadSize]; m_udpBuf = new char[SDRdaemonSourceBuffer::m_udpPayloadSize];

View File

@ -55,6 +55,7 @@ private:
const QTimer& m_masterTimer; const QTimer& m_masterTimer;
bool m_masterTimerConnected; bool m_masterTimerConnected;
bool m_running; bool m_running;
uint32_t m_rateDivider;
SDRdaemonSourceBuffer m_sdrDaemonBuffer; SDRdaemonSourceBuffer m_sdrDaemonBuffer;
QUdpSocket *m_dataSocket; QUdpSocket *m_dataSocket;
QHostAddress m_dataAddress; QHostAddress m_dataAddress;
@ -80,7 +81,6 @@ private:
int32_t *m_converterBuffer; int32_t *m_converterBuffer;
uint32_t m_converterBufferNbSamples; uint32_t m_converterBufferNbSamples;
bool m_throttleToggle; bool m_throttleToggle;
uint32_t m_rateDivider;
bool m_autoCorrBuffer; bool m_autoCorrBuffer;
void connectTimer(); void connectTimer();

View File

@ -168,12 +168,7 @@ bool SDRPlayInput::start()
return false; return false;
} }
if((m_sdrPlayThread = new SDRPlayThread(m_dev, &m_sampleFifo)) == 0) m_sdrPlayThread = new SDRPlayThread(m_dev, &m_sampleFifo);
{
qCritical("SDRPlayInput::start: failed to create thread");
return false;
}
m_sdrPlayThread->setLog2Decimation(m_settings.m_log2Decim); m_sdrPlayThread->setLog2Decimation(m_settings.m_log2Decim);
m_sdrPlayThread->setFcPos((int) m_settings.m_fcPos); m_sdrPlayThread->setFcPos((int) m_settings.m_fcPos);

View File

@ -74,13 +74,7 @@ bool TestSourceInput::start()
if (m_running) stop(); if (m_running) stop();
if ((m_testSourceThread = new TestSourceThread(&m_sampleFifo)) == 0) m_testSourceThread = new TestSourceThread(&m_sampleFifo);
{
qCritical("TestSourceInput::start: out of memory");
stop();
return false;
}
m_testSourceThread->setSamplerate(m_settings.m_sampleRate); m_testSourceThread->setSamplerate(m_settings.m_sampleRate);
m_testSourceThread->connectTimer(m_masterTimer); m_testSourceThread->connectTimer(m_masterTimer);
m_testSourceThread->startWork(); m_testSourceThread->startWork();

View File

@ -266,7 +266,6 @@ bool AudioFifo::create(uint32_t numSamples)
m_fifo = 0; m_fifo = 0;
} }
m_size = 0;
m_fill = 0; m_fill = 0;
m_head = 0; m_head = 0;
m_tail = 0; m_tail = 0;

View File

@ -150,7 +150,7 @@ void DVSerialEngine::getComList()
const char* sysdir = "/sys/class/tty/"; const char* sysdir = "/sys/class/tty/";
// Scan through /sys/class/tty - it contains all tty-devices in the system // Scan through /sys/class/tty - it contains all tty-devices in the system
n = scandir(sysdir, &namelist, NULL, NULL); n = scandir(sysdir, &namelist, NULL, alphasort);
if (n < 0) if (n < 0)
perror("scandir"); perror("scandir");
else else

View File

@ -33,6 +33,7 @@ DVSerialWorker::DVSerialWorker() :
m_audioBuffer.resize(48000); m_audioBuffer.resize(48000);
m_audioBufferFill = 0; m_audioBufferFill = 0;
m_audioFifo = 0; m_audioFifo = 0;
memset(m_dvAudioSamples, 0, SerialDV::MBE_AUDIO_BLOCK_SIZE*sizeof(short));
} }
DVSerialWorker::~DVSerialWorker() DVSerialWorker::~DVSerialWorker()

View File

@ -131,7 +131,7 @@ private:
void upsample6(short *in, int nbSamplesIn, unsigned char channels); void upsample6(short *in, int nbSamplesIn, unsigned char channels);
SerialDV::DVController m_dvController; SerialDV::DVController m_dvController;
bool m_running; volatile bool m_running;
int m_currentGainIn; int m_currentGainIn;
int m_currentGainOut; int m_currentGainOut;
short m_dvAudioSamples[SerialDV::MBE_AUDIO_BLOCK_SIZE]; short m_dvAudioSamples[SerialDV::MBE_AUDIO_BLOCK_SIZE];

View File

@ -48,8 +48,9 @@ protected:
int window; int window;
inline float fsinc(float fc, int i, int len) { inline float fsinc(float fc, int i, int len) {
return (i == len/2) ? 2.0 * fc: int len2 = len/2;
sin(2 * M_PI * fc * (i - (len/2))) / (M_PI * (i - (len/2))); return (i == len2) ? 2.0 * fc:
sin(2 * M_PI * fc * (i - len2)) / (M_PI * (i - len2));
} }
inline float _blackman(int i, int len) { inline float _blackman(int i, int len) {

View File

@ -32,6 +32,25 @@ public:
~DoubleBufferSimple() {} ~DoubleBufferSimple() {}
DoubleBufferSimple(const DoubleBufferSimple& other)
{
m_size = other.m_size;
m_data = other.m_data;
m_current = m_data.begin();
}
DoubleBufferSimple& operator=(const DoubleBufferSimple& other)
{
if (&other == this) {
return *this;
}
m_size = other.m_size;
m_data = other.m_data;
m_current = m_data.begin();
return *this;
}
void resize(int size) void resize(int size)
{ {
m_size = size; m_size = size;

View File

@ -55,8 +55,8 @@ class MovingAverageUtil
} }
} }
double asDouble() const { return m_total / N; } double asDouble() const { return ((double)m_total) / N; }
float asFloat() const { return m_total / N; } float asFloat() const { return ((float)m_total) / N; }
operator T() const { return m_total / N; } operator T() const { return m_total / N; }
private: private:

View File

@ -61,6 +61,9 @@ ScopeVisMulti::ScopeVisMulti(GLScopeMulti* glScope) :
{ {
setObjectName("ScopeVisNG"); setObjectName("ScopeVisNG");
m_glScope->setTraces(&m_traces.m_tracesData, &m_traces.m_traces[0]); m_glScope->setTraces(&m_traces.m_tracesData, &m_traces.m_traces[0]);
for (int i = 0; i < (int) nbProjectionTypes; i++) {
m_projectorCache[i] = 0.0;
}
} }
ScopeVisMulti::~ScopeVisMulti() ScopeVisMulti::~ScopeVisMulti()

View File

@ -64,6 +64,9 @@ ScopeVisNG::ScopeVisNG(GLScopeNG* glScope) :
setObjectName("ScopeVisNG"); setObjectName("ScopeVisNG");
m_traceDiscreteMemory.resize(m_traceChunkSize); // arbitrary m_traceDiscreteMemory.resize(m_traceChunkSize); // arbitrary
m_glScope->setTraces(&m_traces.m_tracesData, &m_traces.m_traces[0]); m_glScope->setTraces(&m_traces.m_tracesData, &m_traces.m_traces[0]);
for (int i = 0; i < (int) nbProjectionTypes; i++) {
m_projectorCache[i] = 0.0;
}
} }
ScopeVisNG::~ScopeVisNG() ScopeVisNG::~ScopeVisNG()

View File

@ -86,6 +86,7 @@ GLScope::GLScope(QWidget* parent) :
m_x2Scale.setOrientation(Qt::Horizontal); m_x2Scale.setOrientation(Qt::Horizontal);
m_powerOverlayFont.setBold(true); m_powerOverlayFont.setBold(true);
m_powerOverlayFont.setPointSize(font().pointSize()+1); m_powerOverlayFont.setPointSize(font().pointSize()+1);
memset(m_sampleRates, 0, (1<<m_memHistorySizeLog2)*sizeof(int));
} }
GLScope::~GLScope() GLScope::~GLScope()

View File

@ -1279,10 +1279,12 @@ void GLSpectrum::applyChanges()
if (sidebands == ChannelMarker::usb) { if (sidebands == ChannelMarker::usb) {
nw = dv->m_channelMarker->getLowCutoff(); // negative bandwidth nw = dv->m_channelMarker->getLowCutoff(); // negative bandwidth
pw = (dv->m_channelMarker->getBandwidth() / 2); // positive bandwidth int bw = dv->m_channelMarker->getBandwidth() / 2;
pw = (qreal) bw; // positive bandwidth
} else if (sidebands == ChannelMarker::lsb) { } else if (sidebands == ChannelMarker::lsb) {
pw = dv->m_channelMarker->getLowCutoff(); pw = dv->m_channelMarker->getLowCutoff();
nw = (dv->m_channelMarker->getBandwidth() / 2); int bw = dv->m_channelMarker->getBandwidth() / 2;
nw = (qreal) bw;
} else if (sidebands == ChannelMarker::vusb) { } else if (sidebands == ChannelMarker::vusb) {
nw = -dv->m_channelMarker->getOppositeBandwidth(); // negative bandwidth nw = -dv->m_channelMarker->getOppositeBandwidth(); // negative bandwidth
pw = dv->m_channelMarker->getBandwidth(); // positive bandwidth pw = dv->m_channelMarker->getBandwidth(); // positive bandwidth