parameters: (self)
docstring: test_tag_gap: test with gap between tags; should drop samples that are
              between proper tagged streams
docstring_summary: test_tag_gap: test with gap between tags; should drop samples that are
              between proper tagged streams
docstring_tokens: test_tag_gap : test with gap between tags ; should drop samples that are between proper tagged streams
function: def test_tag_gap(self):
          '''
          test_tag_gap: test with gap between tags; should drop samples that are
              between proper tagged streams
          '''
          prepad = 10
          postpad = 10
          length = 20
          gap_len = 5
          data = np.arange(2 * length + gap_len, dtype=float)
          window = np.concatenate((-2.0 * np.ones(5), -4.0 * np.ones(5)))
          ewindow = window * \
              np.array([1, -1, 1, -1, 1, 1, -1, 1, -1, 1], dtype=float)
          tags = (make_length_tag(0, length),
                  make_length_tag(length + gap_len, length))
          expected = np.concatenate((np.zeros(prepad),
                                     ewindow[0:5],
                                     np.arange(0,
                                               length,
                                               dtype=float),
                                     ewindow[5:10],
                                     np.zeros(postpad),
                                     np.zeros(prepad),
                                     ewindow[0:5],
                                     np.arange(length + gap_len,
                                               2 * length + gap_len,
                                               dtype=float),
                                     ewindow[5:10],
                                     np.zeros(postpad)))
          burst_len = length + len(window) + prepad + postpad
          etags = (make_length_tag(0, burst_len),
                   make_length_tag(burst_len, burst_len))
  
          # flowgraph
          source = blocks.vector_source_f(data, tags=tags)
          shaper = digital.burst_shaper_ff(window, pre_padding=prepad,
                                           post_padding=postpad,
                                           insert_phasing=True)
          sink = blocks.vector_sink_f()
          self.tb.connect(source, shaper, sink)
          self.tb.run()
  
          # checks
          self.assertFloatTuplesAlmostEqual(sink.data(), expected, 6)
          for i in range(len(etags)):
              self.assertTrue(compare_tags(sink.tags()[i], etags[i]))
function_tokens: def test_tag_gap ( self ) : prepad = 10 postpad = 10 length = 20 gap_len = 5 data = np . arange ( 2 * length + gap_len , dtype = float ) window = np . concatenate ( ( - 2.0 * np . ones ( 5 ) , - 4.0 * np . ones ( 5 ) ) ) ewindow = window * np . array ( [ 1 , - 1 , 1 , - 1 , 1 , 1 , - 1 , 1 , - 1 , 1 ] , dtype = float ) tags = ( make_length_tag ( 0 , length ) , make_length_tag ( length + gap_len , length ) ) expected = np . concatenate ( ( np . zeros ( prepad ) , ewindow [ 0 : 5 ] , np . arange ( 0 , length , dtype = float ) , ewindow [ 5 : 10 ] , np . zeros ( postpad ) , np . zeros ( prepad ) , ewindow [ 0 : 5 ] , np . arange ( length + gap_len , 2 * length + gap_len , dtype = float ) , ewindow [ 5 : 10 ] , np . zeros ( postpad ) ) ) burst_len = length + len ( window ) + prepad + postpad etags = ( make_length_tag ( 0 , burst_len ) , make_length_tag ( burst_len , burst_len ) ) # flowgraph source = blocks . vector_source_f ( data , tags = tags ) shaper = digital . burst_shaper_ff ( window , pre_padding = prepad , post_padding = postpad , insert_phasing = True ) sink = blocks . vector_sink_f ( ) self . tb . connect ( source , shaper , sink ) self . tb . run ( ) # checks self . assertFloatTuplesAlmostEqual ( sink . data ( ) , expected , 6 ) for i in range ( len ( etags ) ) : self . assertTrue ( compare_tags ( sink . tags ( ) [ i ] , etags [ i ] ) )