- fixed peaks heights and merge()
git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@476 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -226,7 +226,7 @@ namespace gr {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Peak peak(m_peak_id++, pos);
|
Peak peak(m_peak_id++, pos);
|
||||||
peak.heightUpdate_rel(m_pXds, nitems_per_block);
|
peak.height_rel = m_pXds[pos];
|
||||||
addToListByPos(peaks, peak);
|
addToListByPos(peaks, peak);
|
||||||
numPeaksClimbed++;
|
numPeaksClimbed++;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -149,12 +149,14 @@ namespace jay {
|
|||||||
|
|
||||||
const Peak& merge(const Peak &other)
|
const Peak& merge(const Peak &other)
|
||||||
{
|
{
|
||||||
float beta = 0.1f;
|
float beta = 0.5f;
|
||||||
float alpha = (1.f-beta);
|
float alpha = (1.f-beta);
|
||||||
pos = alpha*pos + beta*other.pos;
|
float pos_f = alpha*(float)pos + beta*(float)other.pos;
|
||||||
pbh = alpha*pbh + beta*other.pbh;
|
float pbh_f = alpha*(float)pbh + beta*(float)other.pbh;
|
||||||
height_rel = std::max(height_rel, other.height_rel);
|
pos = (int)(pos_f + 0.5f);
|
||||||
height_abs = std::max(height_abs, other.height_abs);
|
pbh = (int)(pbh_f + 0.5f);
|
||||||
|
height_rel = other.height_rel;
|
||||||
|
height_abs = other.height_abs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user