discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Need help to understand code of sync:decimator bl


From: kunal sankhe
Subject: Re: [Discuss-gnuradio] Need help to understand code of sync:decimator block
Date: Sat, 8 Mar 2014 16:33:32 +0530

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 vector source {1,2,3,4,5,6,7,8,9,10}, i will get stream of integers.

Now I want to calculate average for first 5 samples i.e. 3 and then it should calculate average of {6,7,8,9,10} which is 8. So i should get desired output as {3,8}.

So I should get output for a block containing 5 samples. It should again consider block of 5 next samples and calculate average.

Please let me what changes do I need to make.

Thanks,
Kunal   


On Sat, Mar 8, 2014 at 3:23 PM, Marcus Müller <address@hidden> wrote:
-----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 5 items before, http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules#set_history
Greetings,
Marcus
- --
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.0.9

iQFABAEBCAAqBQJTGuigIxxNYXJjdXMgTfxsbGVyIDxtYXJjdXNAaG9zdGFsaWEu
ZGU+AAoJEBKNLRrpJvfoIRUH/0Orh65WsPeli99oQrbMpb40FVG+cytjmuUS8mKX
s0PHoDcQ/HXC8KIKxAOo+JQ26X/AK8Qnf3WCgfYB2/dvA7sz7JmYUbXgGFry1S9D
dtPUzAW2D0AASXG19rFBtCq6u1nhVDsIwxQ1yASNwx2wKuQEZyRFA1tjHiUqjpFf
0V+S1nB81jWw0WUJTpRMRGOe1tvhG0IDKmeBptMbKw6ShM979pPM3JgDsFIhn2MS
UWIM7Qjvnul4g8dnq/t7DpNe+lguHFgFes3hB8cHtTRGBvy+8QPJWn5lnCRBZz+4
ZKFrkWdsslzKjUHP67ZIQ5hn104P6MQZER+RpFdtcO3BJqg=
=9KAs
-----END PGP SIGNATURE-----



reply via email to

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