1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

FreeDV: a few fixes

This commit is contained in:
f4exb 2019-03-01 00:25:57 +01:00
parent 554db8fe82
commit 74604a25d4
5 changed files with 61 additions and 42 deletions

2
debian/changelog vendored
View File

@ -1,6 +1,6 @@
sdrangel (4.5.0-1) unstable; urgency=medium sdrangel (4.5.0-1) unstable; urgency=medium
* Implemented a FreeDV modulator * Implemented a FreeDV modulator and demodulator
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 03 Mar 2019 20:14:18 +0100 -- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 03 Mar 2019 20:14:18 +0100

View File

@ -301,8 +301,10 @@ void FreeDVDemod::feed(const SampleVector::const_iterator& begin, const SampleVe
m_sum.imag(0.0); m_sum.imag(0.0);
} }
fftfilt::cmplx z = sideband[i]; // fftfilt::cmplx z = sideband[i];
Real demod = (z.real() + z.imag()) * 0.7; // Real demod = (z.real() + z.imag()) * 0.7;
Real demod = sideband[i].real(); // works as good
if (m_agcActive) if (m_agcActive)
{ {
m_simpleAGC.feed(demod); m_simpleAGC.feed(demod);
@ -448,13 +450,22 @@ void FreeDVDemod::pushSampleToDV(int16_t sample)
m_freeDVStats.collect(m_freeDV); m_freeDVStats.collect(m_freeDV);
m_freeDVSNR.accumulate(m_freeDVStats.m_snrEst); m_freeDVSNR.accumulate(m_freeDVStats.m_snrEst);
for (int i = 0; i < nout; i++) if (m_settings.m_audioMute)
{ {
while (!m_audioResampler.upSample(m_speechOut[i], audioSample)) { for (uint32_t i = 0; i < nout * m_audioResampler.getDecimation(); i++) {
pushSampleToAudio(0);
}
}
else
{
for (int i = 0; i < nout; i++)
{
while (!m_audioResampler.upSample(m_speechOut[i], audioSample)) {
pushSampleToAudio(audioSample);
}
pushSampleToAudio(audioSample); pushSampleToAudio(audioSample);
} }
pushSampleToAudio(audioSample);
} }
m_iModem = 0; m_iModem = 0;

View File

@ -21,7 +21,6 @@
#include "device/devicesourceapi.h" #include "device/devicesourceapi.h"
#include "device/deviceuiset.h" #include "device/deviceuiset.h"
#include "ui_freedvdemodgui.h"
#include "dsp/spectrumvis.h" #include "dsp/spectrumvis.h"
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
@ -33,6 +32,8 @@
#include "gui/crightclickenabler.h" #include "gui/crightclickenabler.h"
#include "gui/audioselectdialog.h" #include "gui/audioselectdialog.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_freedvdemodgui.h"
#include "freedvdemod.h" #include "freedvdemod.h"
FreeDVDemodGUI* FreeDVDemodGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) FreeDVDemodGUI* FreeDVDemodGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
@ -387,6 +388,9 @@ void FreeDVDemodGUI::displaySettings()
ui->volume->setValue(m_settings.m_volume * 10.0); ui->volume->setValue(m_settings.m_volume * 10.0);
ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1)); ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
ui->volumeIn->setValue(m_settings.m_volumeIn * 10.0);
ui->volumeInText->setText(QString("%1").arg(m_settings.m_volumeIn, 0, 'f', 1));
blockApplySettings(false); blockApplySettings(false);
} }

View File

@ -25,7 +25,6 @@
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "device/deviceuiset.h" #include "device/deviceuiset.h"
#include "dsp/spectrumvis.h" #include "dsp/spectrumvis.h"
#include "ui_freedvmodgui.h"
#include "plugin/pluginapi.h" #include "plugin/pluginapi.h"
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
#include "util/db.h" #include "util/db.h"
@ -35,6 +34,7 @@
#include "gui/audioselectdialog.h" #include "gui/audioselectdialog.h"
#include "gui/basicchannelsettingsdialog.h" #include "gui/basicchannelsettingsdialog.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_freedvmodgui.h"
FreeDVModGUI* FreeDVModGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx) FreeDVModGUI* FreeDVModGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx)
{ {

View File

@ -161,7 +161,43 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="audioOptionsLayout"/> <layout class="QHBoxLayout" name="audioOptionsLayout">
<property name="leftMargin">
<number>6</number>
</property>
<item>
<widget class="QComboBox" name="freeDVMode">
<property name="toolTip">
<string>FreeDV mode</string>
</property>
<item>
<property name="text">
<string>2400A</string>
</property>
</item>
<item>
<property name="text">
<string>1600</string>
</property>
</item>
<item>
<property name="text">
<string>800XA</string>
</property>
</item>
<item>
<property name="text">
<string>700C</string>
</property>
</item>
<item>
<property name="text">
<string>700D</string>
</property>
</item>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </item>
@ -385,38 +421,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QComboBox" name="freeDVMode">
<property name="toolTip">
<string>FreeDV mode</string>
</property>
<item>
<property name="text">
<string>2400A</string>
</property>
</item>
<item>
<property name="text">
<string>1600</string>
</property>
</item>
<item>
<property name="text">
<string>800XA</string>
</property>
</item>
<item>
<property name="text">
<string>700C</string>
</property>
</item>
<item>
<property name="text">
<string>700D</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>