- peak detect: update of peaks without smooting
- send message of existent peak changes (frequency, pos) - peak manager: added freq message output for channelizer git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@493 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -149,18 +149,23 @@ namespace jay {
|
||||
return pbh > 0;
|
||||
}
|
||||
|
||||
const Peak& merge(const Peak &other)
|
||||
bool update(const Peak &other)
|
||||
{
|
||||
float beta = 0.5f;
|
||||
float alpha = (1.f-beta);
|
||||
float pos_f = alpha*(float)pos + beta*(float)other.pos;
|
||||
float pbh_f = alpha*(float)pbh + beta*(float)other.pbh;
|
||||
float frequency = alpha*(float)frequency + beta*(float)other.frequency;
|
||||
pos = (int)(pos_f + 0.5f);
|
||||
pbh = (int)(pbh_f + 0.5f);
|
||||
bool changed = false;
|
||||
if (pos != other.pos)
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
if (std::abs(frequency-other.frequency) >= (0.01*1e6))
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
frequency = other.frequency;
|
||||
pos = other.pos;
|
||||
pbh = other.pbh;
|
||||
height_rel = other.height_rel;
|
||||
height_abs = other.height_abs;
|
||||
return *this;
|
||||
return changed;
|
||||
}
|
||||
|
||||
int left() const
|
||||
|
||||
Reference in New Issue
Block a user