root/doc/html/classitpp_1_1Pulse__Shape.html @ 353

Revision 353, 17.7 kB (checked in by smidl, 15 years ago)

doc

Line 
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::Pulse_Shape&lt; T1, T2, T3 &gt; Class Template 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<!--
10function 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}
22function 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}
46window.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&nbsp;Page</span></a></li>
53      <li><a href="pages.html"><span>Related&nbsp;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&nbsp;List</span></a></li>
62      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
63      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
64      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
65    </ul>
66  </div>
67  <div class="navpath"><b>itpp</b>::<a class="el" href="classitpp_1_1Pulse__Shape.html">Pulse_Shape</a>
68  </div>
69</div>
70<div class="contents">
71<h1>itpp::Pulse_Shape&lt; T1, T2, T3 &gt; Class Template Reference</h1><!-- doxytag: class="itpp::Pulse_Shape" -->General FIR Pulse Shape. 
72<a href="#_details">More...</a>
73<p>
74<code>#include &lt;<a class="el" href="pulse__shape_8h-source.html">pulse_shape.h</a>&gt;</code>
75<p>
76
77<p>
78<a href="classitpp_1_1Pulse__Shape-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
79<tr><td></td></tr>
80<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
81<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="18ee00c59ff47173615bb45bbfca4262"></a><!-- doxytag: member="itpp::Pulse_Shape::Pulse_Shape" ref="18ee00c59ff47173615bb45bbfca4262" args="()" -->
82&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#18ee00c59ff47173615bb45bbfca4262">Pulse_Shape</a> ()</td></tr>
83
84<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <br></td></tr>
85<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a6ef5c03cff55b63033a9e451e80a239"></a><!-- doxytag: member="itpp::Pulse_Shape::Pulse_Shape" ref="a6ef5c03cff55b63033a9e451e80a239" args="(const Vec&lt; T2 &gt; &amp;impulse_response, int upsampling_factor)" -->
86&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#a6ef5c03cff55b63033a9e451e80a239">Pulse_Shape</a> (const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T2 &gt; &amp;<a class="el" href="classitpp_1_1Pulse__Shape.html#cd7f0b701f29ad43caf8497eee8aacce">impulse_response</a>, int <a class="el" href="classitpp_1_1Pulse__Shape.html#0a389c9769f5714a3f0b01039fdfa2fd">upsampling_factor</a>)</td></tr>
87
88<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <br></td></tr>
89<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5a924f1b96e02daf3a65c41df18d042"></a><!-- doxytag: member="itpp::Pulse_Shape::~Pulse_Shape" ref="a5a924f1b96e02daf3a65c41df18d042" args="()" -->
90virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#a5a924f1b96e02daf3a65c41df18d042">~Pulse_Shape</a> ()</td></tr>
91
92<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <br></td></tr>
93<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#038f13f1eab9ae39e29c6c01fac0ac79">set_pulse_shape</a> (const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T2 &gt; &amp;<a class="el" href="classitpp_1_1Pulse__Shape.html#cd7f0b701f29ad43caf8497eee8aacce">impulse_response</a>, int <a class="el" href="classitpp_1_1Pulse__Shape.html#0a389c9769f5714a3f0b01039fdfa2fd">upsampling_factor</a>)</td></tr>
94
95<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the general impulse response of the FIR filter.  <a href="#038f13f1eab9ae39e29c6c01fac0ac79"></a><br></td></tr>
96<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ac428c5628e3e5dff632b382caaacebe"></a><!-- doxytag: member="itpp::Pulse_Shape::get_pulse_shape" ref="ac428c5628e3e5dff632b382caaacebe" args="(void) const " -->
97<a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T2 &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#ac428c5628e3e5dff632b382caaacebe">get_pulse_shape</a> (void) const </td></tr>
98
99<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the pulse shape. <br></td></tr>
100<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a344853245e5f45984b099e79fa998d5"></a><!-- doxytag: member="itpp::Pulse_Shape::get_upsampling_factor" ref="a344853245e5f45984b099e79fa998d5" args="() const " -->
101int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#a344853245e5f45984b099e79fa998d5">get_upsampling_factor</a> () const </td></tr>
102
103<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the over sampling factor. <br></td></tr>
104<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7556133cd7fb2ac87f4d34dee30bfc41"></a><!-- doxytag: member="itpp::Pulse_Shape::get_pulse_length" ref="7556133cd7fb2ac87f4d34dee30bfc41" args="() const " -->
105int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#7556133cd7fb2ac87f4d34dee30bfc41">get_pulse_length</a> () const </td></tr>
106
107<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the length of the pulse in number of symbols. <br></td></tr>
108<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="db6d549dc1076d2b8b4163b2078b7694"></a><!-- doxytag: member="itpp::Pulse_Shape::get_filter_length" ref="db6d549dc1076d2b8b4163b2078b7694" args="() const " -->
109int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#db6d549dc1076d2b8b4163b2078b7694">get_filter_length</a> () const </td></tr>
110
111<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the length of the internal FIR filter. <br></td></tr>
112<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="466e1220847c89e090a4bb367962df21"></a><!-- doxytag: member="itpp::Pulse_Shape::shape_symbols" ref="466e1220847c89e090a4bb367962df21" args="(const Vec&lt; T1 &gt; &amp;input, Vec&lt; T3 &gt; &amp;output)" -->
113void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#466e1220847c89e090a4bb367962df21">shape_symbols</a> (const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T1 &gt; &amp;input, <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T3 &gt; &amp;output)</td></tr>
114
115<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Shape the input symbols performing upsampling. <br></td></tr>
116<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e12e322608d6eecd5b7f2e3c9492c9a0"></a><!-- doxytag: member="itpp::Pulse_Shape::shape_symbols" ref="e12e322608d6eecd5b7f2e3c9492c9a0" args="(const Vec&lt; T1 &gt; &amp;input)" -->
117<a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T3 &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#e12e322608d6eecd5b7f2e3c9492c9a0">shape_symbols</a> (const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T1 &gt; &amp;input)</td></tr>
118
119<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Shape the input symbols performing upsampling. <br></td></tr>
120<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="14086d26f13af721df4ae4939f80d331"></a><!-- doxytag: member="itpp::Pulse_Shape::shape_samples" ref="14086d26f13af721df4ae4939f80d331" args="(const Vec&lt; T1 &gt; &amp;input, Vec&lt; T3 &gt; &amp;output)" -->
121void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#14086d26f13af721df4ae4939f80d331">shape_samples</a> (const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T1 &gt; &amp;input, <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T3 &gt; &amp;output)</td></tr>
122
123<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Shape the input samples already upsampled. <br></td></tr>
124<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0161cf1c884ce1de260df48c82a15aa7"></a><!-- doxytag: member="itpp::Pulse_Shape::shape_samples" ref="0161cf1c884ce1de260df48c82a15aa7" args="(const Vec&lt; T1 &gt; &amp;input)" -->
125<a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T3 &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#0161cf1c884ce1de260df48c82a15aa7">shape_samples</a> (const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T1 &gt; &amp;input)</td></tr>
126
127<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Shape the input symbols already upsampled. <br></td></tr>
128<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f85b84d4d2717ca2ae2170074c735bfa"></a><!-- doxytag: member="itpp::Pulse_Shape::clear" ref="f85b84d4d2717ca2ae2170074c735bfa" args="(void)" -->
129void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#f85b84d4d2717ca2ae2170074c735bfa">clear</a> (void)</td></tr>
130
131<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clear internal states. <br></td></tr>
132<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
133<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cd7f0b701f29ad43caf8497eee8aacce"></a><!-- doxytag: member="itpp::Pulse_Shape::impulse_response" ref="cd7f0b701f29ad43caf8497eee8aacce" args="" -->
134<a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T2 &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#cd7f0b701f29ad43caf8497eee8aacce">impulse_response</a></td></tr>
135
136<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The impulse resounse of the pulse shaping filter. <br></td></tr>
137<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5dcd026bd37e73f910f2c5d6c1120d41"></a><!-- doxytag: member="itpp::Pulse_Shape::shaping_filter" ref="5dcd026bd37e73f910f2c5d6c1120d41" args="" -->
138<a class="el" href="classitpp_1_1MA__Filter.html">MA_Filter</a>&lt; T1, T2, T3 &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#5dcd026bd37e73f910f2c5d6c1120d41">shaping_filter</a></td></tr>
139
140<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The pulse shaping filter. <br></td></tr>
141<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="adc84feb7843931d28b69b03595c47f9"></a><!-- doxytag: member="itpp::Pulse_Shape::pulse_length" ref="adc84feb7843931d28b69b03595c47f9" args="" -->
142int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#adc84feb7843931d28b69b03595c47f9">pulse_length</a></td></tr>
143
144<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Length in symbols. <br></td></tr>
145<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0a389c9769f5714a3f0b01039fdfa2fd"></a><!-- doxytag: member="itpp::Pulse_Shape::upsampling_factor" ref="0a389c9769f5714a3f0b01039fdfa2fd" args="" -->
146int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#0a389c9769f5714a3f0b01039fdfa2fd">upsampling_factor</a></td></tr>
147
148<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Samples per input symbol. <br></td></tr>
149<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f649289d3f21befa740b7462520c2bc7"></a><!-- doxytag: member="itpp::Pulse_Shape::setup_done" ref="f649289d3f21befa740b7462520c2bc7" args="" -->
150bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Pulse__Shape.html#f649289d3f21befa740b7462520c2bc7">setup_done</a></td></tr>
151
152<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Ensures that setup is called before any other member function. <br></td></tr>
153</table>
154<hr><a name="_details"></a><h2>Detailed Description</h2>
155<h3>template&lt;class T1, class T2, class T3&gt;<br>
156 class itpp::Pulse_Shape&lt; T1, T2, T3 &gt;</h3>
157
158General FIR Pulse Shape.
159<p>
160Upsamples and shapes symbols according to a given FIR filter. Observe that since the shaping is done with a FIR filter, the first samples in the output are zero or small before the memory of the filter is filled.<p>
161The class is templated as follows: <ul>
162<li>
163<code>T1</code> is the type of the input samples </li>
164<li>
165<code>T2</code> is the type of the filter coefficients </li>
166<li>
167<code>T3</code> is the type of the output samples </li>
168</ul>
169<p>
170An example of usage is:<p>
171<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>
172
173  vec filter_response;
174  filter_response =<span class="stringliteral">"0.7 0.3 0.6"</span>;
175  Pulse_Shape&lt;double,double,double&gt; shaper(filter_response, 4);
176  BPSK bpsk;
177  vec symbols, samples;
178
179  symbols = bpsk.modulate_bits(<a class="code" href="group__randgen.html#g5aa06887cf1fd3301b040987924068f0" title="Generates a random bit (equally likely 0s and 1s).">randb</a>(20));
180  samples = shaper.shape_symbols(symbols);
181</pre></div> <hr><h2>Member Function Documentation</h2>
182<a class="anchor" name="038f13f1eab9ae39e29c6c01fac0ac79"></a><!-- doxytag: member="itpp::Pulse_Shape::set_pulse_shape" ref="038f13f1eab9ae39e29c6c01fac0ac79" args="(const Vec&lt; T2 &gt; &amp;impulse_response, int upsampling_factor)" -->
183<div class="memitem">
184<div class="memproto">
185<div class="memtemplate">
186template&lt;class T1 , class T2, class T3 &gt; </div>
187      <table class="memname">
188        <tr>
189          <td class="memname">void <a class="el" href="classitpp_1_1Pulse__Shape.html">itpp::Pulse_Shape</a>&lt; T1, T2, T3 &gt;::set_pulse_shape           </td>
190          <td>(</td>
191          <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; T2 &gt; &amp;&nbsp;</td>
192          <td class="paramname"> <em>impulse_response</em>, </td>
193        </tr>
194        <tr>
195          <td class="paramkey"></td>
196          <td></td>
197          <td class="paramtype">int&nbsp;</td>
198          <td class="paramname"> <em>upsampling_factor</em></td><td>&nbsp;</td>
199        </tr>
200        <tr>
201          <td></td>
202          <td>)</td>
203          <td></td><td></td><td><code> [inline]</code></td>
204        </tr>
205      </table>
206</div>
207<div class="memdoc">
208
209<p>
210Set the general impulse response of the FIR filter.
211<p>
212Observe that the pulse shape must have a duration of an integer number of symbols. Thus the length of the impulse response-1 modulo over sampling is an integer.
213<p>References <a class="el" href="pulse__shape_8h-source.html#l00114">itpp::Pulse_Shape&lt; T1, T2, T3 &gt;::impulse_response</a>, <a class="el" href="itassert_8h-source.html#l00117">it_error_if</a>, <a class="el" href="pulse__shape_8h-source.html#l00118">itpp::Pulse_Shape&lt; T1, T2, T3 &gt;::pulse_length</a>, <a class="el" href="pulse__shape_8h-source.html#l00122">itpp::Pulse_Shape&lt; T1, T2, T3 &gt;::setup_done</a>, <a class="el" href="pulse__shape_8h-source.html#l00116">itpp::Pulse_Shape&lt; T1, T2, T3 &gt;::shaping_filter</a>, <a class="el" href="vec_8h-source.html#l00277">itpp::Vec&lt; Num_T &gt;::size()</a>, and <a class="el" href="pulse__shape_8h-source.html#l00120">itpp::Pulse_Shape&lt; T1, T2, T3 &gt;::upsampling_factor</a>.</p>
214
215<p>Referenced by <a class="el" href="pulse__shape_8h-source.html#l00261">itpp::Pulse_Shape&lt; T1, T2, T3 &gt;::Pulse_Shape()</a>.</p>
216
217</div>
218</div><p>
219<hr>The documentation for this class was generated from the following file:<ul>
220<li><a class="el" href="pulse__shape_8h-source.html">pulse_shape.h</a></ul>
221</div>
222<hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:19 2009 for mixpp by&nbsp;
223<a href="http://www.doxygen.org/index.html">
224<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
225</body>
226</html>
Note: See TracBrowser for help on using the browser.