/usr/share/doc/mffm-fftw-dev/html/real2DFFTExample_8cc-example.html is in mffm-fftw-dev 1.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MFFM FFTw Wrapper: real2DFFTExample.cc</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.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>real2DFFTExample.cc</h1><p>This is an example of how to use the class.</p>
<div class="fragment"><pre class="fragment"><span class="comment">/* Copyright 2001,2002 Matt Flax <flatmax@ieee.org></span>
<span class="comment"> This file is part of the MFFM FFTw Wrapper library.</span>
<span class="comment"></span>
<span class="comment"> MFFM MFFM FFTw Wrapper library is free software; you can </span>
<span class="comment"> redistribute it and/or modify</span>
<span class="comment"> it under the terms of the GNU General Public License as published by</span>
<span class="comment"> the Free Software Foundation; either version 2 of the License, or</span>
<span class="comment"> (at your option) any later version.</span>
<span class="comment"> </span>
<span class="comment"> MFFM FFTw Wrapper library is distributed in the hope that it will be useful,</span>
<span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="comment"> GNU General Public License for more details.</span>
<span class="comment"> </span>
<span class="comment"> You have received a copy of the GNU General Public License</span>
<span class="comment"> along with the MFFM FFTw Wrapper library</span>
<span class="comment">*/</span>
<span class="preprocessor">#include <string.h></span>
<span class="preprocessor">#include "real2DFFT.H"</span>
<span class="preprocessor">#include <iostream></span>
<span class="keyword">using namespace </span>std;
<span class="keywordtype">int</span> main(<span class="keywordtype">void</span>){
<span class="keywordtype">int</span> x=8, y=8;
<a name="_a0"></a><a class="code" href="classreal2DFFTData.html" title="class real2DFFTData controls and manipulates real 2D fft data">real2DFFTData</a> *fftData = <span class="keyword">new</span> <a class="code" href="classreal2DFFTData.html" title="class real2DFFTData controls and manipulates real 2D fft data">real2DFFTData</a>(x,y);
<a name="_a1"></a><a class="code" href="classreal2DFFT.html" title="class real2DFFT controls fftw plans and executes fwd/inv transforms">real2DFFT</a> *fft= <span class="keyword">new</span> <a class="code" href="classreal2DFFT.html" title="class real2DFFT controls fftw plans and executes fwd/inv transforms">real2DFFT</a>(fftData);
<span class="comment">// clear the data</span>
fftData-><a name="a2"></a><a class="code" href="classreal2DFFTData.html#abb4fbda6a7111741c130f22dede76828" title="Zeros the in array.">clearInput</a>();
fftData-><a name="a3"></a><a class="code" href="classreal2DFFTData.html#a7de72cd88625f3f4383beefb869b5fd0" title="Zeros the out awway.">clearOutput</a>();
<span class="keywordtype">int</span> temp=x/2, temp2=y/2;
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0;j<x;j++)
fftData-><a name="a4"></a><a class="code" href="classreal2DFFTData.html#aee22ddba7091e4c0a964b7aeb0a7a9d0" title="The input data and power spectrum.">in</a>[temp2+j*x]=10000.0;
for (<span class="keywordtype">int</span> j=0;j<y;j++)
fftData-><a class="code" href="classreal2DFFTData.html#aee22ddba7091e4c0a964b7aeb0a7a9d0" title="The input data and power spectrum.">in</a>[temp*y+j]=10000.0;
<span class="comment">// fftData->in[temp*y+(y-1)/2]=20000.0;</span>
for (<span class="keywordtype">int</span> i=0;i<fftData-><a name="a5"></a><a class="code" href="classreal2DFFTData.html#a0f7050e9cf0270ea0f15f4b8399c2d57" title="The row count.">getXSize</a>();i++){
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0;j<fftData-><a name="a6"></a><a class="code" href="classreal2DFFTData.html#a6cc42bdfe90c9ba98101abf70b378e37" title="The column count.">getYSize</a>();j++)
cout<<fftData-><a class="code" href="classreal2DFFTData.html#aee22ddba7091e4c0a964b7aeb0a7a9d0" title="The input data and power spectrum.">in</a>[i*x+j]<<<span class="charliteral">'\t'</span>;
cout<<endl;
}
cout<<<span class="charliteral">'\n'</span><<endl;
fft-><a name="a7"></a><a class="code" href="classreal2DFFT.html#a3f4d33763292c212de65dd197f226fdf" title="Forward transform the data (in to out).">fwdTransform</a>();
fftData-><a name="a8"></a><a class="code" href="classreal2DFFTData.html#a77b3acac87b8920b1f2700eb85d4e466" title="Scales the output down by the number of elements.">reScale</a>();
fftData-><a name="a9"></a><a class="code" href="classreal2DFFTData.html#a8768cf3a25b1b89b5ea6c8727126cf44" title="This function computes the power spectrum and updates the totalPower, maxPower and...">compPowerSpec</a>();
fft-><a name="a10"></a><a class="code" href="classreal2DFFT.html#ad90b1e857721789e73c1ed5a9b4c0017" title="Inverse transform the data (out to in).">invTransform</a>();
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0;i<fftData-><a class="code" href="classreal2DFFTData.html#a0f7050e9cf0270ea0f15f4b8399c2d57" title="The row count.">getXSize</a>();i++){
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0;j<fftData-><a class="code" href="classreal2DFFTData.html#a6cc42bdfe90c9ba98101abf70b378e37" title="The column count.">getYSize</a>();j++)
cout<<fftData-><a class="code" href="classreal2DFFTData.html#aee22ddba7091e4c0a964b7aeb0a7a9d0" title="The input data and power spectrum.">in</a>[i*x+j]<<<span class="charliteral">'\t'</span>;
cout<<endl;
}
cout<<<span class="charliteral">'\n'</span><<endl;
<span class="comment">/* for (int i=0;i<fftData.getXSize();i++){</span>
<span class="comment"> for (int j=0;j<fftData.getYHalfSize();j++)</span>
<span class="comment"> cout<<fftData.out[i][j].im<<'\t';</span>
<span class="comment"> cout<<endl;</span>
<span class="comment"> }*/</span>
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0;i<x;i++){
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0;j<y/2+1;j++)
cout<<fftData-><a name="a11"></a>power[i*(y/2+1)+j]<<<span class="charliteral">'\t'</span>;
cout<<endl;
}
<span class="keyword">delete</span> fftData;
<span class="keyword">delete</span> fft;
}
</pre></div> </div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Thu Dec 17 00:33:56 2009 for MFFM FFTw Wrapper by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>
|