Puncture: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(Created page with "Category:Block Docs Category:Stub Docs This is the template for the "Page-per-block Docs". This first section should describe what the block...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
[[Category:Stub Docs]]
For a given block of input samples of puncsize, the items
This is the template for the [[:Category:Block_Docs|"Page-per-block Docs"]].  This first section should describe what the block does and how to use it, using however many paragraphs necessary.  Note that the title of the wiki page should match the block's name in GRC, i.e. the one defined in the block's .grc file.  Look at the [[FFT]] Block for a good example.
produced is based on puncpat. Basically, if:


As this is a basic template, it's also in the [[:Category:Stub_Docs|"Stub Docs category"]]. Please improve it.
  k = 0
  if _puncpat[i] == 1:
      out[k++] = input[i]
 
This block is designed for floats, generally 1's and -1's. It's possible to use other float values as symbols, but this is not the expected operation.
puncpat is specified as a 32-bit integer that we can convert into the vector _puncpat used in the algorithm above:
  _puncpat = [0,...]
  for i in puncsize:
      _puncpat[i] = puncpat >> (puncsize-1-i)
Example:
  puncsize = 8
  puncpat = 0xEF  -->  [1,1,1,0,1,1,1,1]
  input = [a, b, c, d, e, f, g, h]
  output = [a, b, c, e, f, g, h]
 
The gr.fec Python module provides a read_bitlist function that can turn a string of a puncture pattern into the correct integer form. The pattern of 0xEF could be specified as fec.readbitlist("11101111"). Also, this allows us to use puncsize=len("11101111") to make sure that our sizes are set up correctly for the pattern we want.
 
The fec.extended_encoder takes in the puncture pattern directly as a string and uses the readbitlist inside to do the conversion.
 
Note that due to the above concept, the default setting in the extended encoder of '11' translates into no puncturing.
 
The delay parameter delays the application of the puncture pattern. This is equivalent to circularly rotating the puncpat by delay. Note that because of the circular shift, the delay should be between 0 and puncsize, but this is not enforced; the effective delay will simply be delay mod puncsize. A negative value here is ignored.


== Parameters ==
== Parameters ==
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>


; Param 1 (''R'')
; Puncture Size
: Description of parameter, provide any tips or recommended values.  Note that the name of the parameter above should match the param's label that shows up in grc (e.g. Sample Rate).
: Size of block of bits to puncture
 
; Puncture Pattern
: The puncturing pattern


; Param 2
; Delay
: blah blah blah
: Delayed the puncturing pattern by shifting it


== Example Flowgraph ==
== Example Flowgraph ==
Line 21: Line 44:


; C++ files
; C++ files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/lib/puncture_ff_impl.cc]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/lib/puncture_bb_impl.cc]


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/lib/puncture_ff_impl.h]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/lib/puncture_bb_impl.h]


; Public header files
; Public header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/include/gnuradio/fec/puncture_ff.h Float input]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/include/gnuradio/fec/puncture_bb.h Byte input]


; Block definition
; Block definition
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/grc/fec_puncture_xx.block.yml]

Latest revision as of 09:07, 12 September 2019

For a given block of input samples of puncsize, the items produced is based on puncpat. Basically, if:

  k = 0
  if _puncpat[i] == 1:
     out[k++] = input[i]

This block is designed for floats, generally 1's and -1's. It's possible to use other float values as symbols, but this is not the expected operation. puncpat is specified as a 32-bit integer that we can convert into the vector _puncpat used in the algorithm above:

  _puncpat = [0,...]
  for i in puncsize:
      _puncpat[i] = puncpat >> (puncsize-1-i)

Example:

  puncsize = 8
  puncpat = 0xEF  -->  [1,1,1,0,1,1,1,1]
  input = [a, b, c, d, e, f, g, h]
  output = [a, b, c, e, f, g, h]

The gr.fec Python module provides a read_bitlist function that can turn a string of a puncture pattern into the correct integer form. The pattern of 0xEF could be specified as fec.readbitlist("11101111"). Also, this allows us to use puncsize=len("11101111") to make sure that our sizes are set up correctly for the pattern we want.

The fec.extended_encoder takes in the puncture pattern directly as a string and uses the readbitlist inside to do the conversion.

Note that due to the above concept, the default setting in the extended encoder of '11' translates into no puncturing.

The delay parameter delays the application of the puncture pattern. This is equivalent to circularly rotating the puncpat by delay. Note that because of the circular shift, the delay should be between 0 and puncsize, but this is not enforced; the effective delay will simply be delay mod puncsize. A negative value here is ignored.

Parameters

Puncture Size
Size of block of bits to puncture
Puncture Pattern
The puncturing pattern
Delay
Delayed the puncturing pattern by shifting it

Example Flowgraph

Insert description of flowgraph here, then show a screenshot of the flowgraph and the output if there is an interesting GUI. Currently we have no standard method of uploading the actual flowgraph to the wiki or git repo, unfortunately. The plan is to have an example flowgraph showing how the block might be used, for every block, and the flowgraphs will live in the git repo.

Source Files

C++ files
[1]
[2]
Header files
[3]
[4]
Public header files
Float input
Byte input
Block definition
[5]