diff --git a/.gitignore b/.gitignore index b4d70d754..9db615813 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ CMakeLists.txt.user* -build/* +build* qtbuild/* sdriq/* presets/* diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index 8242d87e5..248481916 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -55,9 +55,9 @@ AMMod::~AMMod() { } -void AMMod::configure(MessageQueue* messageQueue, Real rfBandwidth, Real afBandwidth, int modPercent, bool audioMute) +void AMMod::configure(MessageQueue* messageQueue, Real rfBandwidth, Real afBandwidth, float modFactor, bool audioMute) { - Message* cmd = MsgConfigureAMMod::create(rfBandwidth, afBandwidth, modPercent, audioMute); + Message* cmd = MsgConfigureAMMod::create(rfBandwidth, afBandwidth, modFactor, audioMute); messageQueue->push(cmd); } @@ -75,7 +75,7 @@ void AMMod::pull(Sample& sample) m_carrierNco.getIQ(m_modSample); Real t = m_toneNco.get(); - m_modSample *= (t+1.0f) * m_running.m_modFactor * 16384.0f; // modulate carrier + m_modSample *= (t+1.0f) * m_running.m_modFactor * 16384.0f; // modulate and scale carrier m_interpolatorDistanceRemain += m_interpolatorDistance; } @@ -150,7 +150,7 @@ void AMMod::apply() if(m_config.m_inputFrequencyOffset != m_running.m_inputFrequencyOffset) { - m_carrierNco.setFreq(-m_config.m_inputFrequencyOffset, m_config.m_audioSampleRate); + m_carrierNco.setFreq(m_config.m_inputFrequencyOffset, m_config.m_audioSampleRate); } if((m_config.m_outputSampleRate != m_running.m_outputSampleRate) || diff --git a/plugins/channeltx/modam/ammod.h b/plugins/channeltx/modam/ammod.h index 417894880..c0c868ec9 100644 --- a/plugins/channeltx/modam/ammod.h +++ b/plugins/channeltx/modam/ammod.h @@ -35,7 +35,7 @@ public: AMMod(); ~AMMod(); - void configure(MessageQueue* messageQueue, Real rfBandwidth, Real afBandwidth, int modPercent, bool audioMute); + void configure(MessageQueue* messageQueue, Real rfBandwidth, Real afBandwidth, float modFactor, bool audioMute); virtual void pull(Sample& sample); virtual void start(); @@ -54,9 +54,9 @@ private: float getModFactor() const { return m_modFactor; } bool getAudioMute() const { return m_audioMute; } - static MsgConfigureAMMod* create(Real rfBandwidth, Real afBandwidth, int modPercent, bool audioMute) + static MsgConfigureAMMod* create(Real rfBandwidth, Real afBandwidth, float modFactor, bool audioMute) { - return new MsgConfigureAMMod(rfBandwidth, afBandwidth, modPercent, audioMute); + return new MsgConfigureAMMod(rfBandwidth, afBandwidth, modFactor, audioMute); } private: diff --git a/sdrbase/dsp/dspdevicesinkengine.cpp b/sdrbase/dsp/dspdevicesinkengine.cpp index 6603b1796..cadec73bc 100644 --- a/sdrbase/dsp/dspdevicesinkengine.cpp +++ b/sdrbase/dsp/dspdevicesinkengine.cpp @@ -175,6 +175,7 @@ void DSPDeviceSinkEngine::work() sampleFifo->getWriteIterator(writeBegin); SampleVector::iterator writeAt = writeBegin; Sample s; + int sourceOccurence = 0; if ((m_threadedBasebandSampleSources.size() + m_basebandSampleSources.size()) > 0) { @@ -185,7 +186,14 @@ void DSPDeviceSinkEngine::work() { (*it)->pull(s); s /= (m_threadedBasebandSampleSources.size() + m_basebandSampleSources.size()); - (*writeAt) += s; + + if (sourceOccurence == 0) { + (*writeAt) = s; + } else { + (*writeAt) += s; + } + + sourceOccurence++; } // pull data from direct sources and merge them in the device sample FIFO @@ -194,9 +202,18 @@ void DSPDeviceSinkEngine::work() (*it)->pull(s); s /= (m_threadedBasebandSampleSources.size() + m_basebandSampleSources.size()); (*writeAt) += s; + + if (sourceOccurence == 0) { + (*writeAt) = s; + } else { + (*writeAt) += s; + } + + sourceOccurence++; } sampleFifo->bumpIndex(writeAt); + sourceOccurence = 0; } // feed the mix to the sinks normally just the main spectrum vis