mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-07 23:43:42 +00:00
new marker type: negative peak table
This commit is contained in:
parent
5ad44c780c
commit
0dbf362f57
4 changed files with 23 additions and 4 deletions
|
|
@ -1361,12 +1361,15 @@ double Trace::findExtremum(bool max, double xmin, double xmax)
|
|||
return freq;
|
||||
}
|
||||
|
||||
std::vector<double> Trace::findPeakFrequencies(unsigned int maxPeaks, double minLevel, double minValley, double xmin, double xmax)
|
||||
std::vector<double> Trace::findPeakFrequencies(unsigned int maxPeaks, double minLevel, double minValley, double xmin, double xmax, bool negativePeaks)
|
||||
{
|
||||
if(lastMath->getDataType() != DataType::Frequency) {
|
||||
// not in frequency domain
|
||||
return vector<double>();
|
||||
}
|
||||
if(negativePeaks) {
|
||||
minLevel = -minLevel;
|
||||
}
|
||||
using peakInfo = struct peakinfo {
|
||||
double frequency;
|
||||
double level_dbm;
|
||||
|
|
@ -1380,6 +1383,9 @@ std::vector<double> Trace::findPeakFrequencies(unsigned int maxPeaks, double min
|
|||
continue;
|
||||
}
|
||||
double dbm = Util::SparamTodB(d.y);
|
||||
if(negativePeaks) {
|
||||
dbm = -dbm;
|
||||
}
|
||||
if((dbm >= max_dbm) && (min_dbm <= dbm - minValley)) {
|
||||
// potential peak frequency
|
||||
frequency = d.x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue