diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index d067bfa4e..6f188d37c 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -65,8 +65,9 @@ DSDDemod::DSDDemod(DeviceSourceAPI *deviceAPI) : m_audioBuffer.resize(1<<14); m_audioBufferFill = 0; - m_sampleBuffer = new qint16[1<<17]; // 128 kS + m_sampleBuffer = new FixReal[1<<17]; // 128 kS m_sampleBufferIndex = 0; + m_scaleFromShort = SDR_RX_SAMP_SZ < sizeof(short)*8 ? 1 : 1<<(SDR_RX_SAMP_SZ - sizeof(short)*8); m_movingAverage.resize(16, 0); m_magsq = 0.0f; @@ -126,7 +127,8 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci)) { - qint16 sample, delayedSample; + FixReal sample, delayedSample; + qint16 sampleDSD; Real re = ci.real() / SDR_RX_SCALED; Real im = ci.imag() / SDR_RX_SCALED; @@ -142,7 +144,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto m_magsqCount++; - Real demod = SDR_RX_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_demodGain; + Real demod = m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_demodGain; // [-1.0:1.0] m_sampleCount++; // AF processing @@ -170,17 +172,19 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto if (m_squelchOpen) { - sample = demod; + sampleDSD = demod * 32768.0f; // DSD decoder takes int16 samples + sample = demod * SDR_RX_SCALEF; // scale to sample size } else { + sampleDSD = 0; sample = 0; } - m_dsdDecoder.pushSample(sample); + m_dsdDecoder.pushSample(sampleDSD); if (m_settings.m_enableCosineFiltering) { // show actual input to FSK demod - sample = m_dsdDecoder.getFilteredSample(); + sample = m_dsdDecoder.getFilteredSample() * m_scaleFromShort; } if (m_sampleBufferIndex < (1<<17)) { @@ -199,7 +203,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto if (m_settings.m_syncOrConstellation) { - Sample s(sample, m_dsdDecoder.getSymbolSyncSample()); + Sample s(sample, m_dsdDecoder.getSymbolSyncSample() * m_scaleFromShort); m_scopeSampleBuffer.push_back(s); } else diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index 80ec2d758..299703474 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -186,8 +186,9 @@ private: SampleVector m_scopeSampleBuffer; AudioVector m_audioBuffer; uint m_audioBufferFill; - qint16 *m_sampleBuffer; //!< samples ring buffer + FixReal *m_sampleBuffer; //!< samples ring buffer int m_sampleBufferIndex; + int m_scaleFromShort; AudioFifo m_audioFifo1; AudioFifo m_audioFifo2; diff --git a/plugins/channelrx/demoddsd/dsddemodplugin.cpp b/plugins/channelrx/demoddsd/dsddemodplugin.cpp index 9d0ce86fd..fac69c490 100644 --- a/plugins/channelrx/demoddsd/dsddemodplugin.cpp +++ b/plugins/channelrx/demoddsd/dsddemodplugin.cpp @@ -25,7 +25,7 @@ const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = { QString("DSD Demodulator"), - QString("3.10.1"), + QString("3.11.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceplugin.cpp b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceplugin.cpp index 7cda55a7f..8f5b33517 100644 --- a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceplugin.cpp +++ b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceplugin.cpp @@ -26,7 +26,7 @@ const PluginDescriptor SDRdaemonSourcePlugin::m_pluginDescriptor = { QString("SDRdaemon source input"), - QString("3.9.0"), + QString("3.11.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true,