Dear Kunal,
This is not "moving average", this is normal "average".
I agree with Marcus' explanation, you don't need the "set_history()".
Moving average is:
1st output = average of 1,2,3,4,5
2nd output = average of 2,3,4,5,6
3rd output = average of 3,4,5,6,7
4th output = average of 4,5,6,7,8
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Sorry I was unclear: "5 inputs" means "5input items from the same
(only one) input stream".
Now, Miklos is most probably very right, the GNU Radio filters are
highly optimized. But let's take this as an exercise in understanding
decimators:
A decimato
Hi Kunal,
Use a decimating FIR filter with taps [0.2, 0.2, 0.2, 0.2, 0.2] and
decimation 5. It will be faster than anything you are about to write.
Miklos
On Sat, Mar 8, 2014 at 12:03 PM, kunal sankhe wrote:
> Hello Marcus,
>
> Sorry for my vague explanation. I want to write a block which will
Hello Marcus,
Sorry for my vague explanation. I want to write a block which will
calculate moving average for a block of samples. I have only one input in
this case. I am providing my data serially using vector to stream
converter. I want to calculate average of a block of 5 samples.
eg. from vec
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Hello Kunal,
You don't want to use set_history in this case: you want to produce 1 output
for 5 input, so you use a decimator; that's all you need to do. Drop the
set_history.
For reference: history is when for every input item you need the last
Hello,
I am using GNU Radio version 3.6.5 and trying to write a block to calculate
average of 5 samples. I want to produce one average output corresponding to
5 input samples. I am using set_history(5) to remember previous data. I
used gr_modtool script of type decimator to create file.
eg. for