# SNR estimator block output problem

**URL:** <https://www.ruby-forum.com/t/snr-estimator-block-output-problem/239859>\
**Category:** GNU Radio\
**Created:** [March 17, 2014, 6:37pm UTC](https://www.ruby-forum.com/t/snr-estimator-block-output-problem/239859 "2014-03-17T18:37:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [March 17, 2014, 6:37pm UTC](https://www.ruby-forum.com/t/snr-estimator-block-output-problem/239859/1 "2014-03-17T18:37:29Z")

</div>

Hi all,  
I try to create a new block able to generate integer values depending on  
the  
output values giving by the SNR estimator block (already available in  
Gnuradio library). Normally the estimator black should give the SNR in  
dB so  
a float value, but in the C++ file the output is defined as double  
(complex). Moreover, the program code contains this line:  
_double x = abs(input[i+1])_  
So, I want to understand why x is double and it is not a float? Any help  
will be appreciate.  
Thanks

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/SNR-estimator-block-output-problem-tp47023.html](http://gnuradio.4.n7.nabble.com/SNR-estimator-block-output-problem-tp47023.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![zielalaoui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/439d5e/32.png) [@zielalaoui](https://www.ruby-forum.com/u/zielalaoui)\
**Post date:** [March 25, 2014, 10:52pm UTC](https://www.ruby-forum.com/t/snr-estimator-block-output-problem/239859/2 "2014-03-25T22:52:59Z")

</div>

On Mon, Mar 17, 2014 at 10:36 AM, zielalaoui [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi all,  
> I try to create a new block able to generate integer values depending on the  
> output values giving by the SNR estimator block (already available in  
> Gnuradio library). Normally the estimator black should give the SNR in dB so  
> a float value, but in the C++ file the output is defined as double  
> (complex). Moreover, the program code contains this line:  
> _double x = abs(input[i+1])_  
> So, I want to understand why x is double and it is not a float? Any help  
> will be appreciate.  
> Thanks

The running averager used internally is pretty sensitive to the  
precision, so we calculate it internally as double precision. You can  
cast the result down to a float if you want.

Honestly, we could probably get away with using floats here  
considering how rough any real SNR estimate is, anyways.

Tom
