mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 15:04:11 +00:00
Calculate additional parameters (R/L/C,...) for markers and traces
This commit is contained in:
parent
a232be3443
commit
e27e594435
18 changed files with 168 additions and 164 deletions
|
|
@ -5,7 +5,7 @@
|
|||
#include <QScrollBar>
|
||||
#include <QSettings>
|
||||
#include <functional>
|
||||
#include "unit.h"
|
||||
#include "Util/util.h"
|
||||
#include "Marker/marker.h"
|
||||
|
||||
using namespace std;
|
||||
|
|
@ -871,7 +871,7 @@ std::vector<double> Trace::findPeakFrequencies(unsigned int maxPeaks, double min
|
|||
double max_dbm = -200.0;
|
||||
double min_dbm = 200.0;
|
||||
for(auto d : lastMath->rData()) {
|
||||
double dbm = Unit::dB(d.y);
|
||||
double dbm = Util::SparamTodB(d.y);
|
||||
if((dbm >= max_dbm) && (min_dbm <= dbm - minValley)) {
|
||||
// potential peak frequency
|
||||
frequency = d.x;
|
||||
|
|
@ -945,7 +945,7 @@ double Trace::getNoise(double frequency)
|
|||
return std::numeric_limits<double>::quiet_NaN();
|
||||
}
|
||||
// convert to dbm
|
||||
auto dbm = Unit::dB(lastMath->getInterpolatedSample(frequency).y);
|
||||
auto dbm = Util::SparamTodB(lastMath->getInterpolatedSample(frequency).y);
|
||||
// convert to 1Hz bandwidth
|
||||
dbm -= 10*log10(settings.SA.RBW);
|
||||
return dbm;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue