mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 21:01:45 -05:00
FreeDV demodulator: set filters and channelizer depending on mode bandwidth requirements
This commit is contained in:
parent
4faa574faf
commit
5009f0a7a0
@ -360,20 +360,36 @@ void FreeDVDemod::applyAudioSampleRate(int sampleRate)
|
|||||||
{
|
{
|
||||||
qDebug("FreeDVDemod::applyAudioSampleRate: %d", sampleRate);
|
qDebug("FreeDVDemod::applyAudioSampleRate: %d", sampleRate);
|
||||||
|
|
||||||
MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create(
|
m_settingsMutex.lock();
|
||||||
sampleRate, m_settings.m_inputFrequencyOffset);
|
m_audioFifo.setSize(sampleRate);
|
||||||
m_inputMessageQueue.push(channelConfigMsg);
|
m_settingsMutex.unlock();
|
||||||
|
|
||||||
|
m_audioSampleRate = sampleRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FreeDVDemod::applyFreeDVMode(FreeDVDemodSettings::FreeDVMode mode)
|
||||||
|
{
|
||||||
|
m_hiCutoff = FreeDVDemodSettings::getHiCutoff(mode);
|
||||||
|
m_lowCutoff = FreeDVDemodSettings::getLowCutoff(mode);
|
||||||
|
uint32_t modemSampleRate = FreeDVDemodSettings::getModSampleRate(mode);
|
||||||
|
|
||||||
m_settingsMutex.lock();
|
m_settingsMutex.lock();
|
||||||
|
|
||||||
|
// baseband interpolator and filter
|
||||||
|
if (modemSampleRate != m_modemSampleRate)
|
||||||
|
{
|
||||||
|
MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create(
|
||||||
|
modemSampleRate, m_settings.m_inputFrequencyOffset);
|
||||||
|
m_inputMessageQueue.push(channelConfigMsg);
|
||||||
|
|
||||||
m_interpolator.create(16, m_inputSampleRate, m_hiCutoff * 1.5f, 2.0f);
|
m_interpolator.create(16, m_inputSampleRate, m_hiCutoff * 1.5f, 2.0f);
|
||||||
m_interpolatorDistanceRemain = 0;
|
m_interpolatorDistanceRemain = 0;
|
||||||
m_interpolatorDistance = (Real) m_inputSampleRate / (Real) sampleRate;
|
m_interpolatorDistance = (Real) m_inputSampleRate / (Real) modemSampleRate;
|
||||||
|
|
||||||
SSBFilter->create_filter(m_lowCutoff / (float) sampleRate, m_hiCutoff / (float) sampleRate);
|
SSBFilter->create_filter(m_lowCutoff / (float) modemSampleRate, m_hiCutoff / (float) modemSampleRate);
|
||||||
|
|
||||||
int agcNbSamples = (sampleRate / 1000) * (1<<m_settings.m_agcTimeLog2);
|
int agcNbSamples = (modemSampleRate / 1000) * (1<<m_settings.m_agcTimeLog2);
|
||||||
int agcThresholdGate = (sampleRate / 1000) * m_settings.m_agcThresholdGate; // ms
|
int agcThresholdGate = (modemSampleRate / 1000) * m_settings.m_agcThresholdGate; // ms
|
||||||
|
|
||||||
if (m_agcNbSamples != agcNbSamples)
|
if (m_agcNbSamples != agcNbSamples)
|
||||||
{
|
{
|
||||||
@ -388,17 +404,16 @@ void FreeDVDemod::applyAudioSampleRate(int sampleRate)
|
|||||||
m_agcThresholdGate = agcThresholdGate;
|
m_agcThresholdGate = agcThresholdGate;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_audioFifo.setSize(sampleRate);
|
m_modemSampleRate = modemSampleRate;
|
||||||
|
|
||||||
|
if (getMessageQueueToGUI())
|
||||||
|
{
|
||||||
|
DSPConfigureAudio *cfg = new DSPConfigureAudio(m_modemSampleRate);
|
||||||
|
getMessageQueueToGUI()->push(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_settingsMutex.unlock();
|
m_settingsMutex.unlock();
|
||||||
|
|
||||||
m_audioSampleRate = sampleRate;
|
|
||||||
|
|
||||||
if (m_guiMessageQueue) // forward to GUI if any
|
|
||||||
{
|
|
||||||
DSPConfigureAudio *cfg = new DSPConfigureAudio(m_audioSampleRate);
|
|
||||||
m_guiMessageQueue->push(cfg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force)
|
void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force)
|
||||||
@ -510,6 +525,10 @@ void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force)
|
|||||||
reverseAPIKeys.append("agc");
|
reverseAPIKeys.append("agc");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((settings.m_freeDVMode != m_settings.m_freeDVMode) || force) {
|
||||||
|
applyFreeDVMode(settings.m_freeDVMode);
|
||||||
|
}
|
||||||
|
|
||||||
m_spanLog2 = settings.m_spanLog2;
|
m_spanLog2 = settings.m_spanLog2;
|
||||||
m_audioMute = settings.m_audioMute;
|
m_audioMute = settings.m_audioMute;
|
||||||
m_agcActive = settings.m_agc;
|
m_agcActive = settings.m_agc;
|
||||||
|
@ -319,6 +319,7 @@ private:
|
|||||||
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false);
|
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false);
|
||||||
void applySettings(const FreeDVDemodSettings& settings, bool force = false);
|
void applySettings(const FreeDVDemodSettings& settings, bool force = false);
|
||||||
void applyAudioSampleRate(int sampleRate);
|
void applyAudioSampleRate(int sampleRate);
|
||||||
|
void applyFreeDVMode(FreeDVDemodSettings::FreeDVMode mode);
|
||||||
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const FreeDVDemodSettings& settings);
|
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const FreeDVDemodSettings& settings);
|
||||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const FreeDVDemodSettings& settings, bool force);
|
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const FreeDVDemodSettings& settings, bool force);
|
||||||
|
Loading…
Reference in New Issue
Block a user