diff --git a/doc/img/PSK31Mod_plugin.png b/doc/img/PSK31Mod_plugin.png new file mode 100644 index 000000000..52be43496 Binary files /dev/null and b/doc/img/PSK31Mod_plugin.png differ diff --git a/plugins/channeltx/modpsk31/psk31modgui.cpp b/plugins/channeltx/modpsk31/psk31modgui.cpp index 8b5f82d8a..8cb285c2e 100644 --- a/plugins/channeltx/modpsk31/psk31modgui.cpp +++ b/plugins/channeltx/modpsk31/psk31modgui.cpp @@ -113,7 +113,6 @@ bool PSK31GUI::handleMessage(const Message& message) } ui->txButton->setToolTip(tooltip); - s = s.replace(">", ""); // Don't display LTRS s = s.replace("\r", ""); // Don't display carriage returns if (!s.isEmpty()) @@ -186,7 +185,7 @@ void PSK31GUI::on_deltaFrequency_changed(qint64 value) void PSK31GUI::on_rfBW_valueChanged(int value) { int bw = value; - ui->rfBWText->setText(formatFrequency(bw)); + ui->rfBWText->setText(QString("%1 Hz").arg(bw)); m_channelMarker.setBandwidth(bw); m_settings.m_rfBandwidth = bw; applySettings(); @@ -444,15 +443,6 @@ void PSK31GUI::applySettings(bool force) } } -QString PSK31GUI::formatFrequency(int frequency) const -{ - QString suffix = ""; - if (width() > 450) { - suffix = " Hz"; - } - return QString("%1%2").arg(frequency).arg(suffix); -} - QString PSK31GUI::substitute(const QString& text) { const MainSettings& mainSettings = MainCore::instance()->getSettings(); @@ -483,14 +473,14 @@ void PSK31GUI::displaySettings() ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); - ui->rfBWText->setText(formatFrequency(m_settings.m_rfBandwidth)); + ui->rfBWText->setText(QString("%1 Hz").arg(m_settings.m_rfBandwidth)); ui->rfBW->setValue(m_settings.m_rfBandwidth); ui->udpEnabled->setChecked(m_settings.m_udpEnabled); ui->udpAddress->setText(m_settings.m_udpAddress); ui->udpPort->setText(QString::number(m_settings.m_udpPort)); - ui->gainText->setText(QString("%1").arg((double)m_settings.m_gain, 0, 'f', 1)); + ui->gainText->setText(QString("%1dB").arg((double)m_settings.m_gain, 0, 'f', 1)); ui->gain->setValue(m_settings.m_gain); ui->channelMute->setChecked(m_settings.m_channelMute); diff --git a/plugins/channeltx/modpsk31/psk31modgui.h b/plugins/channeltx/modpsk31/psk31modgui.h index 25115fa0c..3e6be55b6 100644 --- a/plugins/channeltx/modpsk31/psk31modgui.h +++ b/plugins/channeltx/modpsk31/psk31modgui.h @@ -77,7 +77,7 @@ private: QString m_initialToolTip; PSK31* m_psk31Mod; - MovingAverageUtil m_channelPowerDbAvg; // Less than other mods, as packets are short + MovingAverageUtil m_channelPowerDbAvg; MessageQueue m_inputMessageQueue; @@ -88,7 +88,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - QString formatFrequency(int frequency) const; bool handleMessage(const Message& message); void makeUIConnections(); void updateAbsoluteCenterFrequency(); diff --git a/plugins/channeltx/modpsk31/psk31modgui.ui b/plugins/channeltx/modpsk31/psk31modgui.ui index bcd498b6a..e02bae250 100644 --- a/plugins/channeltx/modpsk31/psk31modgui.ui +++ b/plugins/channeltx/modpsk31/psk31modgui.ui @@ -7,7 +7,7 @@ 0 0 396 - 702 + 700 @@ -43,7 +43,7 @@ 2 2 391 - 211 + 161 @@ -213,19 +213,19 @@ RF bandwidth - 1 - - - 2000 - - 10 + + 500 + + + 1 + - 100 + 10 - 340 + 100 Qt::Horizontal @@ -241,7 +241,7 @@ - 1700 + 500 Hz Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -429,30 +429,6 @@ - - - - - - Qt::Horizontal - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -483,6 +459,13 @@ + + + + Qt::Horizontal + + + diff --git a/plugins/channeltx/modpsk31/psk31modsettings.cpp b/plugins/channeltx/modpsk31/psk31modsettings.cpp index e6a2e2f05..51b7eeba0 100644 --- a/plugins/channeltx/modpsk31/psk31modsettings.cpp +++ b/plugins/channeltx/modpsk31/psk31modsettings.cpp @@ -36,7 +36,7 @@ void PSK31Settings::resetToDefaults() { m_inputFrequencyOffset = 0; m_baud = 31.25; - m_rfBandwidth = 340; + m_rfBandwidth = 100; m_gain = 0.0f; m_channelMute = false; m_repeat = false; @@ -52,7 +52,7 @@ void PSK31Settings::resetToDefaults() "UR 599 QTH IS ${location}", "TU DE ${callsign} CQ" }); - m_rgbColor = QColor(180, 205, 130).rgb(); + m_rgbColor = QColor(25, 180, 200).rgb(); m_title = "PSK31 Modulator"; m_streamIndex = 0; m_useReverseAPI = false; @@ -139,7 +139,7 @@ bool PSK31Settings::deserialize(const QByteArray& data) d.readS32(1, &tmp, 0); m_inputFrequencyOffset = tmp; d.readReal(2, &m_baud, 31.25f); - d.readS32(3, &m_rfBandwidth, 340); + d.readS32(3, &m_rfBandwidth, 100); d.readReal(5, &m_gain, 0.0f); d.readBool(6, &m_channelMute, false); d.readBool(7, &m_repeat, false); diff --git a/plugins/channeltx/modpsk31/psk31modsource.cpp b/plugins/channeltx/modpsk31/psk31modsource.cpp index 2b8b483d1..06cde3e3c 100644 --- a/plugins/channeltx/modpsk31/psk31modsource.cpp +++ b/plugins/channeltx/modpsk31/psk31modsource.cpp @@ -30,7 +30,6 @@ PSK31Source::PSK31Source() : m_channelSampleRate(48000), m_channelFrequencyOffset(0), m_spectrumRate(2000), - m_fmPhase(0.0), m_spectrumSink(nullptr), m_specSampleBufferIndex(0), m_magsq(0.0), @@ -42,8 +41,8 @@ PSK31Source::PSK31Source() : m_bitCount(0) { m_bits.append(0); - m_lowpass.create(301, m_channelSampleRate, 400.0 / 2.0); - m_pulseShape.create(0.5, 6, m_channelSampleRate / 45.45, true); + m_lowpass.create(301, m_channelSampleRate, 100.0 / 2.0); + m_pulseShape.create(0.5, 6, m_channelSampleRate / 31.25, true); m_demodBuffer.resize(1<<12); m_demodBufferFill = 0; @@ -258,8 +257,6 @@ void PSK31Source::applySettings(const PSK31Settings& settings, bool force) m_settings = settings; - // Precalculate FM sensensity and linear gain to save doing it in the loop - m_phaseSensitivity = 2.0f * M_PI * 1100 / (double)m_channelSampleRate; m_linearGain = powf(10.0f, m_settings.m_gain/20.0f); } @@ -303,9 +300,6 @@ void PSK31Source::applyChannelSettings(int channelSampleRate, int channelFrequen m_samplesPerSymbol = m_channelSampleRate / m_settings.m_baud; qDebug() << "m_samplesPerSymbol: " << m_samplesPerSymbol << " (" << m_channelSampleRate << "/" << m_settings.m_baud << ")"; - // Precalculate FM sensensity to save doing it in the loop - m_phaseSensitivity = 2.0f * M_PI * 1100 / (double)m_channelSampleRate; - QList pipes; MainCore::instance()->getMessagePipes().getMessagePipes(m_channel, "reportdemod", pipes); @@ -349,7 +343,6 @@ void PSK31Source::addBit(int bit) m_bits[m_byteIdx] |= bit << m_bitIdx; m_bitIdx++; m_bitCount++; - m_bitCountTotal++; if (m_bitIdx == 8) { m_byteIdx++; @@ -364,8 +357,6 @@ void PSK31Source::initTX() { m_byteIdx = 0; m_bitIdx = 0; - m_bitCount = m_bitCountTotal; // Reset to allow retransmission - m_bit = 0; } void PSK31Source::addTXText(QString text) @@ -377,7 +368,7 @@ void PSK31Source::addTXText(QString text) QString s = text; if (m_settings.m_prefixCRLF) { - s.prepend("\r\r\n>"); // '>' switches to letters + s.prepend("\r\r\n"); } if (m_settings.m_postfixCRLF) { s.append("\r\r\n"); @@ -393,7 +384,6 @@ void PSK31Source::encodeText(const QString& text) m_byteIdx = 0; m_bitIdx = 0; m_bitCount = 0; - m_bitCountTotal = 0; for (int i = 0; i < m_bits.size(); i++) { m_bits[i] = 0; } @@ -423,12 +413,9 @@ void PSK31Source::encodeIdle() m_byteIdx = 0; m_bitIdx = 0; m_bitCount = 0; - m_bitCountTotal = 0; for (int i = 0; i < m_bits.size(); i++) { m_bits[i] = 0; } addBit(0); addBit(0); - addBit(0); - addBit(0); } diff --git a/plugins/channeltx/modpsk31/psk31modsource.h b/plugins/channeltx/modpsk31/psk31modsource.h index 7313ba094..2c0db32a0 100644 --- a/plugins/channeltx/modpsk31/psk31modsource.h +++ b/plugins/channeltx/modpsk31/psk31modsource.h @@ -70,15 +70,12 @@ private: ChannelAPI *m_channel; NCO m_carrierNco; - double m_fmPhase; // Double gives cleaner spectrum than Real - double m_phaseSensitivity; Real m_linearGain; Complex m_modSample; int m_bit; // Current bit - int m_prevBit; // Previous bit, for differential encoding int m_symbol; // Current symbol - int m_prevSymbol; + int m_prevSymbol; // Previous symbol for differential encoding RaisedCosine m_pulseShape; // Pulse shaping filter Lowpass m_lowpass; // Low pass filter to limit RF bandwidth @@ -113,7 +110,6 @@ private: int m_byteIdx; // Index in to m_bits int m_bitIdx; // Index in to current byte of m_bits int m_bitCount; // Count of number of valid bits in m_bits - int m_bitCountTotal; QVector m_demodBuffer; int m_demodBufferFill; diff --git a/plugins/channeltx/modpsk31/psk31modtxsettingsdialog.ui b/plugins/channeltx/modpsk31/psk31modtxsettingsdialog.ui index 579a7f6f9..31f63eb67 100644 --- a/plugins/channeltx/modpsk31/psk31modtxsettingsdialog.ui +++ b/plugins/channeltx/modpsk31/psk31modtxsettingsdialog.ui @@ -29,10 +29,10 @@ - Prefix text with carriage returns, line feed and switch to letters + Prefix text with carriage returns and line feed - Prefix CR+CR+LF+LTRS + Prefix CR+CR+LF diff --git a/plugins/channeltx/modpsk31/readme.md b/plugins/channeltx/modpsk31/readme.md index cf7e44e66..31fa1eecb 100644 --- a/plugins/channeltx/modpsk31/readme.md +++ b/plugins/channeltx/modpsk31/readme.md @@ -63,6 +63,8 @@ Enter text to transmit. Pressing return will transmit the text and clear this fi The list of pre-defined text can be customised via the Transmit Settings dialog (13). +PSK31 supports the extended ASCII character set. +

13: TX

Press to transmit the current text. The text field will not be cleared.