Skip to content

Commit

Permalink
A little bit more efficient pwr calc in SigLevDetDdr
Browse files Browse the repository at this point in the history
  • Loading branch information
sm0svx committed May 13, 2015
1 parent 55884d5 commit 470570d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/svxlink/trx/SigLevDetDdr.cpp
Expand Up @@ -218,8 +218,7 @@ void SigLevDetDdr::processSamples(const vector<RtlTcp::Sample> &samples)
it != samples.end();
++it)
{
double mag = abs(*it);
pwr_sum += mag * mag;
pwr_sum += it->real() * it->real() + it->imag() * it->imag();
if (++block_idx == block_size)
{
last_siglev = offset + slope * 10.0 * log10(pwr_sum / block_size);
Expand Down

0 comments on commit 470570d

Please sign in to comment.