Editing Tagged Stream Blocks

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
[[Category:Usage Manual]]
 
 
== Introduction ==
 
== Introduction ==
  
Line 6: Line 5:
 
traditional GNU Radio blocks, if we stream N bytes into a block, there's no way of
 
traditional GNU Radio blocks, if we stream N bytes into a block, there's no way of
 
knowing the packet boundary. This might be relevant: Perhaps the modulator has to
 
knowing the packet boundary. This might be relevant: Perhaps the modulator has to
prepend a synchronization word before every packet or append a CRC. So while some
+
prepend a synchronisation word before every packet, or append a CRC. So while some
 
blocks don't care about packet boundaries, other blocks do: These are tagged
 
blocks don't care about packet boundaries, other blocks do: These are tagged
 
stream blocks.
 
stream blocks.
  
 
These blocks are different from all the other GNU Radio block types (gr::block,
 
These blocks are different from all the other GNU Radio block types (gr::block,
gr::sync_block etc.) in that they are driven by the input: The PDU length tag tells the block how to operate, whereas other blocks are output-driven (the scheduler tries to fill up the output buffer as much as possible).
+
gr::sync_block etc.) in that they are driven by the input: The PDU length tag tells the block how to operate, whereas other blocks are output-driven (the scheduler tries to fill up the output buffer are much as possible).
  
 
=== How do they work? ===
 
=== How do they work? ===
Line 43: Line 42:
 
Here's a minimal example of how the header file could look:
 
Here's a minimal example of how the header file could look:
  
<syntaxhighlight lang="cpp">
 
 
  #include <gnuradio/digital/api.h>
 
  #include <gnuradio/digital/api.h>
 
  #include <gnuradio/tagged_stream_block.h>  
 
  #include <gnuradio/tagged_stream_block.h>  
Line 60: Line 58:
 
   } // namespace digital
 
   } // namespace digital
 
  } // namespace gr
 
  } // namespace gr
</syntaxhighlight>
 
  
 
It is very similar to any other block definition. Two things are stand out: First,
 
It is very similar to any other block definition. Two things are stand out: First,
Line 72: Line 69:
 
The implementation header (*_impl.h) also looks a bit different (again this is cropped to the relevant parts):
 
The implementation header (*_impl.h) also looks a bit different (again this is cropped to the relevant parts):
  
 
<syntaxhighlight lang="cpp">
 
 
  #include <digital/crc32_bb.h>
 
  #include <digital/crc32_bb.h>
 
  namespace gr {
 
  namespace gr {
Line 93: Line 88:
 
   } // namespace digital
 
   } // namespace digital
 
  } // namespace gr
 
  } // namespace gr
</syntaxhighlight>
 
  
 
First, the work function signature is new. The argument list looks like that from
 
First, the work function signature is new. The argument list looks like that from
Line 109: Line 103:
 
Finally, this is part of the actual block implementation (heavily cropped again, to highlight the relevant parts):
 
Finally, this is part of the actual block implementation (heavily cropped again, to highlight the relevant parts):
  
 
<syntaxhighlight lang="cpp">
 
 
  #include <gnuradio/io_signature.h>
 
  #include <gnuradio/io_signature.h>
 
  #include "crc32_bb_impl.h"
 
  #include "crc32_bb_impl.h"
Line 158: Line 150:
 
   } // namespace digital
 
   } // namespace digital
 
  } // namespace gr
 
  } // namespace gr
</syntaxhighlight>
 
  
 
The make function is not different to any other block. The constructor calls
 
The make function is not different to any other block. The constructor calls
Line 263: Line 254:
 
=== CRC32 ===
 
=== CRC32 ===
  
Block: [https://github.com/gnuradio/gnuradio/blob/master/gr-digital/lib/crc32_bb_impl.cc crc32_bb]
+
Block: gr::digital::crc32_bb
  
 
This is a very simple block, and a good example to start with.
 
This is a very simple block, and a good example to start with.
Line 269: Line 260:
 
=== OFDM Frame Equalizer ===
 
=== OFDM Frame Equalizer ===
  
Block: [https://github.com/gnuradio/gnuradio/blob/master/gr-digital/lib/ofdm_frame_equalizer_vcvc_impl.cc ofdm_frame_equalizer_vcvc]
+
Block: gr::digital::ofdm_frame_equalizer_vcvc
  
 
This block would be a sync block if tagged stream blocks didn't exist. It also uses more
 
This block would be a sync block if tagged stream blocks didn't exist. It also uses more
Line 276: Line 267:
 
=== Tagged Stream Muxer ===
 
=== Tagged Stream Muxer ===
  
Block: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/lib/tagged_stream_mux_impl.cc tagged_stream_mux]
+
Block: gr::blocks::tagged_stream_mux
  
 
Use this to multiplex any number of tagged streams.
 
Use this to multiplex any number of tagged streams.
Line 282: Line 273:
 
=== Cyclic Prefixer (OFDM) ===
 
=== Cyclic Prefixer (OFDM) ===
  
Block: [https://github.com/gnuradio/gnuradio/blob/master/gr-digital/lib/ofdm_cyclic_prefixer_impl.cc ofdm_cyclic_prefixer]
+
Block: gr::digital::ofdm_cyclic_prefixer
  
This block uses the gr::block behavior fallback.
+
This block uses the gr::block behaviour fallback.
  
 
=== Troubleshooting ===
 
=== Troubleshooting ===

Please note that all contributions to GNU Radio are considered to be released under the Creative Commons Attribution-ShareAlike (see GNU Radio:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)