<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic FFT CCS format - 1D Fourier series in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-CCS-format-1D-Fourier-series/m-p/766214#M255</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am computing the FFT of a real-valued 1D function in N discrete points. After computing the coefficients, stored in CCS format in array "y", I'd like to evaluate the Fourier series with something like:&lt;BR /&gt;&lt;BR /&gt;double Y;&lt;BR /&gt;&lt;BR /&gt;for ( i = 0; i &amp;lt; 1000; i++ ) {&lt;BR /&gt; Y = y[0]/N;&lt;BR /&gt; for ( j = 1; j &amp;lt;= N/2; j++ )&lt;BR /&gt;  Y += y[j*2+0]*2.0/N*cos(2.0*PI*j*i/n) - y[j*2+1]*2.0/N*sin(2.0*PI*j*i/n);&lt;BR /&gt; for ( j = N/2+1; j &amp;lt; N; j++ )&lt;BR /&gt; Y += y[(N-j)*2+0]*2.0/N*cos(2.0*PI*j*i/n) + y[(N-j)*2+1]*2.0/N*sin(2.0*PI*j*i/n);&lt;BR /&gt;&lt;BR /&gt; // approximated function value now in Y ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;As I understand, the CCS format stores the half of the symmetric conjugate-even sequence. Accordingly, I do two loops to get the full sequence for one value of the approximate function. However, I get very oscillatory results, so obviously something is wrong with the scaling and/or with the indexing of the coefficient-array.&lt;BR /&gt;&lt;BR /&gt;Could someone point me to the right direction?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Jozsef&lt;BR /&gt;</description>
    <pubDate>Mon, 09 Aug 2010 19:52:33 GMT</pubDate>
    <dc:creator>Jozsef</dc:creator>
    <dc:date>2010-08-09T19:52:33Z</dc:date>
    <item>
      <title>FFT CCS format - 1D Fourier series</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-CCS-format-1D-Fourier-series/m-p/766214#M255</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am computing the FFT of a real-valued 1D function in N discrete points. After computing the coefficients, stored in CCS format in array "y", I'd like to evaluate the Fourier series with something like:&lt;BR /&gt;&lt;BR /&gt;double Y;&lt;BR /&gt;&lt;BR /&gt;for ( i = 0; i &amp;lt; 1000; i++ ) {&lt;BR /&gt; Y = y[0]/N;&lt;BR /&gt; for ( j = 1; j &amp;lt;= N/2; j++ )&lt;BR /&gt;  Y += y[j*2+0]*2.0/N*cos(2.0*PI*j*i/n) - y[j*2+1]*2.0/N*sin(2.0*PI*j*i/n);&lt;BR /&gt; for ( j = N/2+1; j &amp;lt; N; j++ )&lt;BR /&gt; Y += y[(N-j)*2+0]*2.0/N*cos(2.0*PI*j*i/n) + y[(N-j)*2+1]*2.0/N*sin(2.0*PI*j*i/n);&lt;BR /&gt;&lt;BR /&gt; // approximated function value now in Y ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;As I understand, the CCS format stores the half of the symmetric conjugate-even sequence. Accordingly, I do two loops to get the full sequence for one value of the approximate function. However, I get very oscillatory results, so obviously something is wrong with the scaling and/or with the indexing of the coefficient-array.&lt;BR /&gt;&lt;BR /&gt;Could someone point me to the right direction?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Jozsef&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Aug 2010 19:52:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-CCS-format-1D-Fourier-series/m-p/766214#M255</guid>
      <dc:creator>Jozsef</dc:creator>
      <dc:date>2010-08-09T19:52:33Z</dc:date>
    </item>
    <item>
      <title>FFT CCS format - 1D Fourier series</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-CCS-format-1D-Fourier-series/m-p/766215#M256</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;For N even: CCS-result contains&lt;BR /&gt;&lt;TABLE frame="hsides" border="1" rules="all" cellpadding="4" id="tbl11-9" class="AllLineStandard"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;FFT Real&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="13%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n-2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="11%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n-1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e161 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n+1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;CCS&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;R&lt;SUB&gt;0&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;R&lt;SUB&gt;1&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;I&lt;SUB&gt;1&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;...&lt;/P&gt;&lt;/TD&gt;&lt;TD width="13%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;R&lt;SUB&gt;n/2-1&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="11%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;I&lt;SUB&gt;n/2-1&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;R&lt;SUB&gt;n/2&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e161 " align="left" valign="top"&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;For N odd (N=s*2 + 1): CCS-result contains&lt;BR /&gt;&lt;TABLE frame="hsides" border="1" rules="all" cellpadding="4" id="tbl11-9cont" class="AllLineStandard"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="14%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;FFT Real&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="7%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="5%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n-4&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n-3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n-2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n-1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " valign="top"&gt;&lt;P&gt;&lt;STRONG&gt;n+1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;CCS&lt;/P&gt;&lt;/TD&gt;&lt;TD width="7%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;R&lt;SUB&gt;0&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;R&lt;SUB&gt;1&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;I&lt;SUB&gt;1&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="5%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;...&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;I&lt;SUB&gt;s-2&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;R&lt;SUB&gt;s-1&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="9%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;I&lt;SUB&gt;s-1&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;R&lt;SUB&gt;s&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;I&lt;SUB&gt;s&lt;/SUB&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="8%" headers="d255e351 " align="left" valign="top"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;So, CCS-format has N+2 elements which should be taken into account.&lt;BR /&gt;&lt;BR /&gt;As to your function, I haveseveral questions:&lt;BR /&gt;1) why &lt;STRONG&gt;Y = y[0]/N;&lt;/STRONG&gt; is inside of i-loop? So in every iteratin Y value is reset...&lt;BR /&gt;2) why N and n ? But, N is number of points...&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Aug 2010 09:18:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-CCS-format-1D-Fourier-series/m-p/766215#M256</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2010-08-10T09:18:52Z</dc:date>
    </item>
    <item>
      <title>FFT CCS format - 1D Fourier series</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-CCS-format-1D-Fourier-series/m-p/766216#M257</link>
      <description>Victor,&lt;BR /&gt;&lt;BR /&gt;1) why &lt;B&gt;Y = y[0]/N;&lt;/B&gt; is inside of i-loop? So in every iteratin Y value is reset...&lt;BR /&gt;&lt;BR /&gt;The i-loop goes over the domain on which I am evaluating the series: n=1000 points, so it's nice and smooth to plot. The i-loop should look like (my mistake)&lt;BR /&gt;&lt;BR /&gt;for ( i = 0; i &amp;lt; n; i++ )&lt;BR /&gt;&lt;BR /&gt;2) why N and n ? But, N is number of points...&lt;BR /&gt;&lt;BR /&gt;N would be the number of discrete points of the finite series approximation.&lt;BR /&gt;&lt;BR /&gt;-------&lt;BR /&gt;Let me try to give a simple example of what I'm trying to do:&lt;BR /&gt;&lt;BR /&gt;Let the input function be sin(x) of which I'm evaluating at N=4 discrete points over the interval x=[0...1), to get the discrete sequence:&lt;BR /&gt;&lt;BR /&gt;double y[N+2];&lt;BR /&gt;&lt;BR /&gt;for ( i = 0; i &amp;lt; N; i++ )&lt;BR /&gt; y&lt;I&gt; = sin(2.0*PI*i/N);&lt;BR /&gt;&lt;BR /&gt;which fills the first N elements of the array as y[] = {0.0, 1.0, 0.0, -1.0}.&lt;BR /&gt;&lt;BR /&gt;Then, I do an in-place forward transform and I get the CCS array:&lt;BR /&gt;&lt;BR /&gt;y[] = {0.0, 0.0, -0.0, -2.0, 0.0, 0.0},&lt;BR /&gt;&lt;BR /&gt;which is to be interpreted as the complex sequence of (N+2)/2 = 3 complex numbers as&lt;BR /&gt;&lt;BR /&gt;Z[] ={ 0.00+0.00i, -0.00-2.00i, 0.00+0.00i}.&lt;BR /&gt;&lt;BR /&gt;Now, if I understand correctly, the above array Z contains:&lt;BR /&gt;- the first complex coefficient: R0 + 0.0i = 0.0 + 0.0i,&lt;BR /&gt;- the first half of the full sequence, which for N=4 is: R1 + I1 = -0.0 - 2.0i and R2 + I2 = 0.0 + 0.0i,&lt;BR /&gt;- plus the (would-be-redundant) symmetric conjugate half "sequence": R3 + I3 = -0.0 + 2.0i.&lt;BR /&gt;&lt;BR /&gt;I think so far my interpretation is correct and this is the correct result.&lt;BR /&gt;&lt;BR /&gt;Now, my question is how to interpret (and use) this sequence to evaluate the first N members of the sum in the discrete Fourier series:&lt;BR /&gt;&lt;BR /&gt;f(x) ~ sin(x) = sum_{j=0}^{N-1} Z_j * exp(2 * PI * i * j * x).&lt;BR /&gt;&lt;BR /&gt;(I'm evaluating the x in n=1000 discrete points with the i-loop just to plot f(x).)&lt;BR /&gt;&lt;BR /&gt;Maybe j should go from -N/2 to N/2-1 ?&lt;BR /&gt;&lt;BR /&gt;Thanks for your help,&lt;BR /&gt;Jozsef&lt;/I&gt;</description>
      <pubDate>Tue, 10 Aug 2010 14:30:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-CCS-format-1D-Fourier-series/m-p/766216#M257</guid>
      <dc:creator>Jozsef</dc:creator>
      <dc:date>2010-08-10T14:30:41Z</dc:date>
    </item>
    <item>
      <title>FFT CCS format - 1D Fourier series</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-CCS-format-1D-Fourier-series/m-p/766217#M258</link>
      <description>Oh ok. I figured it out in the end. I didn't exactly understand how I'm supposed to traverse the half-sequence and from which direction. Here is a piece of code that does what I needed:&lt;BR /&gt;&lt;BR /&gt;// suppose result of FFT in y[] in CCS format&lt;BR /&gt;&lt;BR /&gt;// now evaluate the discrete Fourier series at n locations&lt;BR /&gt;&lt;BR /&gt;int j, k;&lt;BR /&gt;double Y;&lt;BR /&gt;&lt;BR /&gt;for ( j = 0; j &amp;lt; n; j++ )&lt;BR /&gt;{&lt;BR /&gt; Y =0.0;&lt;BR /&gt; for ( k = -N/2; k &amp;lt; N/2; k++ )&lt;BR /&gt; {&lt;BR /&gt;  Y += y[abs(k)*2+0]*cos(2.0*PI*j/n*k) - sgn(k)*y[abs(k)*2+1]*sin(2.0*PI*j/n*k);&lt;BR /&gt; // now function value in Y&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Really pretty simple, once one understands it...&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Jozsef</description>
      <pubDate>Tue, 10 Aug 2010 20:46:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-CCS-format-1D-Fourier-series/m-p/766217#M258</guid>
      <dc:creator>Jozsef</dc:creator>
      <dc:date>2010-08-10T20:46:38Z</dc:date>
    </item>
  </channel>
</rss>

