From 6ec6ab41b9a7450588c77962d7eeb72b51f323e4 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 18 Dec 2016 20:03:47 +0100 Subject: [PATCH] WFM Modulator: set RF level to -1 dB --- plugins/channeltx/modnfm/nfmmodgui.cpp | 14 +++++++++ plugins/channeltx/modnfm/nfmmodgui.h | 3 ++ plugins/channeltx/modnfm/nfmmodgui.ui | 41 ++++++++++++++++++++++++-- plugins/channeltx/modwfm/wfmmod.cpp | 4 +-- 4 files changed, 58 insertions(+), 4 deletions(-) diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index c75091ddc..c2ab2d722 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -40,6 +40,15 @@ const int NFMModGUI::m_rfBW[] = { }; const int NFMModGUI::m_nbRfBW = 11; +const float NFMModGUI::m_ctcssTones[] = { + 67.0, 71.9, 74.4, 77.0, 79.7, 82.5, 85.4, 88.5, 91.5, 94.8, + 97.4, 100.0, 103.5, 107.2, 110.9, 114.8, 118.8, 123.0, 127.3, 131.8, + 136.5, 141.3, 146.2, 151.4, 156.7, 162.2, 167.9, 173.8, 179.9, 186.2, + 192.8, 203.5 +}; +const int NFMModGUI::m_nbCTCSSTones = 32; + + NFMModGUI* NFMModGUI::create(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI) { NFMModGUI* gui = new NFMModGUI(pluginAPI, deviceAPI); @@ -399,6 +408,11 @@ NFMModGUI::NFMModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pa ui->tone->setChecked(false); ui->mic->setChecked(false); + for (int i=0; ictcss->addItem(QString("%1").arg((double) m_ctcssTones[i], 0, 'f', 1)); + } + ui->cwKeyerGUI->setBuddies(m_nfmMod->getInputMessageQueue(), m_nfmMod->getCWKeyer()); applySettings(); diff --git a/plugins/channeltx/modnfm/nfmmodgui.h b/plugins/channeltx/modnfm/nfmmodgui.h index d7e1535ba..958e4340a 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.h +++ b/plugins/channeltx/modnfm/nfmmodgui.h @@ -106,6 +106,9 @@ private: static const int m_rfBW[]; static const int m_nbRfBW; + static const float m_ctcssTones[]; + static const int m_nbCTCSSTones; + explicit NFMModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* parent = NULL); virtual ~NFMModGUI(); diff --git a/plugins/channeltx/modnfm/nfmmodgui.ui b/plugins/channeltx/modnfm/nfmmodgui.ui index 05841ab9f..cc23cf577 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.ui +++ b/plugins/channeltx/modnfm/nfmmodgui.ui @@ -6,7 +6,7 @@ 0 0 - 298 + 363 300 @@ -39,7 +39,7 @@ 2 2 - 280 + 341 271 @@ -512,6 +512,43 @@ + + + + Qt::Vertical + + + + + + + CTCSS + + + + + + + Activate CTCSS + + + + + + + + + + + 60 + 16777215 + + + + Set CTCSS Frequency + + + diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index de3b27486..e7979ea89 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -114,8 +114,8 @@ void WFMMod::pull(Sample& sample) m_interpolatorDistanceRemain += m_interpolatorDistance; m_modPhasor += (m_running.m_fmDeviation / (float) m_running.m_outputSampleRate) * ri.real() * M_PI; - ci.real(cos(m_modPhasor) * 16384.0f); // -6 dB - ci.imag(sin(m_modPhasor) * 16384.0f); + ci.real(cos(m_modPhasor) * 29204.0f); // -1 dB + ci.imag(sin(m_modPhasor) * 29204.0f); // RF filtering is unnecessary