fun_ofdm
1.0
802.11a Physical Layer for USRP
|
The symbol_mapper class. More...
#include <symbol_mapper.h>
Public Member Functions | |
symbol_mapper () | |
Constructor for symbol mapper class. More... | |
std::vector< std::complex < double > > | map (std::vector< std::complex< double > > data_samples) |
Maps the data, pilots, and nulls to their respective subcarriers. More... | |
std::vector< std::complex < double > > | demap (std::vector< std::complex< double > > samples) |
Extracts the data from the symbols throwing out the nulls and pilots. More... | |
std::vector< unsigned char > | get_active_map () |
Gets the current active map of data, pilots, and nulls. More... | |
Private Attributes | |
int | m_data_subcarrier_count |
Number of data subcarriers. More... | |
int | m_pilot_count |
Number of pilot subcarriers. More... | |
Static Private Attributes | |
static const std::vector < unsigned char > | m_active_map |
The current map of data, pilots, and nulls. More... | |
static const double | POLARITY [127] |
The Pilot Polarity Sequence. More... | |
static const std::complex< double > | PILOTS [4] |
The 4 Pilot symbols. More... | |
The symbol_mapper class.
The symbol mapper class takes the stream of modulated data and maps it into symbols by mapping the data, pilots, and nulls onto their respective subcarriers. Conversely it also extracts the data from received symbols.
Definition at line 24 of file symbol_mapper.h.
fun::symbol_mapper::symbol_mapper | ( | ) |
Constructor for symbol mapper class.
-Initializations
Definition at line 68 of file symbol_mapper.cpp.
std::vector< std::complex< double > > fun::symbol_mapper::demap | ( | std::vector< std::complex< double > > | samples) |
Extracts the data from the symbols throwing out the nulls and pilots.
samples | Vector of symbols to extract data from |
Takes in a vector of samples and extracts the 48 data subcarriers while throwing away the nulls and the pilots. The input must be an integer multiple of 64 (the size of one symbol) in length so that we do not have partial symbols which wouldn't make sense. The output is simply a stream of received data however it will be an integer multiple of 48.
Definition at line 128 of file symbol_mapper.cpp.
References m_active_map, and m_data_subcarrier_count.
std::vector< unsigned char > fun::symbol_mapper::get_active_map | ( | ) |
Gets the current active map of data, pilots, and nulls.
Definition at line 145 of file symbol_mapper.cpp.
References m_active_map.
std::vector< std::complex< double > > fun::symbol_mapper::map | ( | std::vector< std::complex< double > > | data_samples) |
Maps the data, pilots, and nulls to their respective subcarriers.
data_samples | Vector of modulated data to be mapped into symbols |
Takes a vector of modulated data samples and maps them into OFDM symbols. The vector of data samples must be an integer multiple of 48 so that an integer number of symbols can be created since there are 48 data subcarriers. It also inserts the 4 pilot subcarriers and 12 null subcarriers. The output is a vector of samples with each set of 64 samples constituting one symbol.
Definition at line 81 of file symbol_mapper.cpp.
References m_active_map, m_data_subcarrier_count, PILOTS, and POLARITY.
Referenced by fun::frame_builder::build_frame().
|
staticprivate |
The current map of data, pilots, and nulls.
The map for where the data, pilots, and null subcarriers go.
Definition at line 56 of file symbol_mapper.h.
Referenced by demap(), get_active_map(), and map().
|
private |
Number of data subcarriers.
Definition at line 62 of file symbol_mapper.h.
|
private |
Number of pilot subcarriers.
Definition at line 64 of file symbol_mapper.h.
|
staticprivate |
The 4 Pilot symbols.
The pilots are always BPSK modulated, or in other words they are always (1 + 0j) or (-1 + 0j). Also, the first three pilots are always the same with the 4th pilot being inverted.
Definition at line 60 of file symbol_mapper.h.
Referenced by map().
|
staticprivate |
The Pilot Polarity Sequence.
The polarity sequence that is multiplied by the pilot sample for each OFDM symbol beginning with the signal symbol. For example, the pilots in the signal symbol will all be multipled by POLARITY0. The next symbol will be multipled by POLARITY[1], and so on. If the number of symbols is longer than 127 then the sequence just wraps back around to the beginning. The modulus (%) operator is very useful for achieving this effect.
Definition at line 58 of file symbol_mapper.h.
Referenced by map().