discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Moving Average Block


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Moving Average Block
Date: Tue, 12 Jan 2016 17:40:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Hi Pedro,

$y[n]=\sum\limits_{i=n-N+1}^n {\left|x[i]\right|^2}$ is nothing but the moving average over the squared magnitude.
Sadly, your formula
$T=\sum\limits_{n=0}^{N-1} {\left|Y[n]\right|^2}$ doesn't specify what T signifies; is T used as a single sum over N samples' squared magnitudes, or is it something running (i.e. you get as many Ts as you consider samples.

I just assume you really are looking for a moving average, in which case your flow graph is correct.
Timothée told me to use stream to vector, but if I pack them, each 100 samples will become one single information, right? What I need is more like a controller that gives me 100 samples at a time.
Really, I'm not sure where the formula you attached came from, or what you mean, or if what you mean is what you need...
Maybe you could just write down, explicitely, what *each* output sample should be (which is why I wrote $y[n]$ rather than $y$).


Best regards,
Marcus


On 12.01.2016 17:27, Pedro Gabriel Adami wrote:
Dear all,

In addition to my previous response, I'm attaching an image that shows the formula I'm trying to build in gnuradio (using blocks). But instead of n = 0 and N-1, I need n = 1 and 100 (100 samples). The second picture shows how I tried to do in Gnuradio, but the moving average block does not get 100 samples the way I need (as we could see in the previous answers).

Timothée told me to use stream to vector, but if I pack them, each 100 samples will become one single information, right? What I need is more like a controller that gives me 100 samples at a time.

Please, I appreciate if you could give me some tips.

Thanks in advance.

2016-01-08 14:47 GMT-02:00 Timothée COCAULT <address@hidden>:
Whoops, just noticed I didn't reply to all when I answered so my message and Pedro's response were not forwarded to the mailing list :

Le jeu. 7 janv. 2016 à 20:28, Pedro Gabriel Adami <address@hidden> a écrit :

Dear, Timothée,

Thank you so much. I am doing some tests and I've realized that the results are a little strange. That is why I asked.

Let me ask you one more thing: Do you know some block that is capable to retain N samples, so I can use them and after that, it retains the next N samples? Like a variable where I can "save" the information for a short period of time, but my Gnuradio does not have a "variable sink".

Thanks in advance.

Em 07/01/2016 17:18, "Timothée COCAULT" <address@hidden> escreveu:
Hi Pedro,

When you're not sure, the best solution is often to look at the code.
If you look at the work function in gr-blocks/lib/moving_average_XX_impl.cc.t, you see that the block first sums the history (of length 100 in your case).
For each additional input items, it adds the new item and subtracts the n-100 item, and outputs the current sum.

So it will first calculate 1+...+100, then 2+...+101 and so on.

Regards,
Timothée. 
 


I don't understand exactly your question but you can use a stream to vector to group your items in packets of size N, and plug it into a probe signal



--
Atenciosamente,
Pedro Gabriel Adami
Graduando do 5º período de Engenharia de Controle e Automação no Instituto Nacional de Telecomunicações - Inatel


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]