parameters: (self)
docstring: Add a frequency offset, check if it's correctly detected.
          Difference to previous test is, it only uses one synchronisation symbol.
docstring_summary: Add a frequency offset, check if it's correctly detected.
          Difference to previous test is, it only uses one synchronisation symbol.
docstring_tokens: Add a frequency offset check if it s correctly detected . Difference to previous test is it only uses one synchronisation symbol .
function: def test_002_offset_1sym(self):
          """ Add a frequency offset, check if it's correctly detected.
          Difference to previous test is, it only uses one synchronisation symbol. """
          fft_len = 16
          carr_offset = -2
          # This will not correct for +2 because it thinks carrier 14 is used
          # (because of interpolation)
          sync_symbol = (0, 0, 0, 1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, 0)
          data_symbol = (0, 0, 0, 1, -1, 1, -1, 1, 0, 1, -1, -1, -1, 1, 0, 0)
          tx_data = shift_tuple(sync_symbol, carr_offset) + \
              shift_tuple(data_symbol, carr_offset)
          src = blocks.vector_source_c(tx_data, False, fft_len)
          # 17 is out of bounds!
          chanest = digital.ofdm_chanest_vcvc(sync_symbol, (), 1, 0, 17)
          sink = blocks.vector_sink_c(fft_len)
          self.tb.connect(src, chanest, sink)
          self.tb.run()
          self.assertEqual(shift_tuple(sink.data(), -carr_offset), data_symbol)
          tags = sink.tags()
          for tag in tags:
              if pmt.symbol_to_string(tag.key) == 'ofdm_sync_carr_offset':
                  carr_offset_hat = pmt.to_long(tag.value)
                  self.assertEqual(carr_offset_hat, carr_offset)
function_tokens: def test_002_offset_1sym ( self ) : fft_len = 16 carr_offset = - 2 # This will not correct for +2 because it thinks carrier 14 is used # (because of interpolation) sync_symbol = ( 0 , 0 , 0 , 1 , 0 , 1 , 0 , - 1 , 0 , 1 , 0 , - 1 , 0 , 1 , 0 , 0 ) data_symbol = ( 0 , 0 , 0 , 1 , - 1 , 1 , - 1 , 1 , 0 , 1 , - 1 , - 1 , - 1 , 1 , 0 , 0 ) tx_data = shift_tuple ( sync_symbol , carr_offset ) + shift_tuple ( data_symbol , carr_offset ) src = blocks . vector_source_c ( tx_data , False , fft_len ) # 17 is out of bounds! chanest = digital . ofdm_chanest_vcvc ( sync_symbol , ( ) , 1 , 0 , 17 ) sink = blocks . vector_sink_c ( fft_len ) self . tb . connect ( src , chanest , sink ) self . tb . run ( ) self . assertEqual ( shift_tuple ( sink . data ( ) , - carr_offset ) , data_symbol ) tags = sink . tags ( ) for tag in tags : if pmt . symbol_to_string ( tag . key ) == 'ofdm_sync_carr_offset' : carr_offset_hat = pmt . to_long ( tag . value ) self . assertEqual ( carr_offset_hat , carr_offset )