# Writing RSSI Values to a File Twice/Sec

**URL:** <https://www.ruby-forum.com/t/writing-rssi-values-to-a-file-twice-sec/242564>\
**Category:** GNU Radio\
**Created:** [July 2, 2015, 5:09pm UTC](https://www.ruby-forum.com/t/writing-rssi-values-to-a-file-twice-sec/242564 "2015-07-02T17:09:33Z")\
**Posts on this page:** 7\
**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:** [July 2, 2015, 5:09pm UTC](https://www.ruby-forum.com/t/writing-rssi-values-to-a-file-twice-sec/242564/1 "2015-07-02T17:09:33Z")

</div>

Hi all,

I’m new to GNURadio and I’m trying to use a USRP E310 to capture GSM  
signals from a cellphone and store the RSSI values in a text file. If  
you take a look at my flow graph I’ve managed to capture the average  
strength across the 200kHz GSM band and I’m trying to filter out the  
unwanted signals using the Probe Avg Mag^2 block.

I’m having trouble writing to the file sink at a constant 2 samp/sec.  
Could you please give me advice on how I should fix my flow graph?

Thank you,

Varun

---

<div class="post-metadata">

**Author:** ![Varun\_Nambiar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/76d3ee/32.png) [@Varun\_Nambiar](https://www.ruby-forum.com/u/Varun_Nambiar)\
**Post date:** [July 2, 2015, 5:19pm UTC](https://www.ruby-forum.com/t/writing-rssi-values-to-a-file-twice-sec/242564/2 "2015-07-02T17:19:30Z")

</div>

On 07/02/2015 11:07 AM, Varun Nambiar wrote:

> Hi all,
> 
> I’m new to GNURadio and I’m trying to use a USRP E310 to capture GSM signals  
> from a cellphone and store the RSSI values in a text file. If you take a look at  
> my flow graph I’ve managed to capture the average strength across the 200kHz GSM  
> band and I’m trying to filter out the unwanted signals using the Probe Avg Mag^2  
> block.
> 
> I’m having trouble writing to the file sink at a constant 2 samp/sec. Could you  
> please give me advice on how I should fix my flow graph?

What kind of trouble? Can you also post the grc file so I can try it  
locally.

Also, which file system image are you using? The one from the card that  
came with the unit, or release-2?

Philip

---

<div class="post-metadata">

**Author:** ![Varun\_Nambiar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/76d3ee/32.png) [@Varun\_Nambiar](https://www.ruby-forum.com/u/Varun_Nambiar)\
**Post date:** [July 3, 2015, 12:39pm UTC](https://www.ruby-forum.com/t/writing-rssi-values-to-a-file-twice-sec/242564/3 "2015-07-03T12:39:50Z")

</div>

On 07/02/2015 11:25 AM, Varun Nambiar wrote:

> Hi Philip,
> 
> At the moment of execution a file size of 32KB with just 0s is written to my  
> file and then it doesn’t add anymore values after that. I am on release-2 and I’ve  
> attached my GRC file.

I dropped the throttle block and saw the output file get larger. Resend  
the flowgraph to the list and maybe someone else has some ideas how to  
make it better.

Philip

---

<div class="post-metadata">

**Author:** ![Varun\_Nambiar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/76d3ee/32.png) [@Varun\_Nambiar](https://www.ruby-forum.com/u/Varun_Nambiar)\
**Post date:** [July 3, 2015, 2:30pm UTC](https://www.ruby-forum.com/t/writing-rssi-values-to-a-file-twice-sec/242564/4 "2015-07-03T14:30:50Z")

</div>

Hi all,

Here’s the GRC file. Any help would be appreciated!

Thank you,  
Varun

* * *

From: Philip B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, July 2, 2015 1:35 PM  
To: Varun Nambiar; GNURadio D.ion List  
Subject: Re: [Discuss-gnuradio] Writing RSSI Values to a File Twice/Sec

On 07/02/2015 11:25 AM, Varun Nambiar wrote:

> Hi Philip,
> 
> At the moment of execution a file size of 32KB with just 0s is written to my  
> file and then it doesn’t add anymore values after that. I am on release-2 and I’ve  
> attached my GRC file.

I dropped the throttle block and saw the output file get larger. Resend  
the flowgraph to the list and maybe someone else has some ideas how to  
make it better.

Philip

---

<div class="post-metadata">

**Author:** ![Varun\_Nambiar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/76d3ee/32.png) [@Varun\_Nambiar](https://www.ruby-forum.com/u/Varun_Nambiar)\
**Post date:** [July 3, 2015, 3:00pm UTC](https://www.ruby-forum.com/t/writing-rssi-values-to-a-file-twice-sec/242564/5 "2015-07-03T15:00:37Z")

</div>

On 07/02/2015 03:26 PM, Varun Nambiar wrote:

> Hi all,
> 
> Here’s the GRC file. Any help would be appreciated!
> 
> Thank you,  
> Varun  
> Could you clarify whether you want RSSI estimates over the whole input  
> bandwidth, or for each discrete frequency bin?

This graph shows confusion in a number of areas, so, what is it you’re  
trying to do?

---

<div class="post-metadata">

**Author:** ![Varun\_Nambiar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/76d3ee/32.png) [@Varun\_Nambiar](https://www.ruby-forum.com/u/Varun_Nambiar)\
**Post date:** [July 3, 2015, 4:55pm UTC](https://www.ruby-forum.com/t/writing-rssi-values-to-a-file-twice-sec/242564/6 "2015-07-03T16:55:42Z")

</div>

Hey Marcus,

I’m getting the FFT over a 1 MHz bandwidth and I’m computing the average  
signal strength over a 125 kHz region of that 1 MHz region by  
integrating all the samples and dividing by the number of samples. I’m  
hoping to get an RSSI estimate over the input bandwidth. My issue is  
that I can’t write to the file at 2 samples/sec. When I execute the code  
in the attached GRC, at the moment of execution I get a 32 KB file with  
0s and it doesn’t output any samples to the file. When the throttle  
block is removed, the processor on the E310 writes to the file at the  
clock speed which leads to incredibly large files. Is there a way to cut  
it down to 2 samples/sec? Also the Avg Mag^2 block is there to probe for  
signals of strength greater than -70 dB.

Thanks,  
Varun

* * *

From: discuss-gnuradio-bounces+vnambiar=removed\_email\_address@domain.invalid  
[discuss-gnuradio-bounces+vnambiar=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+vnambiar=removed_email_address@domain.invalid) on behalf of Marcus  
D. Leech [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, July 2, 2015 3:56 PM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Discuss-gnuradio] Writing RSSI Values to a File Twice/Sec

On 07/02/2015 03:26 PM, Varun Nambiar wrote:

Hi all,

Here’s the GRC file. Any help would be appreciated!

Thank you,  
Varun

Could you clarify whether you want RSSI estimates over the whole input  
bandwidth, or for each discrete frequency bin?

This graph shows confusion in a number of areas, so, what is it you’re  
trying to do?

* * *

From: Philip B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, July 2, 2015 1:35 PM  
To: Varun Nambiar; GNURadio D.ion List  
Subject: Re: [Discuss-gnuradio] Writing RSSI Values to a File Twice/Sec

On 07/02/2015 11:25 AM, Varun Nambiar wrote:

Hi Philip,

At the moment of execution a file size of 32KB with just 0s is written  
to my file and then it doesn’t add anymore values after that. I am on  
release-2 and I’ve attached my GRC file.

I dropped the throttle block and saw the output file get larger. Resend  
the flowgraph to the list and maybe someone else has some ideas how to  
make it better.

Philip

Thank you,  
Varun

* * *

From: Philip B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, July 2, 2015 11:18 AM  
To: Varun Nambiar;  
removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Discuss-gnuradio] Writing RSSI Values to a File Twice/Sec

On 07/02/2015 11:07 AM, Varun Nambiar wrote:

Hi all,

I’m new to GNURadio and I’m trying to use a USRP E310 to capture GSM  
signals from a cellphone and store the RSSI values in a text file. If  
you take a look at my flow graph I’ve managed to capture the average  
strength across the 200kHz GSM band and I’m trying to filter out the  
unwanted signals using the Probe Avg Mag^2 block.

I’m having trouble writing to the file sink at a constant 2 samp/sec.  
Could you please give me advice on how I should fix my flow graph?

What kind of trouble? Can you also post the grc file so I can try it  
locally.

Also, which file system image are you using? The one from the card that  
came with the unit, or release-2?

Philip

Thank you,

Varun

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[https://urldefense.proofpoint.com/v2/url?u=https-3A\_\_lists.gnu.org\_mailman\_listinfo\_discuss-2Dgnuradio&d=AwIC-g&c=1QsCMERiq7JOmEnKpsSyjg&r=oML8w7v4Y02f11gsS3bWKQ&m=hC1yMZO9YJC94wCgIZWYH9bbke\_ocPJKoWRVfAMsuMo&s=8BPBpMr\_86l6B-6kzl20V\_C-fjCtQ-eOYPqCNrrvwCE&e=](https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.gnu.org_mailman_listinfo_discuss-2Dgnuradio&d=AwIC-g&c=1QsCMERiq7JOmEnKpsSyjg&r=oML8w7v4Y02f11gsS3bWKQ&m=hC1yMZO9YJC94wCgIZWYH9bbke_ocPJKoWRVfAMsuMo&s=8BPBpMr_86l6B-6kzl20V_C-fjCtQ-eOYPqCNrrvwCE&e=)

---

<div class="post-metadata">

**Author:** ![Varun\_Nambiar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/76d3ee/32.png) [@Varun\_Nambiar](https://www.ruby-forum.com/u/Varun_Nambiar)\
**Post date:** [July 3, 2015, 4:58pm UTC](https://www.ruby-forum.com/t/writing-rssi-values-to-a-file-twice-sec/242564/7 "2015-07-03T16:58:38Z")

</div>

On 07/02/2015 05:51 PM, Varun Nambiar wrote:

> file with 0s and it doesn’t output any samples to the file. When the  
> throttle block is removed, the processor on the E310 writes to the  
> file at the clock speed which leads to incredibly large files. Is  
> there a way to cut it down to 2 samples/sec? Also the Avg Mag^2 block  
> is there to probe for signals of strength greater than -70 dB.
> 
> Thanks,  
> Varun

Why not:

signal-source—\>filter----\>complex-to-mag^2----\>single-pole-iir-filter—\>keep-one-in-N-----\>file-sink

Adjust your post-detection filtering and keep-one-in-N to be consistent  
with your desired logging rate.
