discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] A few questions about subclassing gr_block


From: Martin Braun (CEL)
Subject: Re: [Discuss-gnuradio] A few questions about subclassing gr_block
Date: Fri, 3 May 2013 09:08:34 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 03, 2013 at 11:04:40AM +1200, Mark Cottrell wrote:
> I am trying to create a block that detects sync patterns at baseband tagging
> the first sample of the pattern using stream tags, then using the tags down

That's the correct way to do it, if you ask me.

Just to clarify: Before you get a sync pattern, are you producing
anything? Or are your copying all of the input to the output, plus the
tag? If the latter is the case, you should use a sync_block.

> stream as part of demodulation.  I have made a few assumptions about how
> gnuradio works that I would like to validate:
> 
> - a sync pattern could span two blocks of samples passed to general_work

It depends on your sync pattern. If it's not too long, you can avoid
that.

> - I need to keep SYNC_PATTERN_LENGTH - 1 samples to get around this, so I
> should be able to use a general block and not output all of the items
> 
> - you can't tag historic samples (i.e. samples obtained using set_history), so
> I can't use that

You can also use 'future' samples to do signal processing. An example
are the peak_detector blocks, which find the beginning of a peak.

Simply don't consume them.

> Currently I have an implementation of the block, but I am having trouble
> understanding the relationship between ninput_items and noutput_items.  When I
> feed the block from a file source consisting of 720 samples, I get 
> ninput_items
> [0] = 720 and noutput_items = 512.  Does this value for noutput_items mean I
> can only consume and copy 512 of the input samples?  And do I need to 
> implement
> forecast if I want to output more?

That depends. Do you *really* want to output more? How many? What if
your have 1440 items at the input?

Basically, this is telling you there's space for 512 items in the output
buffer. If you can use a sync_block, you'll never run into these
problems, because there's only one value.

MB

-- 
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Attachment: pgpx72ulHCyOn.pgp
Description: PGP signature


reply via email to

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