fun_ofdm
1.0
802.11a Physical Layer for USRP
|
The ppdu class. More...
#include <ppdu.h>
Public Member Functions | |
ppdu () | |
Default constructor for empty ppdu. More... | |
ppdu (Rate rate, int length) | |
Constructor for ppdu with rate and length known. More... | |
ppdu (std::vector< unsigned char > payload, Rate rate) | |
Constructor for ppdu with payload and Rate known. More... | |
std::vector< std::complex < double > > | encode () |
Public interface for encoding a ppdu. More... | |
bool | decode_header (std::vector< std::complex< double > > samples) |
Public interface for decoding a plcp_header. More... | |
bool | decode_data (std::vector< std::complex< double > > samples) |
Public interface for decoding the PHY payload into a PPDU. More... | |
Rate | get_rate () |
Get this PPDU's PHY tx rate. More... | |
int | get_length () |
Get this PPDU's payload length. More... | |
int | get_num_symbols () |
Get the number of OFDM symbols in this PPDU. More... | |
std::vector< unsigned char > | get_payload () |
Get the payload of this PPDU. More... | |
Private Member Functions | |
std::vector< std::complex < double > > | encoder_header () |
Encodes this PPDU's header. The header is always encoded with BPSK modulation and 1/2 rate convolutional code. More... | |
std::vector< std::complex < double > > | encode_data () |
Encodes this PPDU's payload. The payload is encoded at the rate specified in the header.rate field. More... | |
Private Attributes | |
plcp_header | header |
This PPDU's header parameters. More... | |
std::vector< unsigned char > | payload |
This PPDU's payload. More... | |
The ppdu class.
The ppdu class is a container for a ppdu which is made up of a PHY Header, otherwise known as a PLCP Header, and a payload of bytes. The class also has functions for encoding and decoding the header and payload based on the PHY transmission rates.
fun::ppdu::ppdu | ( | ) |
Default constructor for empty ppdu.
This constructor creates an empty PPDU with the default/empty plcp_header constructor
Definition at line 26 of file ppdu.cpp.
References header, MAX_FRAME_SIZE, and payload.
fun::ppdu::ppdu | ( | Rate | rate, |
int | length | ||
) |
Constructor for ppdu with rate and length known.
rate | PHY Rate for this frame. |
length | Length of payload in bytes. |
This constructor creates a PPDU with a header, but no payload field.
Definition at line 35 of file ppdu.cpp.
References fun::RateParams::dbps, header, MAX_FRAME_SIZE, and payload.
fun::ppdu::ppdu | ( | std::vector< unsigned char > | payload, |
Rate | rate | ||
) |
Constructor for ppdu with payload and Rate known.
payload | The payload/data/MPDU to be transmitted. |
rate | The PHY rate for this frame. |
This constructor creates a complete PPDU with header and payload.
Definition at line 49 of file ppdu.cpp.
References fun::RateParams::dbps, and header.
bool fun::ppdu::decode_data | ( | std::vector< std::complex< double > > | samples) |
Public interface for decoding the PHY payload into a PPDU.
samples | Complex samples representing the encoded payload symbols. |
Definition at line 223 of file ppdu.cpp.
References fun::viterbi::conv_decode(), fun::RateParams::dbps, fun::interleaver::deinterleave(), fun::modulator::demodulate(), fun::puncturer::depuncture(), header, fun::plcp_header::length, payload, fun::plcp_header::rate, and fun::plcp_header::service.
Referenced by fun::frame_decoder::work().
bool fun::ppdu::decode_header | ( | std::vector< std::complex< double > > | samples) |
Public interface for decoding a plcp_header.
samples | Complex samples representing the encoded header symbol. |
Definition at line 168 of file ppdu.cpp.
References fun::viterbi::conv_decode(), fun::RateParams::dbps, fun::interleaver::deinterleave(), fun::modulator::demodulate(), fun::RateParams::FromRateField(), header, fun::plcp_header::length, fun::plcp_header::num_symbols, fun::parity(), fun::plcp_header::rate, fun::RateParams::rate, fun::RATE_1_2_BPSK, and fun::VALID_RATES.
Referenced by fun::frame_decoder::work().
std::vector< std::complex< double > > fun::ppdu::encode | ( | ) |
Public interface for encoding a ppdu.
Public wrapper for encoding the header & payload and concatenating them together into a PHY frame.
Definition at line 65 of file ppdu.cpp.
References encode_data(), and encoder_header().
Referenced by fun::frame_builder::build_frame().
|
private |
Encodes this PPDU's payload. The payload is encoded at the rate specified in the header.rate field.
Definition at line 112 of file ppdu.cpp.
References fun::viterbi::conv_encode(), fun::RateParams::dbps, header, fun::interleaver::interleave(), fun::modulator::modulate(), payload, fun::puncturer::puncture(), and fun::plcp_header::rate.
Referenced by encode().
|
private |
Encodes this PPDU's header. The header is always encoded with BPSK modulation and 1/2 rate convolutional code.
Uses the rate_params to build the header. Note the header is NOT scrambled. Codes the header using a 1/2 convolutional code. Interleaves the header. And finally modulates the header using BPSK modulation.
Definition at line 81 of file ppdu.cpp.
References fun::viterbi::conv_encode(), header, fun::interleaver::interleave(), fun::plcp_header::length, fun::modulator::modulate(), fun::parity(), fun::plcp_header::rate, fun::RATE_1_2_BPSK, and fun::RateParams::rate_field.
Referenced by encode().
|
inline |
Get this PPDU's payload length.
Definition at line 144 of file ppdu.h.
References header, and fun::plcp_header::length.
Referenced by fun::frame_decoder::work().
|
inline |
Get the number of OFDM symbols in this PPDU.
Definition at line 145 of file ppdu.h.
References header, and fun::plcp_header::num_symbols.
Referenced by fun::frame_decoder::work().
|
inline |
Get the payload of this PPDU.
Definition at line 146 of file ppdu.h.
References payload.
Referenced by fun::frame_decoder::work().
|
inline |
Get this PPDU's PHY tx rate.
Definition at line 143 of file ppdu.h.
References header, and fun::plcp_header::rate.
Referenced by fun::frame_decoder::work().
|
private |
This PPDU's header parameters.
Definition at line 150 of file ppdu.h.
Referenced by decode_data(), decode_header(), encode_data(), encoder_header(), get_length(), get_num_symbols(), get_rate(), and ppdu().
|
private |
This PPDU's payload.
Definition at line 151 of file ppdu.h.
Referenced by decode_data(), encode_data(), get_payload(), and ppdu().