GNU Radio 3.6.5 C++ API

digital_ofdm_carrier_allocator_cvc Class Reference

Create frequency domain OFDM symbols from complex values, add pilots.This block turns a stream of complex, scalar modulation symbols into vectors which are the input for an IFFT in an OFDM transmitter. It also supports the possibility of placing pilot symbols onto the carriers. More...

#include <digital_ofdm_carrier_allocator_cvc.h>

Inheritance diagram for digital_ofdm_carrier_allocator_cvc:
gr_tagged_stream_block gr_block gr_basic_block gr_msg_accepter gruel::msg_accepter

List of all members.

Public Member Functions

 ~digital_ofdm_carrier_allocator_cvc ()
std::string len_tag_key ()
const int fft_len ()
std::vector< std::vector< int > > occupied_carriers ()
int work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 Just like gr_block::general_work, but makes sure the input is valid.

Protected Member Functions

int calculate_output_stream_length (const gr_vector_int &ninput_items)
 Calculate the number of output items.

Friends

DIGITAL_API
digital_ofdm_carrier_allocator_cvc_sptr 
digital_make_ofdm_carrier_allocator_cvc (int fft_len, const std::vector< std::vector< int > > &occupied_carriers, const std::vector< std::vector< int > > &pilot_carriers, const std::vector< std::vector< gr_complex > > &pilot_symbols, const std::string &len_tag_key)

Detailed Description

Create frequency domain OFDM symbols from complex values, add pilots.

This block turns a stream of complex, scalar modulation symbols into vectors which are the input for an IFFT in an OFDM transmitter. It also supports the possibility of placing pilot symbols onto the carriers.

The carriers can be allocated freely, if a carrier is not allocated, it is set to zero. This allows doing OFDMA-style carrier allocations.

Input: A tagged stream of complex scalars. The first item must have a tag containing the number of complex symbols in this frame. Output: A tagged stream of complex vectors of length fft_len. This can directly be connected to an FFT block. Make sure to set this block to 'reverse' for the IFFT and to deactivate FFT shifting.

Carrier indexes are always such that index 0 is the DC carrier (note: you should not allocate this carrier). The carriers below the DC carrier are either indexed with negative numbers, or with indexes larger than fft_len/2. Index -1 and index fft_len-1 both identify the carrier below the DC carrier.


Constructor & Destructor Documentation

digital_ofdm_carrier_allocator_cvc::~digital_ofdm_carrier_allocator_cvc ( )

Member Function Documentation

int digital_ofdm_carrier_allocator_cvc::calculate_output_stream_length ( const gr_vector_int ninput_items) [protected, virtual]

Calculate the number of output items.

This is basically the inverse function to forecast(): Given a number of input items, it returns the maximum number of output items.

You most likely need to override this function, unless your block is a sync block or integer interpolator/decimator.

Reimplemented from gr_tagged_stream_block.

const int digital_ofdm_carrier_allocator_cvc::fft_len ( ) [inline]
std::string digital_ofdm_carrier_allocator_cvc::len_tag_key ( ) [inline]
std::vector<std::vector<int> > digital_ofdm_carrier_allocator_cvc::occupied_carriers ( ) [inline]
int digital_ofdm_carrier_allocator_cvc::work ( int  noutput_items,
gr_vector_int ninput_items,
gr_vector_const_void_star input_items,
gr_vector_void_star output_items 
) [virtual]

Just like gr_block::general_work, but makes sure the input is valid.

The user must override work to define the signal processing code. Check the documentation for general_work() to see what happens here.

Like gr_sync_block, this calls consume() for you (it consumes ninput_items[i] items from the i-th port).

A note on tag propagation: The PDU length tags are handled by other functions, but all other tags are handled just as in any other gr_block. So, most likely, you either set the tag propagation policy to TPP_DONT and handle the tag propagation manually, or you propagate tags through the scheduler and don't do anything here.

Parameters:
noutput_itemsThe size of the writable output buffer
ninput_itemsThe exact size of the items on every input for this particular PDU. These will be consumed if a length tag key is provided!
input_itemsSee gr_block
output_itemsSee gr_block

Implements gr_tagged_stream_block.


Friends And Related Function Documentation

DIGITAL_API digital_ofdm_carrier_allocator_cvc_sptr digital_make_ofdm_carrier_allocator_cvc ( int  fft_len,
const std::vector< std::vector< int > > &  occupied_carriers,
const std::vector< std::vector< int > > &  pilot_carriers,
const std::vector< std::vector< gr_complex > > &  pilot_symbols,
const std::string &  len_tag_key 
) [friend]

The documentation for this class was generated from the following file: