diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index 6accb07ca..495779951 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -134,7 +134,8 @@ void NFMMod::modulateSample() pullAF(t); calculateLevel(t); - m_modPhasor += (m_running.m_fmDeviation / (float) m_running.m_audioSampleRate) * m_bandpass.filter(t) * (M_PI / 1208.0f); + // 378 = 302 * 1.25; 302 = number of filter taps (established experimentally) + m_modPhasor += (m_running.m_fmDeviation / (float) m_running.m_audioSampleRate) * m_bandpass.filter(t) * (M_PI / 378.0f); m_modSample.real(cos(m_modPhasor) * 32678.0f); m_modSample.imag(sin(m_modPhasor) * 32678.0f); } diff --git a/plugins/channeltx/modnfm/nfmmodgui.ui b/plugins/channeltx/modnfm/nfmmodgui.ui index 0f83e2df1..2ebc97999 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.ui +++ b/plugins/channeltx/modnfm/nfmmodgui.ui @@ -345,7 +345,7 @@ - Audio input volume + Audio input gain 100 @@ -367,7 +367,7 @@ - Audio input volume level + Audio input gain value @@ -388,6 +388,9 @@ 0 + + Volume meter. White line is 100% and shoul not be exceeded (red zone) + diff --git a/sdrbase/gui/levelmeter.cpp b/sdrbase/gui/levelmeter.cpp index 245afb48e..5784033f6 100644 --- a/sdrbase/gui/levelmeter.cpp +++ b/sdrbase/gui/levelmeter.cpp @@ -3,6 +3,7 @@ * Modifications made to: * - use the widget horizontally * - differentiate each area with a different color + * - allow overload by 25% with indication of 100% threshold and overload ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ @@ -130,45 +131,31 @@ void LevelMeter::paintEvent(QPaintEvent *event) QPainter painter(this); painter.fillRect(rect(), Qt::black); + // red zone on top half + QRect barTop = rect(); + barTop.setBottom(0.5 * rect().height()); + barTop.setLeft(0.75* rect().width()); + painter.fillRect(barTop, Qt::red); + QRect bar = rect(); - // old + // 100% full height white line + bar.setLeft(0.75* rect().width() - 2); + bar.setRight(0.75* rect().width()); + painter.fillRect(bar, Qt::white); -// bar.setTop(rect().top() + (1.0 - m_peakHoldLevel) * rect().height()); -// bar.setBottom(bar.top() + 5); -// painter.fillRect(bar, m_rmsColor); -// bar.setBottom(rect().bottom()); -// -// bar.setTop(rect().top() + (1.0 - m_decayedPeakLevel) * rect().height()); -// painter.fillRect(bar, m_peakColor); -// -// bar.setTop(rect().top() + (1.0 - m_rmsLevel) * rect().height()); -// painter.fillRect(bar, m_rmsColor); + // Bottom moving gauge - // old v.2 + bar.setTop(0.5 * rect().height()); -// bar.setTop(rect().top() + (1.0 - m_peakHoldLevel) * rect().height()); -// bar.setBottom(bar.top() + 5); -// painter.fillRect(bar, m_peakColor); -// bar.setBottom(rect().bottom()); -// -// bar.setTop(rect().top() + (1.0 - m_decayedPeakLevel) * rect().height()); -// painter.fillRect(bar, m_decayedPeakColor); -// -// bar.setTop(rect().top() + (1.0 - m_rmsLevel) * rect().height()); -// painter.fillRect(bar, m_rmsColor); - - // new - - bar.setRight(rect().right() - (1.0 - m_peakHoldLevel) * rect().width()); + bar.setRight(rect().right() - (1.0 - 0.75*m_peakHoldLevel) * rect().width()); bar.setLeft(bar.right() - 5); painter.fillRect(bar, m_peakColor); bar.setLeft(rect().left()); - bar.setRight(rect().right() - (1.0 - m_decayedPeakLevel) * rect().width()); + bar.setRight(rect().right() - (1.0 - 0.75*m_decayedPeakLevel) * rect().width()); painter.fillRect(bar, m_decayedPeakColor); - bar.setRight(rect().right() - (1.0 - m_rmsLevel) * rect().width()); + bar.setRight(rect().right() - (1.0 - 0.75*m_rmsLevel) * rect().width()); painter.fillRect(bar, m_rmsColor); - } diff --git a/sdrbase/gui/levelmeter.h b/sdrbase/gui/levelmeter.h index d154dfa9c..619ad74dc 100644 --- a/sdrbase/gui/levelmeter.h +++ b/sdrbase/gui/levelmeter.h @@ -3,6 +3,7 @@ * Modifications made to: * - use the widget horizontally * - differentiate each area with a different color + * - allow overload by 25% with indication of 100% threshold and overload ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/