kopia lustrzana https://github.com/f4exb/sdrangel
Scope: Added derivative of magnitude squared to the list of projections
rodzic
b93f9459c9
commit
3b969ac058
|
@ -60,6 +60,15 @@ Real Projector::run(const Sample& s)
|
||||||
v = re*re + im*im;
|
v = re*re + im*im;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ProjectionDMagSq:
|
||||||
|
{
|
||||||
|
Real re = s.m_real / SDR_RX_SCALEF;
|
||||||
|
Real im = s.m_imag / SDR_RX_SCALEF;
|
||||||
|
Real curMagSq = re*re + im*im;
|
||||||
|
v = curMagSq - m_prevVal;
|
||||||
|
m_prevVal = curMagSq;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case ProjectionMagDB:
|
case ProjectionMagDB:
|
||||||
{
|
{
|
||||||
Real re = s.m_real / SDR_RX_SCALEF;
|
Real re = s.m_real / SDR_RX_SCALEF;
|
||||||
|
@ -235,6 +244,13 @@ Real Projector::run(const std::complex<float>& s)
|
||||||
case ProjectionMagSq:
|
case ProjectionMagSq:
|
||||||
v = std::norm(s);
|
v = std::norm(s);
|
||||||
break;
|
break;
|
||||||
|
case ProjectionDMagSq:
|
||||||
|
{
|
||||||
|
Real curMagSq = std::norm(s);
|
||||||
|
v = curMagSq - m_prevVal;
|
||||||
|
m_prevVal = curMagSq;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case ProjectionMagDB:
|
case ProjectionMagDB:
|
||||||
{
|
{
|
||||||
Real magsq = std::norm(s);
|
Real magsq = std::norm(s);
|
||||||
|
|
|
@ -33,6 +33,7 @@ public:
|
||||||
ProjectionImag, //!< Extract imaginary part
|
ProjectionImag, //!< Extract imaginary part
|
||||||
ProjectionMagLin, //!< Calculate linear magnitude or modulus
|
ProjectionMagLin, //!< Calculate linear magnitude or modulus
|
||||||
ProjectionMagSq, //!< Calculate linear squared magnitude or power
|
ProjectionMagSq, //!< Calculate linear squared magnitude or power
|
||||||
|
ProjectionDMagSq, //!< Calculate time derivative of linear squared magnitude or power
|
||||||
ProjectionMagDB, //!< Calculate logarithmic (dB) of squared magnitude
|
ProjectionMagDB, //!< Calculate logarithmic (dB) of squared magnitude
|
||||||
ProjectionPhase, //!< Calculate phase
|
ProjectionPhase, //!< Calculate phase
|
||||||
ProjectionDOAP, //!< Calculate ambiguous DOA from phase as phase difference (assuming positive)
|
ProjectionDOAP, //!< Calculate ambiguous DOA from phase as phase difference (assuming positive)
|
||||||
|
@ -60,6 +61,7 @@ private:
|
||||||
static Real normalizeAngle(Real angle);
|
static Real normalizeAngle(Real angle);
|
||||||
ProjectionType m_projectionType;
|
ProjectionType m_projectionType;
|
||||||
Real m_prevArg;
|
Real m_prevArg;
|
||||||
|
Real m_prevVal;
|
||||||
Real *m_cache;
|
Real *m_cache;
|
||||||
bool m_cacheMaster;
|
bool m_cacheMaster;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1893,6 +1893,7 @@ void GLScope::setYScale(ScaleEngine &scale, uint32_t highlightedTraceIndex)
|
||||||
break;
|
break;
|
||||||
case Projector::ProjectionMagLin:
|
case Projector::ProjectionMagLin:
|
||||||
case Projector::ProjectionMagSq:
|
case Projector::ProjectionMagSq:
|
||||||
|
case Projector::ProjectionDMagSq:
|
||||||
if (amp_range < 1e-9) {
|
if (amp_range < 1e-9) {
|
||||||
scale.setRange(Unit::None, amp_ofs * 1e12, amp_range * 1e12 + amp_ofs * 1e12);
|
scale.setRange(Unit::None, amp_ofs * 1e12, amp_range * 1e12 + amp_ofs * 1e12);
|
||||||
} else if (amp_range < 1e-6) {
|
} else if (amp_range < 1e-6) {
|
||||||
|
|
|
@ -1315,6 +1315,7 @@ void GLScopeGUI::fillProjectionCombo(QComboBox* comboBox)
|
||||||
comboBox->addItem("Imag", Projector::ProjectionImag);
|
comboBox->addItem("Imag", Projector::ProjectionImag);
|
||||||
comboBox->addItem("Mag", Projector::ProjectionMagLin);
|
comboBox->addItem("Mag", Projector::ProjectionMagLin);
|
||||||
comboBox->addItem("MagSq", Projector::ProjectionMagSq);
|
comboBox->addItem("MagSq", Projector::ProjectionMagSq);
|
||||||
|
comboBox->addItem("dMagSq", Projector::ProjectionDMagSq);
|
||||||
comboBox->addItem("MagdB", Projector::ProjectionMagDB);
|
comboBox->addItem("MagdB", Projector::ProjectionMagDB);
|
||||||
comboBox->addItem("Phi", Projector::ProjectionPhase);
|
comboBox->addItem("Phi", Projector::ProjectionPhase);
|
||||||
comboBox->addItem("DOAP", Projector::ProjectionDOAP);
|
comboBox->addItem("DOAP", Projector::ProjectionDOAP);
|
||||||
|
|
Ładowanie…
Reference in New Issue