ATV Modulator: implemented 405 lines standard and added display of channel sample rate

This commit is contained in:
f4exb 2017-03-20 03:35:27 +01:00
parent b677138b45
commit 63510968b5
9 changed files with 137 additions and 16 deletions

8
debian/changelog vendored
View File

@ -1,6 +1,12 @@
sdrangel (3.3.2-1) unstable; urgency=medium
* ATV plugins: 405 lines mode
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Thu, 16 Mar 2017 23:14:18 +0100
sdrangel (3.3.1-1) unstable; urgency=medium
* ATV modulator: SSB support
* ATV plugins: SSB and vestigiial sideband support
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Thu, 16 Mar 2017 23:14:18 +0100

View File

@ -33,6 +33,7 @@ MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureCameraIndex, Message)
MESSAGE_CLASS_DEFINITION(ATVMod::MsgReportCameraData, Message)
MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureOverlayText, Message)
MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureShowOverlayText, Message)
MESSAGE_CLASS_DEFINITION(ATVMod::MsgReportEffectiveSampleRate, Message)
const float ATVMod::m_blackLevel = 0.3f;
const float ATVMod::m_spanLevel = 0.7f;
@ -636,9 +637,10 @@ bool ATVMod::handleMessage(const Message& cmd)
void ATVMod::apply(bool force)
{
if ((m_config.m_outputSampleRate != m_running.m_outputSampleRate) ||
(m_config.m_atvStd != m_running.m_atvStd) ||
(m_config.m_rfBandwidth != m_running.m_rfBandwidth) || force)
if ((m_config.m_outputSampleRate != m_running.m_outputSampleRate)
|| (m_config.m_atvStd != m_running.m_atvStd)
|| (m_config.m_rfBandwidth != m_running.m_rfBandwidth)
|| (m_config.m_atvModulation != m_running.m_atvModulation) || force)
{
int rateUnits = getSampleRateUnits(m_config.m_atvStd);
m_tvSampleRate = (m_config.m_outputSampleRate / rateUnits) * rateUnits; // make sure working sample rate is a multiple of rate units
@ -649,7 +651,10 @@ void ATVMod::apply(bool force)
{
m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) m_tvSampleRate / (Real) m_config.m_outputSampleRate;
m_interpolator.create(48, m_tvSampleRate, m_config.m_rfBandwidth / 2.2, 3.0);
m_interpolator.create(48,
m_tvSampleRate,
m_config.m_rfBandwidth / getRFBandwidthDivisor(m_config.m_atvModulation),
3.0);
}
else
{
@ -662,6 +667,10 @@ void ATVMod::apply(bool force)
applyStandard(); // set all timings
m_settingsMutex.unlock();
MsgReportEffectiveSampleRate *report;
report = MsgReportEffectiveSampleRate::create(m_tvSampleRate);
getOutputMessageQueue()->push(report);
}
if ((m_config.m_outputSampleRate != m_running.m_outputSampleRate) ||
@ -705,12 +714,32 @@ int ATVMod::getSampleRateUnits(ATVStd std)
{
switch(std)
{
case ATVStd405:
return 729000; // 72 * 10125
break;
case ATVStdPAL525:
return 1008000;
return 1008000; // 64 * 15750
break;
case ATVStdPAL625:
default:
return 1000000; // Exact MS/s - us
return 1000000; // 64 * 15625 Exact MS/s - us
}
}
float ATVMod::getRFBandwidthDivisor(ATVModulation modulation)
{
switch(modulation)
{
case ATVModulationLSB:
case ATVModulationUSB:
case ATVModulationVestigialLSB:
case ATVModulationVestigialUSB:
return 1.1f;
break;
case ATVModulationAM:
case ATVModulationFM:
default:
return 2.2f;
}
}
@ -721,6 +750,27 @@ void ATVMod::applyStandard()
switch(m_config.m_atvStd)
{
case ATVStd405: // Follows loosely the 405 lines standard
m_pointsPerSync = (uint32_t) roundf(4.7f * m_pointsPerTU); // normal sync pulse (4.7/1.008 us)
m_pointsPerBP = (uint32_t) roundf(4.7f * m_pointsPerTU); // back porch (4.7/1.008 us)
m_pointsPerFP = (uint32_t) roundf(1.5f * m_pointsPerTU); // front porch (1.5/1.008 us)
m_pointsPerFSync = (uint32_t) roundf(2.3f * m_pointsPerTU); // equalizing pulse (2.3/1.008 us)
// what is left in a 72/0.729 us line for the image
m_pointsPerImgLine = 72 * m_pointsPerTU - m_pointsPerSync - m_pointsPerBP - m_pointsPerFP;
m_nbLines = 405;
m_nbLines2 = 203;
m_nbImageLines = 390;
m_nbImageLines2 = 195;
m_interlaced = true;
m_nbHorizPoints = 72 * m_pointsPerTU; // full line
m_nbSyncLinesHead = 5;
m_nbBlankLines = 7; // yields 376 lines (195 - 7) * 2
m_pointsPerHBar = m_pointsPerImgLine / m_nbBars;
m_linesPerVBar = m_nbImageLines2 / m_nbBars;
m_hBarIncrement = m_spanLevel / (float) m_nbBars;
m_vBarIncrement = m_spanLevel / (float) m_nbBars;
m_fps = 25.0f;
break;
case ATVStdPAL525: // Follows PAL-M standard
m_pointsPerSync = (uint32_t) roundf(4.7f * m_pointsPerTU); // normal sync pulse (4.7/1.008 us)
m_pointsPerBP = (uint32_t) roundf(4.7f * m_pointsPerTU); // back porch (4.7/1.008 us)

View File

@ -41,7 +41,8 @@ public:
typedef enum
{
ATVStdPAL625,
ATVStdPAL525
ATVStdPAL525,
ATVStd405
} ATVStd;
typedef enum
@ -303,6 +304,27 @@ public:
{ }
};
class MsgReportEffectiveSampleRate : public Message
{
MESSAGE_CLASS_DECLARATION
public:
int getSampleRate() const { return m_sampleRate; }
static MsgReportEffectiveSampleRate* create(int sampleRate)
{
return new MsgReportEffectiveSampleRate(sampleRate);
}
protected:
int m_sampleRate;
MsgReportEffectiveSampleRate(int sampleRate) :
Message(),
m_sampleRate(sampleRate)
{ }
};
ATVMod();
~ATVMod();
@ -330,6 +352,7 @@ public:
void getCameraNumbers(std::vector<int>& numbers);
static int getSampleRateUnits(ATVStd std);
static float getRFBandwidthDivisor(ATVModulation modulation);
signals:
/**

View File

@ -195,6 +195,14 @@ bool ATVModGUI::handleMessage(const Message& message)
return true;
}
else if (ATVMod::MsgReportEffectiveSampleRate::match(message))
{
int sampleRate = ((ATVMod::MsgReportEffectiveSampleRate&)message).getSampleRate();
ui->channelSampleRateText->setText(tr("%1k").arg(sampleRate/1000.0f, 0, 'f', 0));
//setRFFiltersSlidersRange(sampleRate);
return true;
}
else
{
return false;
@ -207,19 +215,24 @@ void ATVModGUI::viewChanged()
}
void ATVModGUI::channelizerOutputSampleRateChanged()
{
setRFFiltersSlidersRange(m_channelizer->getOutputSampleRate());
}
void ATVModGUI::setRFFiltersSlidersRange(int sampleRate)
{
if ((ui->modulation->currentIndex() == (int) ATVMod::ATVModulationLSB) ||
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationUSB) ||
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB) ||
(ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB))
{
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000);
ui->rfBW->setMaximum(sampleRate / 200000);
ui->rfOppBW->setMaximum(sampleRate / 200000);
}
else
{
ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000);
ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 100000);
ui->rfBW->setMaximum(sampleRate / 100000);
ui->rfOppBW->setMaximum(sampleRate / 100000);
}
}

View File

@ -119,6 +119,7 @@ private:
void applySettings();
void updateWithStreamData();
void updateWithStreamTime();
void setRFFiltersSlidersRange(int sampleRate);
void leaveEvent(QEvent*);
void enterEvent(QEvent*);

View File

@ -129,6 +129,29 @@
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="channelSampleRateText">
<property name="minimumSize">
<size>
<width>52</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00000k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@ -373,6 +396,11 @@
<string>PAL525L</string>
</property>
</item>
<item>
<property name="text">
<string>405L</string>
</property>
</item>
</widget>
</item>
<item>

View File

@ -23,7 +23,7 @@
const PluginDescriptor ATVModPlugin::m_pluginDescriptor = {
QString("ATV Modulator"),
QString("3.3.1"),
QString("3.3.2"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -84,7 +84,7 @@
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Version 3.3.1 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. &lt;/p&gt;&lt;p&gt;Code at &lt;a href=&quot;https://github.com/f4exb/sdrangel&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/f4exb/sdrangel&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Many thanks to the original developers:&lt;/p&gt;&lt;p&gt;The osmocom developer team - especially horizon, Hoernchen &amp;amp; tnt.&lt;/p&gt;&lt;p&gt;Christian Daniel from maintech GmbH.&lt;/p&gt;&lt;p&gt;John Greb (hexameron) for the contributions in &lt;a href=&quot;https://github.com/hexameron/rtl-sdrangelove&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;RTL-SDRangelove&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The following rules apply to the SDRangel main application and libsdrbase:&lt;br/&gt;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see &lt;a href=&quot;http://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.gnu.org/licenses/&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For the license of installed plugins, look into the plugin list.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Version 3.3.2 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. &lt;/p&gt;&lt;p&gt;Code at &lt;a href=&quot;https://github.com/f4exb/sdrangel&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/f4exb/sdrangel&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Many thanks to the original developers:&lt;/p&gt;&lt;p&gt;The osmocom developer team - especially horizon, Hoernchen &amp;amp; tnt.&lt;/p&gt;&lt;p&gt;Christian Daniel from maintech GmbH.&lt;/p&gt;&lt;p&gt;John Greb (hexameron) for the contributions in &lt;a href=&quot;https://github.com/hexameron/rtl-sdrangelove&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;RTL-SDRangelove&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The following rules apply to the SDRangel main application and libsdrbase:&lt;br/&gt;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see &lt;a href=&quot;http://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.gnu.org/licenses/&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For the license of installed plugins, look into the plugin list.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -453,9 +453,9 @@ void MainWindow::createStatusBar()
{
QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR);
#if QT_VERSION >= 0x050400
m_showSystemWidget = new QLabel("SDRangel v3.3.1 " + qtVersionStr + QSysInfo::prettyProductName(), this);
m_showSystemWidget = new QLabel("SDRangel v3.3.2 " + qtVersionStr + QSysInfo::prettyProductName(), this);
#else
m_showSystemWidget = new QLabel("SDRangel v3.3.1 " + qtVersionStr, this);
m_showSystemWidget = new QLabel("SDRangel v3.3.2 " + qtVersionStr, this);
#endif
statusBar()->addPermanentWidget(m_showSystemWidget);