# Re Spectrum sensing Simulation Only

**URL:** <https://www.ruby-forum.com/t/re-spectrum-sensing-simulation-only/231259>\
**Category:** GNU Radio\
**Created:** [July 30, 2014, 8:55pm UTC](https://www.ruby-forum.com/t/re-spectrum-sensing-simulation-only/231259 "2014-07-30T20:55:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [July 30, 2014, 8:55pm UTC](https://www.ruby-forum.com/t/re-spectrum-sensing-simulation-only/231259/1 "2014-07-30T20:55:17Z")

</div>

Hello Martin

Thank you for the help. I try to run “specest\_noisy\_sinusoid\_mtm.py”  
(Python script is also okey for me). However it does not run “it says no  
module specest”.

By the way I am using windows 8 OS.

My goal is is to write a simple python or gnuradio code to perform the  
following task

I have the following variables

NFFT=1024  
Nav=512  
ampl=1  
seed=1  
Sampling\_rate= 10k

1. Generate any real time signal (This could be done by using  
"gr.noise\_source\_f (gr.GR\_GAUSSIAN, ampl, seed1)).

2. Insert throttle to control the sampling rate (i.e., gr.throttle(1,  
Sampling\_rate))

3. Compute the FFT (even without windowing) (i.e., NFFT samples at a  
time)

4. Compute the square magnitude of x (This could be done by using  
gr.complex\_to\_mag\_squared(NFFT))

i.e., in matlab y=abs(x).^2

1. sum the first and second Nav samples

i.e., av1=sum(y(1:512))/Nav and  
av2=sum(y(513:1024))/Nav

1. Then display “av1” and “av2” in a text box continuously.

Note that in matlab (without GUI it is very easy task)

And I feel that there should be some simple approach to do it in  
GNUradio

Thank you again for your help

* * *

Tadilo Endeshaw  
Postdoctoral Researcher  
Institut National de recherche Scientifique  
Centre Energie Matriaux Telecommunications  
Place Bonaventure,  
800 de la Gauchetiere Ouest, Suite 6900  
H5A 1K6  
Montreal, QC  
Canada  
E-mail : removed\_email\_address@domain.invalid  
removed\_email\_address@domain.invalid (private)  
Personal home page: [https://sites.google.com/site/tadilomypage/](https://sites.google.com/site/tadilomypage/)

* * *

From: discuss-gnuradio-bounces+tadilo.bogale=removed\_email\_address@domain.invalid  
[discuss-gnuradio-bounces+tadilo.bogale=removed\_email\_address@domain.invalid] On Behalf  
Of Martin B. [removed\_email\_address@domain.invalid]  
Sent: July 30, 2014 10:01 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Discuss-gnuradio] Spectrum sensing Simulation Only

On 07/30/2014 03:37 PM, Tom R. wrote:

> The easiest way to average is to use the single\_pole\_iir\_filter to  
> smooth out the data stream. But note that you’re coming out of the FFT  
> block as a vector. You can set the vector length of the single pole IIR,  
> but I’d have to review exactly what that means mathematically. It  
> probably smooths the entire vector as one as opposed to smoothing over  
> index i in each vector. You might have to play around with that.

gr-specest might help you with that (pybombs install gr-specest, or  
[GitHub - kit-cel/gr-specest: A module adding spectral estimation routines to GNU Radio.](https://github.com/kit-cel/gr-specest)).

M

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![BogaleS\_Tadilo\_Ende](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@BogaleS\_Tadilo\_Ende](https://www.ruby-forum.com/u/BogaleS_Tadilo_Ende)\
**Post date:** [July 30, 2014, 9:41pm UTC](https://www.ruby-forum.com/t/re-spectrum-sensing-simulation-only/231259/2 "2014-07-30T21:41:06Z")

</div>

Hi Tadilo,

have you made sure that specest was correctly installed? (make && make  
install)

Greetings,  
Marcus
