<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>NMath FFT example Archives - CenterSpace</title>
	<atom:link href="https://www.centerspace.net/tag/nmath-fft-example/feed" rel="self" type="application/rss+xml" />
	<link>https://www.centerspace.net/tag/nmath-fft-example</link>
	<description>.NET numerical class libraries</description>
	<lastBuildDate>Mon, 15 Feb 2010 18:04:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
<site xmlns="com-wordpress:feed-additions:1">104092929</site>	<item>
		<title>High Performance FFT in NMath 4.0</title>
		<link>https://www.centerspace.net/high-performance-fft-coming-in-the-next-release</link>
					<comments>https://www.centerspace.net/high-performance-fft-coming-in-the-next-release#respond</comments>
		
		<dc:creator><![CDATA[Paul Shirkey]]></dc:creator>
		<pubDate>Wed, 02 Sep 2009 23:41:45 +0000</pubDate>
				<category><![CDATA[NMath]]></category>
		<category><![CDATA[FFT]]></category>
		<category><![CDATA[FFT in .NET]]></category>
		<category><![CDATA[NMath FFT example]]></category>
		<category><![CDATA[Non power of 2 FFT]]></category>
		<category><![CDATA[Real FFT packing]]></category>
		<guid isPermaLink="false">http://www.centerspace.net/blog/?p=160</guid>

					<description><![CDATA[<p>High performance, multi-core aware, FFT class set will be offered in the upcoming NMath 4.0 release.</p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/high-performance-fft-coming-in-the-next-release">High Performance FFT in NMath 4.0</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The next release of Center Space&#8217;s NMATH .NET libraries will contain high performance, multi-core aware, fast fourier transform classes.  This set of classes will elegantly support all common 1D and 2D FFT computations in a robust easy to use object-oriented interface.</p>
<p>The following FFT classes will be available.</p>
<p><code></p>
<ul>
<li>DoubleComplexForward1DFFT</li>
<li>DoubleComplexBackward1DFFT</li>
<li>DoubleComplexForward2DFFT</li>
<li>DoubleComplexBackward2DFFT</li>
<li>DoubleForward1DFFT</li>
<li>DoubleSymmetricBackward1DFFT</li>
<li>DoubleForward2DFFT</li>
<li>DoubleGeneral1DFFT (for computing FFT's of data with offset &amp; strided memory layouts)</li>
</ul>
<p></code></p>
<p>All classes efficiently support FFT&#8217;s of arbitrary length, with a simple interface for both in-place and out-of-place computations.  Additionally, there is a parallel set of classes for single precision computation.</p>
<h3> Example </h3>
<p>Here is a simple example computing a 1000-point forward 1D FFT.</p>
<p><code><br />
// Create some random signal data.<br />
RandomNumberGenerator rand = new RandGenMTwist(427);<br />
DoubleVector data = new DoubleVector(1000, rand);</p>
<p>// Create the 1D real FFT instance<br />
DoubleForward1DFFT fft1000 =<br />
       new DoubleForward1DFFT(1000);</p>
<p>// Compute the FFT<br />
fft1000.FFTInPlace(data);<br />
</code></p>
<p>The FFT of Real (non-Complex) data results in a FFT signal of complex-conjugate symmetric data.  For memory efficiency this is returned to the user in a packed format (making in-place computation possible).  To facilitate the unpacking of this data, signal reader classes are supplied that support random-access indexers into the packed data.  Continuing with the example above.<br />
<code><br />
// Ask the FFT instance for the correct reader,<br />
// passing in the FFT data.<br />
DoubleSymmetricSignalReader reader<br />
    = fft1000.GetSignalReader(data);</p>
<p>// Now we can access any element from the<br />
// packed complex-conjugate symmetric FFT data set<br />
// using common random-access index sematics.<br />
DoubleComplex thirdelement = reader[2];</p>
<p>// Also the entire result can be unpacked<br />
DoubleComplex[] unpackedfft =<br />
 reader.UnpackFullToArray();<br />
</code></p>
<p>The readers are not necessary for the Complex versions of the FFT classes because FFT&#8217;s of Complex data is Complex and so no data packing is possible (for memory savings).</p>
<h3> Packing Format Notes </h3>
<p>As mentioned above, the Fourier transform of a real signal, results in a complex-conjugate symmetric signal.  This symmetry is used by CenterSpace to pack the Fourier transform into an array which is the same size as the signal array.</p>
<p>The following table describes the layout of the packed complex-conjugate symmetric signal, of length N, in one dimension.</p>
<table>
<tr> <em> For N even </em></p>
<tr> <img decoding="async" src="http://latex.codecogs.com/gif.latex?[ \ R_0 \ R_1 \ I_1 \ R_2 \ I_2 ... I_{N/2-1} \ R_{N/2} \ ]" title="[ \ R_0 \ R_1 \ I_1 \ R_2 \ I_2 ... I_{N/2-1} \ R_{N/2} \ ]" /></p>
<tr> <em> For N odd </em></p>
<tr> <img decoding="async" src="http://latex.codecogs.com/gif.latex?[ \ R_0 \ R_1 \ I_1 \ R_2 \ I_2 ... R_{{(N-1)\over{2}}-1} \ I_{{(N-1)\over{2}}-1} \ R_{(N-1)\over{2}} \ I_{(N-1)\over{2}} ]" title="[ \ R_0 \ R_1 \ I_1 \ R_2 \ I_2 ... R_{{(N-1)\over{2}}-1} \ I_{{(N-1)\over{2}}-1} \ R_{(N-1)\over{2}} \ I_{(N-1)\over{2}} ]" /><br />
</table>
<p>If we were to unroll the array, where each element in the array contains alternating real and complex values, for the case of N even, we would have an array of length 2*N.</p>
<table>
<tr>
<img decoding="async" src="http://latex.codecogs.com/gif.latex?\small [ \ R_0 \ R_1 \ I_1 \ R_2 \ I_2 ... I_{N/2-1} \ R_{N/2} \ R_{N/2-1} \ -I_{N/2-1} ... \ R_2 \ -I_2 \ R_1 \ -I_1 ]" title="\small [ \ R_0 \ R_1 \ I_1 \ R_2 \ I_2 ... I_{N/2-1} \ R_{N/2} \ R_{N/2-1} \ -I_{N/2-1} ... \ R_2 \ -I_2 \ R_1 \ -I_1 ]" /><br />
</table>
<p>The complexities of the packing in two dimensions increase substantially, and will not be recorded here.  All NMath FFT users are encourage to use the readers to unwind packed results.  Not only does this reduce coding complexity, if the underlying packing format changes, the readers will still provide the expected functionality.</p>
<p>Finally, when inverting complex-conjugate symmetric signals, using the <code> DoubleSymmetricBackward1DFFT </code> class, the input signals are expect be packed.</p>
<p>
<em> -Paul </em></p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/high-performance-fft-coming-in-the-next-release">High Performance FFT in NMath 4.0</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.centerspace.net/high-performance-fft-coming-in-the-next-release/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">160</post-id>	</item>
	</channel>
</rss>
