- use Xs and Xds instead of X and Xd. Controll using alpha_s

git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@470 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2019-05-25 14:28:47 +00:00
parent bedd7b0f00
commit 84fc4d92fd
+10 -10
View File
@@ -212,7 +212,7 @@ namespace gr {
// Create peak list
// -----------------------------------------------------------------
// Find peak candidates by thresholding
threshold(m_pPeakData, m_pXd, nitems_per_block, m_peak_height_min);
threshold(m_pPeakData, m_pXds, nitems_per_block, m_peak_height_min);
int numPeaks = findPeakPos(m_pPeakPos, m_pPeakData, nitems_per_block);
// -----------------------------------------------------------------
@@ -227,16 +227,16 @@ namespace gr {
int pos = m_pPeakPos[i];
while(1)
{
float y0 = m_pX[pos];
float y0 = m_pXs[pos];
int pos_p = std::min(nitems_per_block-1, pos+1);
int pos_n = std::max(0, pos-1);
if (m_pX[pos_p] > y0)
if (m_pXs[pos_p] > y0)
{
m_pPeakData[pos] = 0;
m_pPeakData[pos_n] = 0;
pos = pos_p;
}
else if (m_pX[pos_n] > y0)
else if (m_pXs[pos_n] > y0)
{
m_pPeakData[pos] = 0;
m_pPeakData[pos_p] = 0;
@@ -262,7 +262,7 @@ namespace gr {
// -----------------------------------------------------------------
// Sort peaks
// -----------------------------------------------------------------
sort<float>(m_pXd, m_pPeakPos, numPeaks);
sort<float>(m_pXds, m_pPeakPos, numPeaks);
// -----------------------------------------------------------------
// Find peak boxes
@@ -280,7 +280,7 @@ namespace gr {
while(!(left_found & right_found))
{
// Determine peak width left from center (pos)
if (m_pXd[left] > nom)
if (m_pXds[left] > nom)
{
if (left > 0)
{
@@ -297,7 +297,7 @@ namespace gr {
}
// Determine peak width right from center (pos)
if (m_pXd[right] > nom)
if (m_pXds[right] > nom)
{
if (right < (nitems_per_block-1))
{
@@ -339,8 +339,8 @@ namespace gr {
.id = m_peak_id,
.pos = (float)pos,
.half_width = (float)pbh,
.height_rel = m_pXd[pos],
.height_abs = m_pX[pos],
.height_rel = m_pXds[pos],
.height_abs = m_pXs[pos],
.isConfirmed = true,
};
@@ -423,7 +423,7 @@ namespace gr {
// -----------------------------------------------------------------
for (int i = 0; i < nitems_per_block; i++)
{
*(optr_data++) = m_pX[i];
*(optr_data++) = m_pXs[i];
*(optr_pbox++) = m_pPeakBox_abs[i];
}