Mathc complexes/a282
Apparence
Installer et compiler ce fichier dans votre répertoire de travail.
c0a.c |
---|
/* ------------------------------------ */
/* Save as : c0a.c */
/* ------------------------------------ */
#define CR 200.
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#include "f.h"
#include "dft.h"
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
double **DFT = dft( i_mZ(CR,CR), CR);
double **cDFT = conj_mZ(DFT, i_mZ(CR,CR) );
double **cDFTdivN = smul_mZ(1./CR,cDFT, i_mZ(CR,CR) );
double **F = r_mRZ(i_mZ(CR,C1),9);
double **Ft = i_mZ(CR,C1);
clrscrn();
p_mZ(DFT, S8,P3, S8,P3, C4);
printf(" DFT : \n");
stop();
clrscrn();
p_mZ(F,S8,P3,S8,P3,C4);
printf(" F : \n");
stop();
clrscrn();
mul_mZ(DFT,F,Ft);
p_mZ(Ft,S8,P3,S8,P3,C4);
printf(" Ft = DFT * F \n");
stop();
clrscrn();
p_mZ(cDFTdivN,S8,P3,S8,P3,C4);
printf(" 1/%.0f cDFT : \n",CR);
stop();
clrscrn();
mul_mZ(cDFTdivN,Ft,F);
p_mZ(F, S8,P3, S8,P3, C4);
printf(" F = 1/%.0f cDFT * Ft : \n",CR);
stop();
f_mZ(DFT);
f_mZ(cDFT);
f_mZ(cDFTdivN);
f_mZ(F);
f_mZ(Ft);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
DFT : #define CR 6.
+1.000 +0.000i +1.000 +0.000i +1.000 +0.000i +1.000 +0.000i
+1.000 +0.000i +0.500 -0.866i -0.500 -0.866i -1.000 +0.000i
+1.000 +0.000i -0.500 -0.866i -0.500 +0.866i +1.000 -0.000i
+1.000 +0.000i -1.000 +0.000i +1.000 -0.000i -1.000 +0.000i
+1.000 +0.000i -0.500 +0.866i -0.500 -0.866i +1.000 -0.000i
+1.000 +0.000i +0.500 +0.866i -0.500 +0.866i -1.000 +0.000i
+1.000 +0.000i +1.000 +0.000i
-0.500 +0.866i +0.500 +0.866i
-0.500 -0.866i -0.500 +0.866i
+1.000 -0.000i -1.000 +0.000i
-0.500 +0.866i -0.500 -0.866i
-0.500 -0.866i +0.500 -0.866i
Press return to continue.
Exemple de sortie écran :
F : #define CR 6.
+9.000 +0.000i
+5.000 +0.000i
-8.000 +0.000i
+2.000 +0.000i
+1.000 +0.000i
+5.000 +0.000i
Ft = DFT * F
+14.000 +0.000i
+15.500 +7.794i
+9.500 -7.794i
-10.000 +0.000i
+9.500 +7.794i
+15.500 -7.794i
Press return to continue.
Exemple de sortie écran :
F = 1/6 cDFT * Ft : #define CR 6.
+9.000 -0.000i
+5.000 -0.000i
-8.000 -0.000i
+2.000 +0.000i
+1.000 +0.000i
+5.000 +0.000i
Press return to continue.