- cleaned up from debug output

- fixed peak change mechanism

git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@506 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2019-05-29 14:12:42 +00:00
parent 4c255bf3ff
commit 2d656e14fc
5 changed files with 39 additions and 30 deletions
+16 -7
View File
@@ -48,7 +48,9 @@ namespace jay {
, pbh(_pbh)
, frequency(_frequency)
, height_rel(_height_rel)
, height_rel_last(_height_rel)
, height_abs(_height_abs)
, height_abs_last(_height_abs)
{
}
@@ -59,6 +61,8 @@ namespace jay {
int pbh;
float height_rel;
float height_abs;
float height_rel_last;
float height_abs_last;
float frequency;
bool isInRange(const Peak &other) const
@@ -92,10 +96,11 @@ namespace jay {
pos = newPos;
}
if (std::fabs(height_rel-newHeight) >= 3.0f)
height_rel = newHeight;
if (std::fabs(height_rel_last-newHeight) >= 1.0f)
{
isModified = true;
height_rel = newHeight;
height_rel_last = height_rel;
}
}
}
@@ -118,14 +123,16 @@ namespace jay {
if (pos != newPos)
{
isModified = true;
height_abs = newHeight;
pos = newPos;
}
if (std::fabs(height_abs-newHeight) >= 3.0f)
height_abs = newHeight;
if (std::fabs(height_abs_last-newHeight) >= 1.0f)
{
isModified = true;
height_rel = newHeight;
height_abs_last = height_abs;
}
}
}
@@ -194,12 +201,14 @@ namespace jay {
bool update(const Peak &other)
{
if (std::fabs(height_rel-other.height_rel) >= 3.0f)
if (std::fabs(height_rel_last-other.height_rel) >= 1.0f)
{
height_rel_last = other.height_rel;
isModified = true;
}
if (std::fabs(height_abs-other.height_abs) >= 3.0f)
if (std::fabs(height_abs-other.height_abs) >= 1.0f)
{
height_abs_last = other.height_abs;
isModified = true;
}
if (pos != other.pos)