Revision as of 08:32, 1 December 2018 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Original file(2,366 × 564 pixels, file size: 135 KB, MIME type: image/jpeg)

Test of implementation of the CosFT through CFT:

Explicit plot of the self-CosFT function $y\!=\!\exp(-x^2/2)$, dark green curve,

its representation at the discrete set of $N\!+\!1$ nodes with $N\!=4$, thick light red segmented line,

the approximation of the CosFT transform with CFT, thin black segmented line.

The small number of nodes is taken in order to see difference between the smooth function and its discrete representation.

The deviation of the representation at the discrete mesh from its CFT transform is still small, of order of $10^{-3}$, and it is difficult to see even at the high resolution of the image, it is much smaller than thickness of the lines.

C++ generator of curves

// Files scft.cin and ado.cin should be loaded in order to compile the test below:

#include <stdio.h>
#include <math.h>
#include "scft.cin"
#include "ado.cin"
#define NP 4
int main(){ int i; double a[NP+1],b[NP+1]; double d=sqrt(M_PI/NP); double x,y; FILE *o;
for(i=0;i<=NP;i++){ x=i*d; a[i]=b[i]=exp(-.5*x*x); }
for(i=0;i<NP;i++) { b[i]*=sqrt(2./NP); printf("%2d %19.14lf %19.14lf %19.14lf\n",i,a[i],b[i], b[i]-a[i]);}
o=fopen("cosftes04.eps","w"); ado(o,570,140);
#define M(x,y) fprintf(o,"%9.4lf %9.4lf M\n",x+0.,y+0.);
#define L(x,y) fprintf(o,"%9.4lf %9.4lf L\n",x+0.,y+0.);
fprintf(o,"10 10 translate 100 100 scale 2 setlinecap 1 setlinejoin\n");
fprintf(o,".007 W S\n");
for(i=0;i<110;i++){ x=.05*i; y=exp(-.5*x*x);if(i==0)M(x,y) else L(x,y);} fprintf(o,".009 W 0 .5 0 RGB S\n");
for(i=0;i<=NP;i++){ x=d*i; y=a[i]; if(i==0)M(x,y) else L(x,y);} fprintf(o,".04 W 1 0 .5 RGB S\n");
for(i=0;i<=NP;i++){ x=d*i; y=b[i]; if(i==0)M(x,y) else L(x,y);} fprintf(o,".015 W 0 0 0 RGB S\n");
fprintf(o,"showpage\n%c%cTrailer\n",'%','%'); fclose(o);
system("epstopdf cosftes04.eps");
system( "open cosftes04.pdf");

Latex generator of labels

\paperwidth 570pt
\paperheight 136pt
\textwidth 420pt
\textheight 300pt
\topmargin -108pt
\oddsidemargin -73pt
\newcommand \ds {\displaystyle}
\newcommand \sx {\scalebox}
\newcommand \rme {\mathrm{e}}
\newcommand \rot {\begin{rotate}}
\newcommand \ero {\end{rotate}}
\newcommand \ing {\includegraphics}
\parindent 0pt
\put(.6,120){\sx{1.25}{$y\!=\!\exp(-x^2/2)$ and its discrete representation with CFT at $N\!= 4$}}
\put(.6, 5){\sx{1.3}{$0$}}


File history

Click on a date/time to view the file as it appeared at that time.

current06:11, 1 December 2018Thumbnail for version as of 06:11, 1 December 20182,366 × 564 (135 KB)Maintenance script (talk | contribs)Importing image file
  • You cannot overwrite this file.

The following page links to this file: