33 #include <itpp/itexports.h>
84 inline STC(
const std::string &in_code_name,
86 int in_em_antenna = 0,
87 int in_channel_uses = 0
90 setup(in_code_name, in_const_size, in_em_antenna, in_channel_uses);
93 inline void setup(
const std::string &in_code_name,
95 int in_em_antenna = 0,
96 int in_channel_uses = 0
99 code_name = code_name_from_string(in_code_name);
100 it_assert(in_const_size >= 2,
"Constellation size should be at least two");
101 const_size = in_const_size;
102 em_antenna = in_em_antenna;
103 channel_uses = in_channel_uses;
104 Hassibi_block_code();
107 inline int get_nb_emission_antenna(
void)
const
112 inline int get_channel_uses(
void)
const
117 inline int get_nb_symbols_per_block(
void)
const
122 inline itpp::cmat get_1st_gen_matrix(
void)
const
127 inline itpp::cmat get_2nd_gen_matrix(
void)
const
132 itpp::cmat encode(
const itpp::cvec &symb);
135 STC& operator=(
const STC&);
136 void Hassibi_block_code(
void);
137 itpp::cmat diag_pow(
const itpp::cmat &in_mat,
double in_exp);
138 itpp::mat mat_pow(
const itpp::mat &in_mat,
int in_exp);
140 struct ITPP_EXPORT Code_Names
142 enum Type {Unknown, V_BLAST_MxN, imp_V_BLAST_MxN,
143 Alamouti_2xN, Switched_Alamouti_4xN, Double_Alamouti_4xN,
144 Jafarkhani_4xN, Golden_2x2, Damen_2x2, ortho34_3xN,
145 LD36_3xN, LD37_3xN, LD39_3xN};
146 Code_Names() : _t(Unknown) {}
147 Code_Names(Type t) : _t(t) {}
148 operator Type ()
const {
return _t;}
151 template<
typename T>
operator T ()
const;
153 Code_Names code_name;
162 static Code_Names code_name_from_string(
const std::string &name);
163 static std::string string_from_code_name(
const Code_Names& cn);
166 inline STC::Code_Names STC::code_name_from_string(
const std::string &name)
168 if (name==
"V-BLAST_MxN")
170 return Code_Names::V_BLAST_MxN;
171 }
else if (name ==
"imp_V-BLAST_MxN")
173 return Code_Names::imp_V_BLAST_MxN;
174 }
else if (name ==
"Alamouti_2xN")
176 return Code_Names::Alamouti_2xN;
177 }
else if (name ==
"Switched_Alamouti_4xN")
179 return Code_Names::Switched_Alamouti_4xN;
180 }
else if (name ==
"Double_Alamouti_4xN")
182 return Code_Names::Double_Alamouti_4xN;
183 }
else if (name ==
"Jafarkhani_4xN")
185 return Code_Names::Jafarkhani_4xN;
186 }
else if (name ==
"Golden_2x2")
188 return Code_Names::Golden_2x2;
189 }
else if (name ==
"Damen_2x2")
191 return Code_Names::Damen_2x2;
192 }
else if (name ==
"34ortho_3xN")
194 return Code_Names::ortho34_3xN;
195 }
else if (name ==
"36LD_3xN")
197 return Code_Names::LD36_3xN;
198 }
else if (name ==
"37LD_3xN")
200 return Code_Names::LD37_3xN;
201 }
else if (name ==
"39LD_3xN")
203 return Code_Names::LD39_3xN;
206 return Code_Names::Unknown;
210 inline std::string STC::string_from_code_name(
const STC::Code_Names& cn)
212 if (cn==Code_Names::V_BLAST_MxN)
214 return std::string(
"V-BLAST_MxN");
215 }
else if (cn==Code_Names::imp_V_BLAST_MxN)
217 return std::string(
"imp_V-BLAST_MxN");
218 }
else if (cn==Code_Names::Alamouti_2xN)
220 return std::string(
"Alamouti_2xN");
221 }
else if (cn==Code_Names::Switched_Alamouti_4xN)
223 return std::string(
"Switched_Alamouti_4xN");
224 }
else if (cn==Code_Names::Double_Alamouti_4xN)
226 return std::string(
"Double_Alamouti_4xN");
227 }
else if (cn==Code_Names::Jafarkhani_4xN)
229 return std::string(
"Jafarkhani_4xN");
230 }
else if (cn==Code_Names::Golden_2x2)
232 return std::string(
"Golden_2x2");
233 }
else if (cn==Code_Names::Damen_2x2)
235 return std::string(
"Damen_2x2");
236 }
else if (cn==Code_Names::ortho34_3xN)
238 return std::string(
"34ortho_3xN");
239 }
else if (cn==Code_Names::LD36_3xN)
241 return std::string(
"36LD_3xN");
242 }
else if (cn==Code_Names::LD37_3xN)
244 return std::string(
"37LD_3xN");
245 }
else if (cn==Code_Names::LD39_3xN)
247 return std::string(
"39LD_3xN");
250 return std::string(
"Unknown");