IT++ Logo
spread.h
Go to the documentation of this file.
1 
29 #ifndef SPREAD_H
30 #define SPREAD_H
31 
32 #include <itpp/base/vec.h>
33 #include <itpp/base/mat.h>
34 #include <itpp/itexports.h>
35 
36 namespace itpp
37 {
38 
99 class ITPP_EXPORT Spread_1d
100 {
101 public:
103  Spread_1d() { }
105  Spread_1d(const vec &incode);
107  void spread(const vec &symbols, vec &out);
109  vec spread(const vec &symbols) { vec out; spread(symbols, out); return out; }
113  void despread(const vec &rec_signal, vec &out, int timing);
117  vec despread(const vec &rec_signal, int timing)
118  { vec out; despread(rec_signal, out, timing); return out; }
120  void set_code(const vec &incode);
122  vec get_code();
124  int get_period() { return N; }
125 protected:
127  vec code;
129  int N;
130 };
131 
152 class ITPP_EXPORT Spread_2d
153 {
154 public:
156  Spread_2d() { }
158  Spread_2d(const vec &incodeI, const vec &incodeQ);
160  void spread(const cvec &symbols, cvec &out);
162  cvec spread(const cvec &symbols) { cvec out; spread(symbols, out); return out; }
166  void despread(const cvec &rec_signal, cvec &out, int timing);
170  cvec despread(const cvec &rec_signal, int timing)
171  { cvec out; despread(rec_signal, out, timing); return out; }
173  void set_code(const vec &incodeI, const vec &incodeQ);
175  vec get_codeI();
177  vec get_codeQ();
179  int get_period() { return spreadI.get_period(); }
180 protected:
183  Spread_1d spreadI, spreadQ;
185 };
186 
199 class ITPP_EXPORT Multicode_Spread_1d
200 {
201 public:
205  Multicode_Spread_1d(const mat &incodes);
207  vec spread(const vec &symbols);
209  vec despread(const vec &receivedsignal, int timing);
211  void set_codes(const mat &incodes);
213  mat get_codes();
215  int get_period() { return N; }
217  int get_nocodes() { return L; }
218 protected:
220  mat codes;
222  int L;
224  int N;
225 };
226 
247 class ITPP_EXPORT Multicode_Spread_2d
248 {
249 public:
253  Multicode_Spread_2d(const mat &incodesI, const mat &incodesQ);
255  cvec spread(const cvec &symbols);
257  cvec despread(const cvec &receivedsignal, int timing);
264  void set_codes(const mat &incodesI, const mat &incodesQ);
266  mat get_codesI();
268  mat get_codesQ();
270  int get_period() { return mcspreadI.get_period(); }
271 protected:
276 };
277 
278 } // namespace itpp
279 
280 #endif // #ifndef SPREAD_H
SourceForge Logo

Generated on Sat Jul 6 2013 10:54:23 for IT++ by Doxygen 1.8.2