File: realFFTData_8H-source.html

package info (click to toggle)
mffm-fftw 1.7-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 2,480 kB
  • ctags: 1,176
  • sloc: cpp: 711; makefile: 89
file content (102 lines) | stat: -rw-r--r-- 12,729 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>MFFM FFTw Wrapper: realFFTData.H Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
<h1>realFFTData.H</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* Copyright 2001,2002 Matt Flax &lt;flatmax@ieee.org&gt;</span>
<a name="l00002"></a>00002 <span class="comment">   This file is part of the MFFM FFTw Wrapper library.</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment">   MFFM MFFM FFTw Wrapper library is free software; you can </span>
<a name="l00005"></a>00005 <span class="comment">   redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment">   it under the terms of the GNU General Public License as published by</span>
<a name="l00007"></a>00007 <span class="comment">   the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">   (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment">   </span>
<a name="l00010"></a>00010 <span class="comment">   MFFM FFTw Wrapper library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">   but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment">   GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment">   </span>
<a name="l00015"></a>00015 <span class="comment">   You have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment">   along with the MFFM FFTw Wrapper library</span>
<a name="l00017"></a>00017 <span class="comment">*/</span>
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef REALFFTDATA_H_</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define REALFFTDATA_H_</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "realFFT.H"</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;fftw3.h&gt;</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00025"></a>00025 <span class="keyword">using namespace </span>std;
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="preprocessor">#ifndef fftw_real</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define fftw_real double</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00031"></a>00031 <span class="comment">/// class realFFTData controls and manipulates fft data</span>
<a name="l00032"></a><a class="code" href="classrealFFTData.html">00032</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classrealFFTData.html" title="class realFFTData controls and manipulates fft data">realFFTData</a> {<span class="comment"></span>
<a name="l00033"></a>00033 <span class="comment">  /// Var used to specify if the memory was allocated by the realFFTData class</span>
<a name="l00034"></a>00034 <span class="comment"></span>  <span class="keywordtype">int</span> deleteInOutMemory;
<a name="l00035"></a>00035 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00036"></a>00036 <span class="comment">  /// Specifies the size of the data array</span>
<a name="l00037"></a><a class="code" href="classrealFFTData.html#de1ad6037045e29b6d2562f852f178ef">00037</a> <span class="comment"></span>  <span class="keywordtype">int</span> <a class="code" href="classrealFFTData.html#de1ad6037045e29b6d2562f852f178ef" title="Specifies the size of the data array.">size</a>;<span class="comment"></span>
<a name="l00038"></a>00038 <span class="comment">  /// Specifies the minimum and maximum power bins as used in the methods findMaxMinPowerBins and compPowerSpec</span>
<a name="l00039"></a><a class="code" href="classrealFFTData.html#72ac9e7c12055dfbfe0fffdd541973f4">00039</a> <span class="comment"></span>  <span class="keywordtype">int</span> <a class="code" href="classrealFFTData.html#72ac9e7c12055dfbfe0fffdd541973f4" title="Specifies the minimum and maximum power bins as used in the methods findMaxMinPowerBins...">minPowerBin</a>, maxPowerBin;<span class="comment"></span>
<a name="l00040"></a>00040 <span class="comment">  /// the input, output and power_spectrum arrays</span>
<a name="l00041"></a><a class="code" href="classrealFFTData.html#2bf1dadc9fd55d2b1bc5371027c4ac8a">00041</a> <span class="comment"></span>  fftw_real *<a class="code" href="classrealFFTData.html#2bf1dadc9fd55d2b1bc5371027c4ac8a" title="the input, output and power_spectrum arrays">in</a>, *out, *power_spectrum; <span class="comment">//, *powerDeriv; power deriv. removed for now</span><span class="comment"></span>
<a name="l00042"></a>00042 <span class="comment">  /// The total power (summed) of the power spectrum as used in the method compPowerSpec</span>
<a name="l00043"></a><a class="code" href="classrealFFTData.html#aada9a4bc631e8760365c89746359ee6">00043</a> <span class="comment"></span>  <span class="keywordtype">double</span> <a class="code" href="classrealFFTData.html#aada9a4bc631e8760365c89746359ee6" title="The total power (summed) of the power spectrum as used in the method compPowerSpec...">totalPower</a>;
<a name="l00044"></a>00044 <span class="comment"></span>
<a name="l00045"></a>00045 <span class="comment">  /// All memory to be allocated internally</span>
<a name="l00046"></a>00046 <span class="comment"></span>  <a class="code" href="classrealFFTData.html#67afb57ca1d578aa93d0cdcbc2c87bd2" title="All memory to be allocated internally.">realFFTData</a>(<span class="keywordtype">int</span> sz);<span class="comment"></span>
<a name="l00047"></a>00047 <span class="comment">  /// input and output data arrays are to be allocated by another process</span>
<a name="l00048"></a>00048 <span class="comment"></span>  <a class="code" href="classrealFFTData.html#67afb57ca1d578aa93d0cdcbc2c87bd2" title="All memory to be allocated internally.">realFFTData</a>(<span class="keywordtype">int</span> sz, fftw_real*inp, fftw_real*outp);<span class="comment"></span>
<a name="l00049"></a>00049 <span class="comment">  /// Deconstructor</span>
<a name="l00050"></a>00050 <span class="comment"></span>  <a class="code" href="classrealFFTData.html#9f6e45f49bc476117a4ce9ff90acf941" title="Deconstructor.">~realFFTData</a>(<span class="keywordtype">void</span>);
<a name="l00051"></a>00051 <span class="comment"></span>
<a name="l00052"></a>00052 <span class="comment">  /// Limits the maximum to 'lim' and returns the last fft bin with max</span>
<a name="l00053"></a>00053 <span class="comment"></span>  <span class="keywordtype">int</span> <a class="code" href="classrealFFTData.html#6f6d6107bcc3044efb7ec9a7dbbdb265" title="Limits the maximum to &amp;#39;lim&amp;#39; and returns the last fft bin with max.">limitHalfPowerSpec</a>(<span class="keywordtype">double</span> lim); 
<a name="l00054"></a>00054 <span class="comment"></span>
<a name="l00055"></a>00055 <span class="comment">  /// Returns the number of elements in the input and output arrays</span>
<a name="l00056"></a><a class="code" href="classrealFFTData.html#ba8afe3db78cc7f2750e68ad6cf675aa">00056</a> <span class="comment"></span>  <span class="keywordtype">int</span> <a class="code" href="classrealFFTData.html#ba8afe3db78cc7f2750e68ad6cf675aa" title="Returns the number of elements in the input and output arrays.">getSize</a>(<span class="keywordtype">void</span>){<span class="keywordflow">return</span> <a class="code" href="classrealFFTData.html#de1ad6037045e29b6d2562f852f178ef" title="Specifies the size of the data array.">size</a>;}<span class="comment"></span>
<a name="l00057"></a>00057 <span class="comment">  /// Returns the number of elements in the power spectrum array</span>
<a name="l00058"></a><a class="code" href="classrealFFTData.html#a69ac758ccf6419488584c6259b2e29a">00058</a> <span class="comment"></span>  <span class="keywordtype">int</span> <a class="code" href="classrealFFTData.html#a69ac758ccf6419488584c6259b2e29a" title="Returns the number of elements in the power spectrum array.">getHalfSize</a>(<span class="keywordtype">void</span>){ <span class="keywordflow">if</span> (!(<a class="code" href="classrealFFTData.html#de1ad6037045e29b6d2562f852f178ef" title="Specifies the size of the data array.">size</a>%2)) <span class="keywordflow">return</span> <a class="code" href="classrealFFTData.html#de1ad6037045e29b6d2562f852f178ef" title="Specifies the size of the data array.">size</a>/2; <span class="keywordflow">else</span> <span class="keywordflow">return</span> <a class="code" href="classrealFFTData.html#de1ad6037045e29b6d2562f852f178ef" title="Specifies the size of the data array.">size</a>/2+1;}
<a name="l00059"></a>00059 <span class="comment"></span>
<a name="l00060"></a>00060 <span class="comment">  /// Returns the maximum input variable</span>
<a name="l00061"></a>00061 <span class="comment"></span>  fftw_real <a class="code" href="classrealFFTData.html#0a516be7e9334456289adee398a24ee8" title="Returns the maximum input variable.">findMaxIn</a>(<span class="keywordtype">void</span>);<span class="comment"></span>
<a name="l00062"></a>00062 <span class="comment">  /// Fills the max and min power spectrum bins</span>
<a name="l00063"></a>00063 <span class="comment"></span>  <span class="keywordtype">void</span> <a class="code" href="classrealFFTData.html#d5cc6bb701716ec9c25fb19d926da4cc" title="Fills the max and min power spectrum bins.">findMaxMinPowerBins</a>(<span class="keywordtype">void</span>);
<a name="l00064"></a>00064 <span class="comment"></span>
<a name="l00065"></a>00065 <span class="comment">  /// This function computes the power spectrum and returns the max bin</span>
<a name="l00066"></a>00066 <span class="comment"></span>  <span class="keywordtype">int</span> <a class="code" href="classrealFFTData.html#304eac736338b0c7c0bb990ab14d4399" title="This function computes the power spectrum and returns the max bin.">compPowerSpec</a>();<span class="comment"></span>
<a name="l00067"></a>00067 <span class="comment">  /// This function computes the square root of the power spectrum and returns the max bin</span>
<a name="l00068"></a>00068 <span class="comment"></span>  <span class="keywordtype">int</span> <a class="code" href="classrealFFTData.html#803b81e1aa2f367ce7efecfcfdb04308" title="This function computes the square root of the power spectrum and returns the max...">sqrtPowerSpec</a>();
<a name="l00069"></a>00069 
<a name="l00070"></a>00070   <span class="comment">//  int powerSpecDeriv(); // Find the derivative of the power spectrum</span>
<a name="l00071"></a>00071 <span class="comment"></span>
<a name="l00072"></a>00072 <span class="comment">  /// This function zeros the output data array (out)</span>
<a name="l00073"></a>00073 <span class="comment"></span>  <span class="keywordtype">void</span> <a class="code" href="classrealFFTData.html#569439a4bdf72acfdca81437d938f962" title="This function zeros the output data array (out).">zeroFFTData</a>(<span class="keywordtype">void</span>);
<a name="l00074"></a>00074 };
<a name="l00075"></a>00075 <span class="preprocessor">#endif // REALFFTDATA_H_</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Oct 26 11:52:20 2009 for MFFM FFTw Wrapper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>