fun_ofdm  1.0
802.11a Physical Layer for USRP
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
fun::RateParams Struct Reference

The RateParams struct. More...

#include <rates.h>

Public Member Functions

 RateParams (Rate _rate)
 RateParams constructor. More...
 

Static Public Member Functions

static RateParams FromRateField (unsigned char rate_field)
 Gets a RateParams instance based on the rate field in the packet header. More...
 

Public Attributes

unsigned char rate_field
 SIGNAL rate field. More...
 
int cbps
 Coded bits per symbol. More...
 
int dbps
 Data bits per symbol. More...
 
int bpsc
 Bits per subcarrier. More...
 
Rate rate
 Rate enum value. More...
 
double rel_rate
 Relative coding rate (relative to 1/2) More...
 
std::string name
 Display name. More...
 

Detailed Description

The RateParams struct.

Parameters for each data rate

Definition at line 52 of file rates.h.

Constructor & Destructor Documentation

fun::RateParams::RateParams ( Rate  _rate)
inline

RateParams constructor.

Populates the rate parameters appropriately for the given PHY Rate

Parameters
_ratethe PHY Rate for which the corresponding parameters are desired

Definition at line 68 of file rates.h.

References bpsc, cbps, dbps, name, rate, fun::RATE_1_2_BPSK, fun::RATE_1_2_QAM16, fun::RATE_1_2_QPSK, fun::RATE_2_3_BPSK, fun::RATE_2_3_QAM16, fun::RATE_2_3_QAM64, fun::RATE_2_3_QPSK, fun::RATE_3_4_BPSK, fun::RATE_3_4_QAM16, fun::RATE_3_4_QAM64, fun::RATE_3_4_QPSK, rate_field, and rel_rate.

Referenced by FromRateField().

69  {
70  switch(_rate)
71  {
72  // 1/2 BPSK
73  case RATE_1_2_BPSK:
74  rate_field = 0xD;
75  cbps = 48;
76  dbps = 24;
78  rel_rate = 1.0;
79  bpsc = 1;
80  name = "1/2 BPSK";
81  break;
82 
83  // 2/3 BPSK
84  case RATE_2_3_BPSK:
85  rate_field = 0xE;
86  cbps = 48;
87  dbps = 32;
89  rel_rate = 3.0 / 4.0;
90  bpsc = 1;
91  name = "2/3 BPSK";
92  break;
93 
94  // 3/4 BPSK
95  case RATE_3_4_BPSK:
96  rate_field = 0xF;
97  cbps = 48;
98  dbps = 36;
100  rel_rate = 2.0 / 3.0;
101  bpsc = 1;
102  name = "3/4 BPSK";
103  break;
104 
105  // 1/2 QPSK
106  case RATE_1_2_QPSK:
107  rate_field = 0x5;
108  cbps = 96;
109  dbps = 48;
111  rel_rate = 1.0;
112  bpsc = 2;
113  name = "1/2 QPSK";
114  break;
115 
116  // 2/3 QPSK
117  case RATE_2_3_QPSK:
118  rate_field = 0x6;
119  cbps = 96;
120  dbps = 64;
122  rel_rate = 3.0 / 4.0;
123  bpsc = 2;
124  name = "2/3 QPSK";
125  break;
126 
127  // 3/4 QPSK
128  case RATE_3_4_QPSK:
129  rate_field = 0x7;
130  cbps = 96;
131  dbps = 72;
133  rel_rate = 2.0 / 3.0;
134  bpsc = 2;
135  name = "3/4 QPSK";
136  break;
137 
138  // 1/2 QAM16
139  case RATE_1_2_QAM16:
140  rate_field = 0x9;
141  cbps = 192;
142  dbps = 96;
144  rel_rate = 1.0;
145  bpsc = 4;
146  name = "1/2 QAM16";
147  break;
148 
149  // 2/3 QAM16
150  case RATE_2_3_QAM16:
151  rate_field = 0xA;
152  cbps = 192;
153  dbps = 128;
155  rel_rate = 3.0 / 4.0;
156  bpsc = 4;
157  name = "2/3 QAM16";
158  break;
159 
160  // 3/4 QAM16
161  case RATE_3_4_QAM16:
162  rate_field = 0xB;
163  cbps = 192;
164  dbps = 144;
166  rel_rate = 2.0 / 3.0;
167  bpsc = 4;
168  name = "3/4 QAM16";
169  break;
170 
171  // 2/3 QAM64
172  case RATE_2_3_QAM64:
173  rate_field = 0x1;
174  cbps = 288;
175  dbps = 192;
177  rel_rate = 3.0 / 4.0;
178  bpsc = 6;
179  name = "2/3 QAM64";
180  break;
181 
182  // 3/4 QAM64
183  case RATE_3_4_QAM64:
184  rate_field = 0x3;
185  cbps = 288;
186  dbps = 216;
188  rel_rate = 2.0 / 3.0;
189  bpsc = 6;
190  name = "3/4 QAM64";
191  break;
192 
193  default:
194  break;
195  }
196  }

Member Function Documentation

static RateParams fun::RateParams::FromRateField ( unsigned char  rate_field)
inlinestatic

Gets a RateParams instance based on the rate field in the packet header.

This function is used to get the appropriate rate parameters for the received packet based on the rate field in the received packet header.

Parameters
rate_fieldThe rate field bits from the packet header
Returns
RateParams object with the appropriate parameters for that rate

Definition at line 208 of file rates.h.

References fun::RATE_1_2_BPSK, fun::RATE_1_2_QAM16, fun::RATE_1_2_QPSK, fun::RATE_2_3_BPSK, fun::RATE_2_3_QAM16, fun::RATE_2_3_QAM64, fun::RATE_2_3_QPSK, fun::RATE_3_4_BPSK, fun::RATE_3_4_QAM16, fun::RATE_3_4_QAM64, fun::RATE_3_4_QPSK, and RateParams().

Referenced by fun::ppdu::decode_header().

209  {
210  switch(rate_field)
211  {
212  // 1/2 BPSK
213  case 0xD: return RateParams(RATE_1_2_BPSK); break;
214 
215  // 2/3 BPSK
216  case 0xE: return RateParams(RATE_2_3_BPSK); break;
217 
218  // 3/4 BPSK
219  case 0xF: return RateParams(RATE_3_4_BPSK); break;
220 
221  // 1/2 QPSK
222  case 0x5: return RateParams(RATE_1_2_QPSK); break;
223 
224  // 2/3 QPSK
225  case 0x6: return RateParams(RATE_2_3_QPSK); break;
226 
227  // 3/4 QPSK
228  case 0x7: return RateParams(RATE_3_4_QPSK); break;
229 
230  // 1/2 QAM16
231  case 0x9: return RateParams(RATE_1_2_QAM16); break;
232 
233  // 2/3 QAM16
234  case 0xA: return RateParams(RATE_2_3_QAM16); break;
235 
236  // 3/4 QAM16
237  case 0xB: return RateParams(RATE_3_4_QAM16); break;
238 
239  // 2/3 QAM64
240  case 0x1: return RateParams(RATE_2_3_QAM64); break;
241 
242  // 3/4 QAM64
243  case 0x3: return RateParams(RATE_3_4_QAM64); break;
244 
245  default:
246  assert(false);
247  break;
248  }
249  }

Member Data Documentation

int fun::RateParams::bpsc

Bits per subcarrier.

Definition at line 57 of file rates.h.

Referenced by fun::modulator::demodulate(), RateParams(), and fun::FrameData::Reset().

int fun::RateParams::cbps

Coded bits per symbol.

Definition at line 55 of file rates.h.

Referenced by RateParams().

int fun::RateParams::dbps

Data bits per symbol.

Definition at line 56 of file rates.h.

Referenced by fun::ppdu::decode_data(), fun::ppdu::decode_header(), fun::ppdu::encode_data(), fun::ppdu::ppdu(), and RateParams().

std::string fun::RateParams::name

Display name.

Definition at line 60 of file rates.h.

Referenced by RateParams(), and test_tx().

Rate fun::RateParams::rate
unsigned char fun::RateParams::rate_field

SIGNAL rate field.

Definition at line 54 of file rates.h.

Referenced by fun::ppdu::encoder_header(), and RateParams().

double fun::RateParams::rel_rate

Relative coding rate (relative to 1/2)

Definition at line 59 of file rates.h.

Referenced by fun::puncturer::depuncture(), fun::puncturer::puncture(), and RateParams().


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