00001
00002
00003
00004
00005
00006
00007 #include "nl.h"
00008
00009 int main()
00010 {
00011 size_t n, j;
00012 size_t* v;
00013
00014 double *re, *im;
00015
00016 n = 8;
00017
00018 re = nl_dvector_create(n);
00019 im = nl_dvector_create(n);
00020
00021 re[0] = 0; im[0] = 0;
00022 re[1] = 1; im[1] = 1;
00023 re[2] = 2; im[2] = 2;
00024 re[3] = 3; im[3] = 3;
00025 re[4] = 4; im[4] = 4;
00026 re[5] = 5; im[5] = 5;
00027 re[6] = 6; im[6] = 6;
00028 re[7] = 7; im[7] = 7;
00029
00030 printf("Исходный вектор:\n");
00031 nl_dvector_print(re, n, NULL);
00032 nl_dvector_print(im, n, NULL);
00033
00034 fft_transform(re, im, n);
00035
00036 printf("\nfft:\n");
00037 nl_dvector_print(re, n, NULL);
00038 nl_dvector_print(im, n, NULL);
00039
00040 fft_inverse(re, im, n);
00041
00042 printf("\nifft:\n");
00043 nl_dvector_print(re, n, NULL);
00044 nl_dvector_print(im, n, NULL);
00045
00046 nl_dvector_free(re);
00047 nl_dvector_free(im);
00048
00049 return 0;
00050 }