File:Fafo2test0.png

Test image, used for the demonstration of the Fourier-2 transform and the Fourier-filtering of the images.

The painting is represented at the 32 x 32 grid; the origin of the coordinates is marked with the red cross.

The step of the grid is $\sqrt{\pi/16}=\sqrt{\pi} /4 \approx 0.443$

The figure is generated with the C++ code below. For the compilation, file ado.cin should be loaded to the working directory.

C++ generator
using namespace std;
 * 1) include
 * 2) include
 * 3) include 
 * 4) include
 * 1) define z_type complex
 * 2) define DB double

//#include "fafo.cin"
 * 1) include "ado.cin"


 * 1) define DO(x,y) for(x=0;x= N dx=sqrt(2.*M_PI/M); dy=sqrt(2.*M_PI/N); DO(m,M){ x=dx*(m-M/2.); DO(n,N){ y=dy*(n-N/2.); if(.3*x*x+.2*y*y >2.1) A[n*M+m]=0.; else A[n*M+m]=1.; if(fabs(x)<.8 && fabs(y+1.7)<.3 )  A[n*M+m]-=1.; if( (fabs(x-1.)<.3 || fabs(x+1.)<.3 ) && fabs(y-.8)<.2 )  A[n*M+m]-=1.; }} // Fourier is not performed // DO(m,M){ DO(n,N) b[n]=A[n*M+m]; fafo(b,N,1); DO(n,N) A[n*M+m]=b[n]; } // DO(n,N){ DO(m,M) b[m]=A[n*M+m]; fafo(b,M,1); DO(m,M) A[n*M+m]=b[m]; } fprintf(o,"gsave\n"); fprintf(o,"%2d %2d scale\n",M,N); fprintf(o,"%2d %2d 4 [%2d 0 0 %2d 0 %2d]\n<", M,N,M,-N,N); s=0; DO(m,M) DO(n,N){ t=abs(A[n*M+m]); if(t>s) s=t; } s=15./s; for(n=N-1;n>=0;n--) { fprintf(o,"\n"); DO(m,M){ fprintf(o,"%1x",int(s*abs(A[n*M+m])+.6) ); }} fprintf(o,"\n>\n"); fprintf(o,"image\n"); free(A); fprintf(o,"grestore\n"); M(M/2.+.5,-1); L(M/2+.5,N+1); M(-1,N/2.+.5); L(M+1,N/2.+.5); fprintf(o,"1 0 0 RGB .1 W S\n"); fprintf(o,"showpage\n%c%cTrailer\n",'%','%'); fclose(o); system("epstopdf fafo2test0.eps"); system( "convert fafo2test0.eps fafo2test0.jpg "); system( "convert fafo2test0.eps fafo2test0.gif "); system(  "open fafo2test0.gif"); }
 * 1) define M(x,y) fprintf(o,"%6.3f %6.3f M\n",0.+x,0.+y);
 * 2) define L(x,y) fprintf(o,"%6.3f %6.3f L\n",0.+x,0.+y);

// End of generator.

The EPS version of the image
%!PS-Adobe-2.0 EPSF-2.0 %%BoundingBox: 0 0 642 642 /M {moveto} bind def /L {lineto} bind def /S {stroke} bind def /s {show newpath} bind def /C {closepath} bind def /F {fill} bind def /o {.1 0 360 arc C S} bind def /times-Roman findfont 20 scalefont setfont /W {setlinewidth} bind def /RGB {setrgbcolor} bind def 1 1 translate 10 10 scale gsave 64 64 scale 64 64 4 [64 0 0 -64 0 64] < 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000fffff00000000000000000000000000000 0000000000000000000000000000fffffffff000000000000000000000000000 000000000000000000000000000fffffffffff00000000000000000000000000 00000000000000000000000000fffffffffffff0000000000000000000000000 00000000000000000000000000fffffffffffff0000000000000000000000000 0000000000000000000000000fffffffffffffff000000000000000000000000 0000000000000000000000000fffffffffffffff000000000000000000000000 000000000000000000000000ffff00fffff00ffff00000000000000000000000 000000000000000000000000ffff00fffff00ffff00000000000000000000000 000000000000000000000000fffffffffffffffff00000000000000000000000 000000000000000000000000fffffffffffffffff00000000000000000000000 000000000000000000000000fffffffffffffffff00000000000000000000000 000000000000000000000000fffffffffffffffff00000000000000000000000 000000000000000000000000fffffffffffffffff00000000000000000000000 0000000000000000000000000fffffffffffffff000000000000000000000000 0000000000000000000000000fffff00000fffff000000000000000000000000 00000000000000000000000000ffff00000ffff0000000000000000000000000 00000000000000000000000000fffffffffffff0000000000000000000000000 000000000000000000000000000fffffffffff00000000000000000000000000 0000000000000000000000000000fffffffff000000000000000000000000000 000000000000000000000000000000fffff00000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 > image grestore 32.500 -1.000 M 32.500 65.000 L -1.000 32.500 M 65.000 32.500 L 1 0 0 RGB .1 W S showpage %%Trailer