Forum: GNU Radio timestamp tags and set_min_output_buffer

517973424faae983299475171ea6c527?d=identicon&s=25 Juha Vierinen (Guest)
on 2013-10-09 21:00
(Received via mailing list)
Hi,

I'm writing a block that always outputs the same number of items as it
gets
in.

The block is doing FFT on a fixed length vector, so I always need nfft
samples in and nfft samples out. I've achieved this (I think) by using:
set_min_noutput_items(nfft) and set_max_noutput_items(nfft). However,
when
I increase nfft to 8192, I get a message about not enough buffer space.
I
tested various things and ended up calling
set_min_output_buffer(2*nfft)  as just nfft wasn't enough. It all seems
to
work nicely, except that the rx_time tags are screwed up -- I get a
nearly
random offset in the beginning, even though there are no dropped packets
on
the USRP.

Is this a bug or a feature? What is the correct way to increase the
value
of noutput_items without breaking rx_time tags?

juha
24bfeba02a47174102eecc303a89bce2?d=identicon&s=25 Tim (Guest)
on 2013-10-09 21:10
(Received via mailing list)
On 10/09/2013 02:59 PM, Juha Vierinen wrote:
> set_min_output_buffer(2*nfft)  as just nfft wasn't enough. It all
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Juha,

An easier way to achieve this is, is calling set_output_multiple(nfft)
in the block constructor - which assures noutput_items = n*nfft where n
>= 1
then if its a sync block without the relative rate or forecast being
change, it will also assume it also needs nfft items each work call
set_min_noutput_nitems and set_min_output_buffer are bigger hammers that
probably shouldn't be used in this case unless you have really big
vectors - I think by default there should be no problems with an output
multiple <= 8k
are you consuming nfft each time in your current  block?  If it is
providing you nfft+extra samples each time through work you would get
strange offsets if you simply consumed noutput_items each time.

-Tim
517973424faae983299475171ea6c527?d=identicon&s=25 Juha Vierinen (Guest)
on 2013-10-09 21:44
(Received via mailing list)
Thanks.

I've modified the code. I now call set_output_multiple(nfft) in the
constructor. This is probably for the better, as I can now use
sync_block
again. I also got rid of the buffer size error message on larger fft
sizes.

However, I still have the problem with random rx_time tags triggered in
the
beginning of the acquisition. I'll keep investigating this. It could be
that this is a feature of the n200 + gpsdo combination.

juha
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.