1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
3 | <title>mixpp: itpp::Spread_1d Class Reference</title> |
---|
4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
8 | <script type="text/javascript"> |
---|
9 | <!-- |
---|
10 | function changeDisplayState (e){ |
---|
11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
12 | var button=this.firstChild; |
---|
13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
15 | sectionDiv.style.display='block'; |
---|
16 | button.src='open.gif'; |
---|
17 | }else{ |
---|
18 | sectionDiv.style.display='none'; |
---|
19 | button.src='closed.gif'; |
---|
20 | } |
---|
21 | } |
---|
22 | function initDynSections(){ |
---|
23 | var divs=document.getElementsByTagName('div'); |
---|
24 | var sectionCounter=1; |
---|
25 | for(var i=0;i<divs.length-1;i++){ |
---|
26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
27 | var header=divs[i]; |
---|
28 | var section=divs[i+1]; |
---|
29 | var button=header.firstChild; |
---|
30 | if (button!='IMG'){ |
---|
31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
32 | button=document.createElement('img'); |
---|
33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
34 | } |
---|
35 | header.style.cursor='pointer'; |
---|
36 | header.onclick=changeDisplayState; |
---|
37 | header.id='dynheader'+sectionCounter; |
---|
38 | button.src='closed.gif'; |
---|
39 | section.id='dynsection'+sectionCounter; |
---|
40 | section.style.display='none'; |
---|
41 | section.style.marginLeft='14px'; |
---|
42 | sectionCounter++; |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
46 | window.onload = initDynSections; |
---|
47 | --> |
---|
48 | </script> |
---|
49 | <div class="navigation" id="top"> |
---|
50 | <div class="tabs"> |
---|
51 | <ul> |
---|
52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
55 | <li class="current"><a href="annotated.html"><span>Classes</span></a></li> |
---|
56 | <li><a href="files.html"><span>Files</span></a></li> |
---|
57 | </ul> |
---|
58 | </div> |
---|
59 | <div class="tabs"> |
---|
60 | <ul> |
---|
61 | <li><a href="annotated.html"><span>Class List</span></a></li> |
---|
62 | <li><a href="classes.html"><span>Class Index</span></a></li> |
---|
63 | <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> |
---|
64 | <li><a href="functions.html"><span>Class Members</span></a></li> |
---|
65 | </ul> |
---|
66 | </div> |
---|
67 | <div class="navpath"><b>itpp</b>::<a class="el" href="classitpp_1_1Spread__1d.html">Spread_1d</a> |
---|
68 | </div> |
---|
69 | </div> |
---|
70 | <div class="contents"> |
---|
71 | <h1>itpp::Spread_1d Class Reference<br> |
---|
72 | <small> |
---|
73 | [<a class="el" href="group__modulators.html">Digital Modulation</a>]</small> |
---|
74 | </h1><!-- doxytag: class="itpp::Spread_1d" -->Spreading of float symbols to float output. |
---|
75 | <a href="#_details">More...</a> |
---|
76 | <p> |
---|
77 | <code>#include <<a class="el" href="spread_8h-source.html">spread.h</a>></code> |
---|
78 | <p> |
---|
79 | |
---|
80 | <p> |
---|
81 | <a href="classitpp_1_1Spread__1d-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> |
---|
82 | <tr><td></td></tr> |
---|
83 | <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> |
---|
84 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c5ff2ad702fcd9c1b448ceaa1e340d3c"></a><!-- doxytag: member="itpp::Spread_1d::Spread_1d" ref="c5ff2ad702fcd9c1b448ceaa1e340d3c" args="()" --> |
---|
85 | </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#c5ff2ad702fcd9c1b448ceaa1e340d3c">Spread_1d</a> ()</td></tr> |
---|
86 | |
---|
87 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br></td></tr> |
---|
88 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="60dbcd2746277b4f710a917ff34e1b7c"></a><!-- doxytag: member="itpp::Spread_1d::Spread_1d" ref="60dbcd2746277b4f710a917ff34e1b7c" args="(const vec &incode)" --> |
---|
89 | </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#60dbcd2746277b4f710a917ff34e1b7c">Spread_1d</a> (const vec &incode)</td></tr> |
---|
90 | |
---|
91 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br></td></tr> |
---|
92 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f183e0c727a5e254ae756732063fa7dd"></a><!-- doxytag: member="itpp::Spread_1d::spread" ref="f183e0c727a5e254ae756732063fa7dd" args="(const vec &symbols, vec &out)" --> |
---|
93 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#f183e0c727a5e254ae756732063fa7dd">spread</a> (const vec &symbols, vec &out)</td></tr> |
---|
94 | |
---|
95 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Spreading of signal return i out. <br></td></tr> |
---|
96 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fc908fb3d2abeba03fa7108a5675e320"></a><!-- doxytag: member="itpp::Spread_1d::spread" ref="fc908fb3d2abeba03fa7108a5675e320" args="(const vec &symbols)" --> |
---|
97 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#fc908fb3d2abeba03fa7108a5675e320">spread</a> (const vec &symbols)</td></tr> |
---|
98 | |
---|
99 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Spreading of signal. <br></td></tr> |
---|
100 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="37adb98ca481080a3c7e56d68f644511"></a><!-- doxytag: member="itpp::Spread_1d::despread" ref="37adb98ca481080a3c7e56d68f644511" args="(const vec &rec_signal, vec &out, int timing)" --> |
---|
101 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#37adb98ca481080a3c7e56d68f644511">despread</a> (const vec &rec_signal, vec &out, int timing)</td></tr> |
---|
102 | |
---|
103 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Despreading of signal. <em>timing</em> is the start position of the first symbol, given in number of samples. <br></td></tr> |
---|
104 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0f3be17eb3791105337c3a751f25f496"></a><!-- doxytag: member="itpp::Spread_1d::despread" ref="0f3be17eb3791105337c3a751f25f496" args="(const vec &rec_signal, int timing)" --> |
---|
105 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#0f3be17eb3791105337c3a751f25f496">despread</a> (const vec &rec_signal, int timing)</td></tr> |
---|
106 | |
---|
107 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Despreading of signal. <em>timing</em> is the start position of the first symbol, given in number of samples. <br></td></tr> |
---|
108 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="48cfba452d6cb351e4c6253ef564be09"></a><!-- doxytag: member="itpp::Spread_1d::set_code" ref="48cfba452d6cb351e4c6253ef564be09" args="(const vec &incode)" --> |
---|
109 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#48cfba452d6cb351e4c6253ef564be09">set_code</a> (const vec &incode)</td></tr> |
---|
110 | |
---|
111 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the spreading code used for spreading. <br></td></tr> |
---|
112 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b222a17d4a09673384e84127bd07d1fe"></a><!-- doxytag: member="itpp::Spread_1d::get_code" ref="b222a17d4a09673384e84127bd07d1fe" args="()" --> |
---|
113 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#b222a17d4a09673384e84127bd07d1fe">get_code</a> ()</td></tr> |
---|
114 | |
---|
115 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the spreading code used. <br></td></tr> |
---|
116 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e4dd18b9b8152e323b8fe955b5df94cf"></a><!-- doxytag: member="itpp::Spread_1d::get_period" ref="e4dd18b9b8152e323b8fe955b5df94cf" args="()" --> |
---|
117 | int </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#e4dd18b9b8152e323b8fe955b5df94cf">get_period</a> ()</td></tr> |
---|
118 | |
---|
119 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the period of the code (length of code vector). <br></td></tr> |
---|
120 | <tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> |
---|
121 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3c80146fc6bf4669f91f50ac73a466b1"></a><!-- doxytag: member="itpp::Spread_1d::code" ref="3c80146fc6bf4669f91f50ac73a466b1" args="" --> |
---|
122 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#3c80146fc6bf4669f91f50ac73a466b1">code</a></td></tr> |
---|
123 | |
---|
124 | <tr><td class="mdescLeft"> </td><td class="mdescRight">The spreading code. <br></td></tr> |
---|
125 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="14f6374aeb08189334c46cdec582f0d7"></a><!-- doxytag: member="itpp::Spread_1d::N" ref="14f6374aeb08189334c46cdec582f0d7" args="" --> |
---|
126 | int </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Spread__1d.html#14f6374aeb08189334c46cdec582f0d7">N</a></td></tr> |
---|
127 | |
---|
128 | <tr><td class="mdescLeft"> </td><td class="mdescRight">The spreading factor. <br></td></tr> |
---|
129 | </table> |
---|
130 | <hr><a name="_details"></a><h2>Detailed Description</h2> |
---|
131 | Spreading of float symbols to float output. |
---|
132 | <p> |
---|
133 | Spreading block for generation of 1-dimensional DS-CDMA signals Useful in the simulation of DS-CDMA systems on chip level or upsampled chip level.<p> |
---|
134 | Obeserve that the spreading is normalized so that the energy per bit is preserved before and after spreading (that is each symbol is multiplied with <code>1/sqrt</code>(N)). Hence, for the multicode case the energy is normalized for one symbol (code) but the transmitted signal consist of a sum of several signals.<p> |
---|
135 | Four different classes exist:<p> |
---|
136 | <ul> |
---|
137 | <li> |
---|
138 | <a class="el" href="classitpp_1_1Spread__1d.html" title="Spreading of float symbols to float output.">Spread_1d</a> for 1-dimensional symbols (e.g. <a class="el" href="classitpp_1_1BPSK.html" title="BPSK modulator with real symbols.">BPSK</a>). </li> |
---|
139 | <li> |
---|
140 | <a class="el" href="classitpp_1_1Spread__2d.html" title="Spreading of complex symbols to complex output.">Spread_2d</a> for 2-dimensional symbols (e.g. <a class="el" href="classitpp_1_1QPSK.html" title="QPSK modulator.">QPSK</a>). </li> |
---|
141 | </ul> |
---|
142 | <p> |
---|
143 | For multicode transmission, that is each user uses several codes in parallel to transmit data, there exist<p> |
---|
144 | <ul> |
---|
145 | <li> |
---|
146 | <a class="el" href="classitpp_1_1Multicode__Spread__1d.html" title="Multicode spreading of float symbols.">Multicode_Spread_1d</a> for 1-dimensional symbols. </li> |
---|
147 | <li> |
---|
148 | <a class="el" href="classitpp_1_1Multicode__Spread__2d.html" title="Multicode spreading of complex symbols to complex output.">Multicode_Spread_2d</a> for 2-dimensional symbols. </li> |
---|
149 | </ul> |
---|
150 | <p> |
---|
151 | Example: <div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "<a class="code" href="itcomm_8h.html" title="Include file for the IT++ communications module.">itpp/itcomm.h</a>"</span> |
---|
152 | |
---|
153 | <span class="keywordtype">int</span> main() { |
---|
154 | |
---|
155 | <span class="comment">//Generate the spreading code you want to use.</span> |
---|
156 | vec spreading_code = <span class="stringliteral">"-1 1 -1 1"</span>; |
---|
157 | |
---|
158 | <span class="comment">//Initiate th Spreading class</span> |
---|
159 | <a class="code" href="classitpp_1_1Spread__1d.html#c5ff2ad702fcd9c1b448ceaa1e340d3c" title="Constructor.">Spread_1d</a> spread_1d(spreading_code); |
---|
160 | |
---|
161 | <span class="comment">//Generate the symbols to transmitt</span> |
---|
162 | bvec transmitted_bits = <a class="code" href="group__randgen.html#g5aa06887cf1fd3301b040987924068f0" title="Generates a random bit (equally likely 0s and 1s).">randb</a>(10); |
---|
163 | BPSK bpsk; |
---|
164 | vec transmitted_symbols = bpsk.modulate_bits(transmitted_bits); |
---|
165 | |
---|
166 | <span class="comment">//Spread the symbols</span> |
---|
167 | vec transmitted_signal = spread_1d.spread(transmitted_symbols); |
---|
168 | |
---|
169 | <span class="comment">//Generate the received signal</span> |
---|
170 | vec received_signal = transmitted_signal; |
---|
171 | |
---|
172 | <span class="comment">//Despread the received signal</span> |
---|
173 | vec received_symbols = spread_1d.despread(received_signal,0); |
---|
174 | |
---|
175 | <span class="comment">//demodulate the bits</span> |
---|
176 | bvec received_bits = bpsk.demodulate_bits(received_symbols); |
---|
177 | |
---|
178 | } |
---|
179 | </pre></div> <hr>The documentation for this class was generated from the following files:<ul> |
---|
180 | <li><a class="el" href="spread_8h-source.html">spread.h</a><li><a class="el" href="spread_8cpp.html">spread.cpp</a></ul> |
---|
181 | </div> |
---|
182 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:19 2009 for mixpp by |
---|
183 | <a href="http://www.doxygen.org/index.html"> |
---|
184 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
185 | </body> |
---|
186 | </html> |
---|