mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-27 07:16:48 -04:00
ATV Modulator: implemented FM excursion adjustment
This commit is contained in:
parent
7e70b7f6c6
commit
0ea39c217c
@ -113,7 +113,8 @@ void ATVMod::configure(MessageQueue* messageQueue,
|
|||||||
bool cameraPlay,
|
bool cameraPlay,
|
||||||
bool channelMute,
|
bool channelMute,
|
||||||
bool invertedVideo,
|
bool invertedVideo,
|
||||||
float rfScaling)
|
float rfScaling,
|
||||||
|
float fmExcursion)
|
||||||
{
|
{
|
||||||
Message* cmd = MsgConfigureATVMod::create(
|
Message* cmd = MsgConfigureATVMod::create(
|
||||||
rfBandwidth,
|
rfBandwidth,
|
||||||
@ -129,7 +130,8 @@ void ATVMod::configure(MessageQueue* messageQueue,
|
|||||||
cameraPlay,
|
cameraPlay,
|
||||||
channelMute,
|
channelMute,
|
||||||
invertedVideo,
|
invertedVideo,
|
||||||
rfScaling);
|
rfScaling,
|
||||||
|
fmExcursion);
|
||||||
messageQueue->push(cmd);
|
messageQueue->push(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +207,7 @@ void ATVMod::modulateSample()
|
|||||||
switch (m_running.m_atvModulation)
|
switch (m_running.m_atvModulation)
|
||||||
{
|
{
|
||||||
case ATVModulationFM: // FM half bandwidth deviation
|
case ATVModulationFM: // FM half bandwidth deviation
|
||||||
m_modPhasor += (t - 0.5f) * M_PI;
|
m_modPhasor += (t - 0.5f) * m_running.m_fmExcursion * 2.0f * M_PI;
|
||||||
if (m_modPhasor > 2.0f * M_PI) m_modPhasor -= 2.0f * M_PI; // limit growth
|
if (m_modPhasor > 2.0f * M_PI) m_modPhasor -= 2.0f * M_PI; // limit growth
|
||||||
if (m_modPhasor < 2.0f * M_PI) m_modPhasor += 2.0f * M_PI; // limit growth
|
if (m_modPhasor < 2.0f * M_PI) m_modPhasor += 2.0f * M_PI; // limit growth
|
||||||
m_modSample.real(cos(m_modPhasor) * m_running.m_rfScalingFactor); // -1 dB
|
m_modSample.real(cos(m_modPhasor) * m_running.m_rfScalingFactor); // -1 dB
|
||||||
@ -538,6 +540,7 @@ bool ATVMod::handleMessage(const Message& cmd)
|
|||||||
m_config.m_channelMute = cfg.getChannelMute();
|
m_config.m_channelMute = cfg.getChannelMute();
|
||||||
m_config.m_invertedVideo = cfg.getInvertedVideo();
|
m_config.m_invertedVideo = cfg.getInvertedVideo();
|
||||||
m_config.m_rfScalingFactor = cfg.getRFScaling();
|
m_config.m_rfScalingFactor = cfg.getRFScaling();
|
||||||
|
m_config.m_fmExcursion = cfg.getFMExcursion();
|
||||||
|
|
||||||
apply();
|
apply();
|
||||||
|
|
||||||
@ -555,7 +558,8 @@ bool ATVMod::handleMessage(const Message& cmd)
|
|||||||
<< " m_cameraPlay: " << m_config.m_cameraPlay
|
<< " m_cameraPlay: " << m_config.m_cameraPlay
|
||||||
<< " m_channelMute: " << m_config.m_channelMute
|
<< " m_channelMute: " << m_config.m_channelMute
|
||||||
<< " m_invertedVideo: " << m_config.m_invertedVideo
|
<< " m_invertedVideo: " << m_config.m_invertedVideo
|
||||||
<< " m_rfScalingFactor: " << m_config.m_rfScalingFactor;
|
<< " m_rfScalingFactor: " << m_config.m_rfScalingFactor
|
||||||
|
<< " m_fmExcursion: " << m_config.m_fmExcursion;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -730,6 +734,7 @@ void ATVMod::apply(bool force)
|
|||||||
m_running.m_channelMute = m_config.m_channelMute;
|
m_running.m_channelMute = m_config.m_channelMute;
|
||||||
m_running.m_invertedVideo = m_config.m_invertedVideo;
|
m_running.m_invertedVideo = m_config.m_invertedVideo;
|
||||||
m_running.m_rfScalingFactor = m_config.m_rfScalingFactor;
|
m_running.m_rfScalingFactor = m_config.m_rfScalingFactor;
|
||||||
|
m_running.m_fmExcursion = m_config.m_fmExcursion;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ATVMod::getBaseValues(int linesPerSecond, int& sampleRateUnits, int& nbPointsPerRateUnit)
|
void ATVMod::getBaseValues(int linesPerSecond, int& sampleRateUnits, int& nbPointsPerRateUnit)
|
||||||
|
@ -343,7 +343,8 @@ public:
|
|||||||
bool cameraPLay,
|
bool cameraPLay,
|
||||||
bool channelMute,
|
bool channelMute,
|
||||||
bool invertedVideo,
|
bool invertedVideo,
|
||||||
float rfScaling);
|
float rfScaling,
|
||||||
|
float fmExcursion);
|
||||||
|
|
||||||
virtual void pull(Sample& sample);
|
virtual void pull(Sample& sample);
|
||||||
virtual void pullAudio(int nbSamples); // this is used for video signal actually
|
virtual void pullAudio(int nbSamples); // this is used for video signal actually
|
||||||
@ -387,6 +388,7 @@ private:
|
|||||||
bool getChannelMute() const { return m_channelMute; }
|
bool getChannelMute() const { return m_channelMute; }
|
||||||
bool getInvertedVideo() const { return m_invertedVideo; }
|
bool getInvertedVideo() const { return m_invertedVideo; }
|
||||||
float getRFScaling() const { return m_rfScaling; }
|
float getRFScaling() const { return m_rfScaling; }
|
||||||
|
float getFMExcursion() const { return m_fmExcursion; }
|
||||||
|
|
||||||
static MsgConfigureATVMod* create(
|
static MsgConfigureATVMod* create(
|
||||||
Real rfBandwidth,
|
Real rfBandwidth,
|
||||||
@ -402,7 +404,8 @@ private:
|
|||||||
bool cameraPlay,
|
bool cameraPlay,
|
||||||
bool channelMute,
|
bool channelMute,
|
||||||
bool invertedVideo,
|
bool invertedVideo,
|
||||||
float rfScaling)
|
float rfScaling,
|
||||||
|
float fmExcursion)
|
||||||
{
|
{
|
||||||
return new MsgConfigureATVMod(
|
return new MsgConfigureATVMod(
|
||||||
rfBandwidth,
|
rfBandwidth,
|
||||||
@ -418,7 +421,8 @@ private:
|
|||||||
cameraPlay,
|
cameraPlay,
|
||||||
channelMute,
|
channelMute,
|
||||||
invertedVideo,
|
invertedVideo,
|
||||||
rfScaling);
|
rfScaling,
|
||||||
|
fmExcursion);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -436,6 +440,7 @@ private:
|
|||||||
bool m_channelMute;
|
bool m_channelMute;
|
||||||
bool m_invertedVideo;
|
bool m_invertedVideo;
|
||||||
float m_rfScaling;
|
float m_rfScaling;
|
||||||
|
float m_fmExcursion;
|
||||||
|
|
||||||
MsgConfigureATVMod(
|
MsgConfigureATVMod(
|
||||||
Real rfBandwidth,
|
Real rfBandwidth,
|
||||||
@ -451,7 +456,8 @@ private:
|
|||||||
bool cameraPlay,
|
bool cameraPlay,
|
||||||
bool channelMute,
|
bool channelMute,
|
||||||
bool invertedVideo,
|
bool invertedVideo,
|
||||||
float rfScaling) :
|
float rfScaling,
|
||||||
|
float fmExcursion) :
|
||||||
Message(),
|
Message(),
|
||||||
m_rfBandwidth(rfBandwidth),
|
m_rfBandwidth(rfBandwidth),
|
||||||
m_rfOppBandwidth(rfOppBandwidth),
|
m_rfOppBandwidth(rfOppBandwidth),
|
||||||
@ -466,7 +472,8 @@ private:
|
|||||||
m_cameraPlay(cameraPlay),
|
m_cameraPlay(cameraPlay),
|
||||||
m_channelMute(channelMute),
|
m_channelMute(channelMute),
|
||||||
m_invertedVideo(invertedVideo),
|
m_invertedVideo(invertedVideo),
|
||||||
m_rfScaling(rfScaling)
|
m_rfScaling(rfScaling),
|
||||||
|
m_fmExcursion(fmExcursion)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -516,6 +523,7 @@ private:
|
|||||||
bool m_channelMute; //!< Mute channel baseband output
|
bool m_channelMute; //!< Mute channel baseband output
|
||||||
bool m_invertedVideo; //!< True if video signal is inverted before modulation
|
bool m_invertedVideo; //!< True if video signal is inverted before modulation
|
||||||
float m_rfScalingFactor; //!< Scaling factor from +/-1 to +/-2^15
|
float m_rfScalingFactor; //!< Scaling factor from +/-1 to +/-2^15
|
||||||
|
float m_fmExcursion; //!< FM excursion factor relative to full bandwidth
|
||||||
|
|
||||||
Config() :
|
Config() :
|
||||||
m_outputSampleRate(-1),
|
m_outputSampleRate(-1),
|
||||||
@ -533,7 +541,8 @@ private:
|
|||||||
m_cameraPlay(false),
|
m_cameraPlay(false),
|
||||||
m_channelMute(false),
|
m_channelMute(false),
|
||||||
m_invertedVideo(false),
|
m_invertedVideo(false),
|
||||||
m_rfScalingFactor(29204.0f) // -1dB
|
m_rfScalingFactor(29204.0f), // -1dB
|
||||||
|
m_fmExcursion(0.5f) // half bandwidth
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -101,6 +101,7 @@ QByteArray ATVModGUI::serialize() const
|
|||||||
s.writeS32(10, ui->nbLines->currentIndex());
|
s.writeS32(10, ui->nbLines->currentIndex());
|
||||||
s.writeS32(11, ui->fps->currentIndex());
|
s.writeS32(11, ui->fps->currentIndex());
|
||||||
s.writeS32(12, ui->rfScaling->value());
|
s.writeS32(12, ui->rfScaling->value());
|
||||||
|
s.writeS32(13, ui->fmExcursion->value());
|
||||||
|
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
@ -153,6 +154,8 @@ bool ATVModGUI::deserialize(const QByteArray& data)
|
|||||||
ui->fps->setCurrentIndex(tmp);
|
ui->fps->setCurrentIndex(tmp);
|
||||||
d.readS32(12, &tmp, 80);
|
d.readS32(12, &tmp, 80);
|
||||||
ui->rfScaling->setValue(tmp);
|
ui->rfScaling->setValue(tmp);
|
||||||
|
d.readS32(13, &tmp, 50);
|
||||||
|
ui->fmExcursion->setValue(tmp);
|
||||||
|
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
m_channelMarker.blockSignals(false);
|
m_channelMarker.blockSignals(false);
|
||||||
@ -342,6 +345,12 @@ void ATVModGUI::on_rfScaling_valueChanged(int value)
|
|||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ATVModGUI::on_fmExcursion_valueChanged(int value)
|
||||||
|
{
|
||||||
|
ui->fmExcursionText->setText(tr("%1").arg(value));
|
||||||
|
applySettings();
|
||||||
|
}
|
||||||
|
|
||||||
void ATVModGUI::on_rfBW_valueChanged(int value)
|
void ATVModGUI::on_rfBW_valueChanged(int value)
|
||||||
{
|
{
|
||||||
ui->rfBWText->setText(QString("%1k").arg((value*m_rfSliderDivisor) / 1000.0, 0, 'f', 0));
|
ui->rfBWText->setText(QString("%1k").arg((value*m_rfSliderDivisor) / 1000.0, 0, 'f', 0));
|
||||||
@ -578,6 +587,9 @@ ATVModGUI::ATVModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pa
|
|||||||
for (std::vector<int>::iterator it = cameraNumbers.begin(); it != cameraNumbers.end(); ++it) {
|
for (std::vector<int>::iterator it = cameraNumbers.begin(); it != cameraNumbers.end(); ++it) {
|
||||||
ui->camSelect->addItem(tr("%1").arg(*it));
|
ui->camSelect->addItem(tr("%1").arg(*it));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QChar delta = QChar(0x94, 0x03);
|
||||||
|
ui->fmExcursionLabel->setText(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
ATVModGUI::~ATVModGUI()
|
ATVModGUI::~ATVModGUI()
|
||||||
@ -623,7 +635,8 @@ void ATVModGUI::applySettings()
|
|||||||
ui->playCamera->isChecked(),
|
ui->playCamera->isChecked(),
|
||||||
ui->channelMute->isChecked(),
|
ui->channelMute->isChecked(),
|
||||||
ui->invertVideo->isChecked(),
|
ui->invertVideo->isChecked(),
|
||||||
ui->rfScaling->value() * 327.68f);
|
ui->rfScaling->value() * 327.68f,
|
||||||
|
ui->fmExcursion->value() / 100.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ private slots:
|
|||||||
void on_channelMute_toggled(bool checked);
|
void on_channelMute_toggled(bool checked);
|
||||||
void on_modulation_currentIndexChanged(int index);
|
void on_modulation_currentIndexChanged(int index);
|
||||||
void on_rfScaling_valueChanged(int value);
|
void on_rfScaling_valueChanged(int value);
|
||||||
|
void on_fmExcursion_valueChanged(int value);
|
||||||
void on_rfBW_valueChanged(int value);
|
void on_rfBW_valueChanged(int value);
|
||||||
void on_rfOppBW_valueChanged(int value);
|
void on_rfOppBW_valueChanged(int value);
|
||||||
void on_nbLines_currentIndexChanged(int index);
|
void on_nbLines_currentIndexChanged(int index);
|
||||||
|
@ -250,6 +250,64 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="fmExcursionLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>D</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDial" name="fmExcursion">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>24</width>
|
||||||
|
<height>24</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>FM excursion in % of total bandwidth</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="pageStep">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>50</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="fmExcursionText">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>FM deviation percentage of total bandwidth</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>50</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line_10">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="rfBWLabel">
|
<widget class="QLabel" name="rfBWLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
Loading…
Reference in New Issue
Block a user