1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

PlutoSDR output: use settings in modulator (4)

This commit is contained in:
f4exb 2017-10-10 21:47:15 +02:00
parent 7cce5625e1
commit 179c1a00c4
2 changed files with 16 additions and 17 deletions

View File

@ -52,12 +52,12 @@ AMMod::AMMod() :
{ {
setObjectName("AMMod"); setObjectName("AMMod");
m_config.m_outputSampleRate = 48000; // m_config.m_outputSampleRate = 48000;
m_config.m_inputFrequencyOffset = 0; // m_config.m_inputFrequencyOffset = 0;
m_config.m_rfBandwidth = 12500; // m_config.m_rfBandwidth = 12500;
m_config.m_modFactor = 0.2f; // m_config.m_modFactor = 0.2f;
m_config.m_toneFrequency = 1000.0f; // m_config.m_toneFrequency = 1000.0f;
m_config.m_audioSampleRate = DSPEngine::instance()->getAudioSampleRate(); // m_config.m_audioSampleRate = DSPEngine::instance()->getAudioSampleRate();
m_audioBuffer.resize(1<<14); m_audioBuffer.resize(1<<14);
m_audioBufferFill = 0; m_audioBufferFill = 0;
@ -66,11 +66,11 @@ AMMod::AMMod() :
m_volumeAGC.resize(4096, 0.003, 0); m_volumeAGC.resize(4096, 0.003, 0);
m_magsq = 0.0; m_magsq = 0.0;
m_toneNco.setFreq(1000.0, m_config.m_audioSampleRate); m_toneNco.setFreq(1000.0, m_settings.m_audioSampleRate);
DSPEngine::instance()->addAudioSource(&m_audioFifo); DSPEngine::instance()->addAudioSource(&m_audioFifo);
// CW keyer // CW keyer
m_cwKeyer.setSampleRate(m_config.m_audioSampleRate); m_cwKeyer.setSampleRate(m_settings.m_audioSampleRate);
m_cwKeyer.setWPM(13); m_cwKeyer.setWPM(13);
m_cwKeyer.setMode(CWKeyer::CWNone); m_cwKeyer.setMode(CWKeyer::CWNone);
m_cwSmoother.setNbFadeSamples(192); // 4 ms @ 48 kHz m_cwSmoother.setNbFadeSamples(192); // 4 ms @ 48 kHz
@ -143,7 +143,7 @@ void AMMod::pull(Sample& sample)
void AMMod::pullAudio(int nbSamples) void AMMod::pullAudio(int nbSamples)
{ {
// qDebug("AMMod::pullAudio: %d", nbSamples); // qDebug("AMMod::pullAudio: %d", nbSamples);
unsigned int nbAudioSamples = nbSamples * ((Real) m_config.m_audioSampleRate / (Real) m_config.m_basebandSampleRate); unsigned int nbAudioSamples = nbSamples * ((Real) m_settings.m_audioSampleRate / (Real) m_settings.m_basebandSampleRate);
if (nbAudioSamples > m_audioBuffer.size()) if (nbAudioSamples > m_audioBuffer.size())
{ {
@ -254,8 +254,8 @@ void AMMod::calculateLevel(Real& sample)
void AMMod::start() void AMMod::start()
{ {
qDebug() << "AMMod::start: m_outputSampleRate: " << m_config.m_outputSampleRate qDebug() << "AMMod::start: m_outputSampleRate: " << m_settings.m_outputSampleRate
<< " m_inputFrequencyOffset: " << m_config.m_inputFrequencyOffset; << " m_inputFrequencyOffset: " << m_settings.m_inputFrequencyOffset;
m_audioFifo.clear(); m_audioFifo.clear();
} }
@ -270,9 +270,9 @@ bool AMMod::handleMessage(const Message& cmd)
{ {
UpChannelizer::MsgChannelizerNotification& notif = (UpChannelizer::MsgChannelizerNotification&) cmd; UpChannelizer::MsgChannelizerNotification& notif = (UpChannelizer::MsgChannelizerNotification&) cmd;
m_config.m_basebandSampleRate = notif.getBasebandSampleRate(); // m_config.m_basebandSampleRate = notif.getBasebandSampleRate();
m_config.m_outputSampleRate = notif.getSampleRate(); // m_config.m_outputSampleRate = notif.getSampleRate();
m_config.m_inputFrequencyOffset = notif.getFrequencyOffset(); // m_config.m_inputFrequencyOffset = notif.getFrequencyOffset();
AMModSettings settings = m_settings; AMModSettings settings = m_settings;

View File

@ -324,8 +324,8 @@ private:
//================================================================= //=================================================================
Config m_config; // Config m_config;
Config m_running; // Config m_running;
AMModSettings m_settings; AMModSettings m_settings;
NCO m_carrierNco; NCO m_carrierNco;
@ -362,7 +362,6 @@ private:
static const int m_levelNbSamples; static const int m_levelNbSamples;
// void apply();
void applySettings(const AMModSettings& settings, bool force = false); void applySettings(const AMModSettings& settings, bool force = false);
void pullAF(Real& sample); void pullAF(Real& sample);
void calculateLevel(Real& sample); void calculateLevel(Real& sample);