root/doc/html/classitpp_1_1Freq__Filt.html @ 353

Revision 353, 14.5 kB (checked in by smidl, 16 years ago)

doc

RevLine 
[353]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::Freq_Filt&lt; Num_T &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_1Freq__Filt.html">Freq_Filt</a>
68  </div>
69</div>
70<div class="contents">
71<h1>itpp::Freq_Filt&lt; Num_T &gt; Class Template Reference<br>
72<small>
73[<a class="el" href="group__filters.html">Filtering</a>]</small>
74</h1><!-- doxytag: class="itpp::Freq_Filt" --><a class="el" href="classitpp_1_1Freq__Filt.html" title="Freq_Filt Frequency domain filtering using the overlap-add techniqueThe Freq_Filt...">Freq_Filt</a> Frequency domain filtering using the overlap-add technique<p>
75The <a class="el" href="classitpp_1_1Freq__Filt.html" title="Freq_Filt Frequency domain filtering using the overlap-add techniqueThe Freq_Filt...">Freq_Filt</a> class implements an FFT based filter using the overlap-add technique. The data is filtered by first transforming the input sequence into the frequency domain with an efficient FFT implementation (i.e. FFTW) and then multiplied with a Fourier transformed version of the impulse response. The resulting data is then inversed Fourier transformed to return a filtered time domain signal. 
76<a href="#_details">More...</a>
77<p>
78<code>#include &lt;<a class="el" href="freq__filt_8h-source.html">freq_filt.h</a>&gt;</code>
79<p>
80
81<p>
82<a href="classitpp_1_1Freq__Filt-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
83<tr><td></td></tr>
84<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
85<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Freq__Filt.html#566f4527e6d0703a69bc0c18f8ad5965">Freq_Filt</a> ()</td></tr>
86
87<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#566f4527e6d0703a69bc0c18f8ad5965"></a><br></td></tr>
88<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Freq__Filt.html#1d0d4feca98ec7f8886ba2f300e33c1f">Freq_Filt</a> (const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; Num_T &gt; &amp;b, const int xlength)</td></tr>
89
90<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor with initialization of the impulse response <b>b</b><a href="#1d0d4feca98ec7f8886ba2f300e33c1f"></a><br></td></tr>
91<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; Num_T &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Freq__Filt.html#5415257117e474e62813333df29e1058">filter</a> (const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; Num_T &gt; &amp;x, const int strm=0)</td></tr>
92
93<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classitpp_1_1Filter.html" title="Virtual Filter Base Class.The class is templated as follows:.">Filter</a> data in the input vector <b>x</b><a href="#5415257117e474e62813333df29e1058"></a><br></td></tr>
94<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2067b82ebe9adeea1aa01837efe0e994"></a><!-- doxytag: member="itpp::Freq_Filt::get_fft_size" ref="2067b82ebe9adeea1aa01837efe0e994" args="()" -->
95int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Freq__Filt.html#2067b82ebe9adeea1aa01837efe0e994">get_fft_size</a> ()</td></tr>
96
97<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return FFT size. <br></td></tr>
98<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="09167ad3fd01177e833a6aa92ebe8544"></a><!-- doxytag: member="itpp::Freq_Filt::get_blk_size" ref="09167ad3fd01177e833a6aa92ebe8544" args="()" -->
99int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Freq__Filt.html#09167ad3fd01177e833a6aa92ebe8544">get_blk_size</a> ()</td></tr>
100
101<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the data block size. <br></td></tr>
102<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="76d3952d1a349fa2a1c5fbc9248e5318"></a><!-- doxytag: member="itpp::Freq_Filt::~Freq_Filt" ref="76d3952d1a349fa2a1c5fbc9248e5318" args="()" -->
103&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Freq__Filt.html#76d3952d1a349fa2a1c5fbc9248e5318">~Freq_Filt</a> ()</td></tr>
104
105<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <br></td></tr>
106</table>
107<hr><a name="_details"></a><h2>Detailed Description</h2>
108<h3>template&lt;class Num_T&gt;<br>
109 class itpp::Freq_Filt&lt; Num_T &gt;</h3>
110
111<a class="el" href="classitpp_1_1Freq__Filt.html" title="Freq_Filt Frequency domain filtering using the overlap-add techniqueThe Freq_Filt...">Freq_Filt</a> Frequency domain filtering using the overlap-add technique<p>
112The <a class="el" href="classitpp_1_1Freq__Filt.html" title="Freq_Filt Frequency domain filtering using the overlap-add techniqueThe Freq_Filt...">Freq_Filt</a> class implements an FFT based filter using the overlap-add technique. The data is filtered by first transforming the input sequence into the frequency domain with an efficient FFT implementation (i.e. FFTW) and then multiplied with a Fourier transformed version of the impulse response. The resulting data is then inversed Fourier transformed to return a filtered time domain signal.
113<p>
114<a class="el" href="classitpp_1_1Freq__Filt.html" title="Freq_Filt Frequency domain filtering using the overlap-add techniqueThe Freq_Filt...">Freq_Filt</a> is a templated class. The template paramter <code>Num_T</code> defines the data type for the impulse response <code>b</code>, input data <code>x</code> and output data <code>y</code>.<p>
115The class constructor chooses an optimal FFT length and data block size that minimizes execution time.<p>
116For example, <div class="fragment"><pre class="fragment">  vec b = <span class="stringliteral">"1 2 3 4"</span>;
117  Freq_Filt&lt;double&gt; FF(b,8000);
118</pre></div><p>
119where 8000 corresponds to the expected vector length of the data to be filtered. The actual number of elements does not have to be exact, but it should be close.<p>
120Here is a complete example: <div class="fragment"><pre class="fragment">  vec b = <span class="stringliteral">"1 2 3 4"</span>;
121  vec x(20);
122  x(0) = 1;
123
124  <span class="comment">// Define a filter object for doubles</span>
125  Freq_Filt&lt;double&gt; FF(b,x.length());
126
127  <span class="comment">// Filter the data</span>
128  vec y = FF.filter(x);
129
130  <span class="comment">// Check the FFT and block sizes that were used</span>
131  <span class="keywordtype">int</span> fftsize = FF.getFFTSize();
132  <span class="keywordtype">int</span> blk = FF.getBlkSize();
133</pre></div><p>
134To facilitate large data sets the <a class="el" href="classitpp_1_1Freq__Filt.html" title="Freq_Filt Frequency domain filtering using the overlap-add techniqueThe Freq_Filt...">Freq_Filt</a> class has a streaming option. In this mode of operation data history is internally stored. This allows the class to be used for large data sets that are read from disk or streamed in real-time.<p>
135<div class="fragment"><pre class="fragment">  <span class="keywordtype">bool</span> stream = <span class="keyword">true</span>;
136  vec b = <span class="stringliteral">"1 2 3 4"</span>;
137  Freq_Filt&lt;double&gt; FF(b,1000);
138
139  vec x,y;
140  <span class="keywordflow">while</span>(!EOF) {
141  x = <span class="stringliteral">"read buffer of data"</span>;
142  y = FF.filter(x,stream);
143  cout &lt;&lt; &lt;&lt; endl;
144  }
145</pre></div> <hr><h2>Constructor &amp; Destructor Documentation</h2>
146<a class="anchor" name="566f4527e6d0703a69bc0c18f8ad5965"></a><!-- doxytag: member="itpp::Freq_Filt::Freq_Filt" ref="566f4527e6d0703a69bc0c18f8ad5965" args="()" -->
147<div class="memitem">
148<div class="memproto">
149<div class="memtemplate">
150template&lt;class Num_T &gt; </div>
151      <table class="memname">
152        <tr>
153          <td class="memname"><a class="el" href="classitpp_1_1Freq__Filt.html">itpp::Freq_Filt</a>&lt; Num_T &gt;::<a class="el" href="classitpp_1_1Freq__Filt.html">Freq_Filt</a>           </td>
154          <td>(</td>
155          <td class="paramname">          </td>
156          <td>&nbsp;)&nbsp;</td>
157          <td><code> [inline]</code></td>
158        </tr>
159      </table>
160</div>
161<div class="memdoc">
162
163<p>
164Constructor.
165<p>
166The empty constructor makes it possible to have other container objects of the <a class="el" href="classitpp_1_1Freq__Filt.html" title="Freq_Filt Frequency domain filtering using the overlap-add techniqueThe Freq_Filt...">Freq_Filt</a> class
167</div>
168</div><p>
169<a class="anchor" name="1d0d4feca98ec7f8886ba2f300e33c1f"></a><!-- doxytag: member="itpp::Freq_Filt::Freq_Filt" ref="1d0d4feca98ec7f8886ba2f300e33c1f" args="(const Vec&lt; Num_T &gt; &amp;b, const int xlength)" -->
170<div class="memitem">
171<div class="memproto">
172<div class="memtemplate">
173template&lt;class Num_T &gt; </div>
174      <table class="memname">
175        <tr>
176          <td class="memname"><a class="el" href="classitpp_1_1Freq__Filt.html">itpp::Freq_Filt</a>&lt; Num_T &gt;::<a class="el" href="classitpp_1_1Freq__Filt.html">Freq_Filt</a>           </td>
177          <td>(</td>
178          <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; Num_T &gt; &amp;&nbsp;</td>
179          <td class="paramname"> <em>b</em>, </td>
180        </tr>
181        <tr>
182          <td class="paramkey"></td>
183          <td></td>
184          <td class="paramtype">const int&nbsp;</td>
185          <td class="paramname"> <em>xlength</em></td><td>&nbsp;</td>
186        </tr>
187        <tr>
188          <td></td>
189          <td>)</td>
190          <td></td><td></td><td><code> [inline]</code></td>
191        </tr>
192      </table>
193</div>
194<div class="memdoc">
195
196<p>
197Constructor with initialization of the impulse response <b>b</b>.
198<p>
199Create a filter object with impulse response <b>b</b>. The FFT size and data block size are also initialized. <div class="fragment"><pre class="fragment">    vec b = <span class="stringliteral">"1 2 3 4"</span>;
200    vec x(20);
201    <a class="code" href="classitpp_1_1Freq__Filt.html#566f4527e6d0703a69bc0c18f8ad5965" title="Constructor.">Freq_Filt</a> FF(b,x.length());
202</pre></div> 
203</div>
204</div><p>
205<hr><h2>Member Function Documentation</h2>
206<a class="anchor" name="5415257117e474e62813333df29e1058"></a><!-- doxytag: member="itpp::Freq_Filt::filter" ref="5415257117e474e62813333df29e1058" args="(const Vec&lt; Num_T &gt; &amp;x, const int strm=0)" -->
207<div class="memitem">
208<div class="memproto">
209<div class="memtemplate">
210template&lt;class Num_T &gt; </div>
211      <table class="memname">
212        <tr>
213          <td class="memname"><a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; Num_T &gt; <a class="el" href="classitpp_1_1Freq__Filt.html">itpp::Freq_Filt</a>&lt; Num_T &gt;::filter           </td>
214          <td>(</td>
215          <td class="paramtype">const <a class="el" href="classitpp_1_1Vec.html">Vec</a>&lt; Num_T &gt; &amp;&nbsp;</td>
216          <td class="paramname"> <em>x</em>, </td>
217        </tr>
218        <tr>
219          <td class="paramkey"></td>
220          <td></td>
221          <td class="paramtype">const int&nbsp;</td>
222          <td class="paramname"> <em>strm</em> = <code>0</code></td><td>&nbsp;</td>
223        </tr>
224        <tr>
225          <td></td>
226          <td>)</td>
227          <td></td><td></td><td><code> [inline]</code></td>
228        </tr>
229      </table>
230</div>
231<div class="memdoc">
232
233<p>
234<a class="el" href="classitpp_1_1Filter.html" title="Virtual Filter Base Class.The class is templated as follows:.">Filter</a> data in the input vector <b>x</b>.
235<p>
236Filters data in batch mode or streaming mode <div class="fragment"><pre class="fragment">    FF.filter(x); <span class="comment">// Filters data in batch mode</span>
237    FF.filter(x,1); <span class="comment">// Filters data in streaming mode</span>
238</pre></div> 
239<p>References <a class="el" href="vec_8h-source.html#l00275">itpp::Vec&lt; Num_T &gt;::length()</a>.</p>
240
241</div>
242</div><p>
243<hr>The documentation for this class was generated from the following file:<ul>
244<li><a class="el" href="freq__filt_8h-source.html">freq_filt.h</a></ul>
245</div>
246<hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:19 2009 for mixpp by&nbsp;
247<a href="http://www.doxygen.org/index.html">
248<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
249</body>
250</html>
Note: See TracBrowser for help on using the browser.