1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
/****************************************************************************
COPYRIGHT NOTICE:
The source code in this file is provided free of charge
to the author's consulting clients. It is in the
public domain and therefore may be used by anybody for
any purpose.
AUTHOR:
Will Naylor
****************************************************************************/
#include <math.h>
#include "wnlib.h"
#include "wnasrt.h"
#include "wnmem.h"
#include "wnfft.h"
#define SIZE (1<<15)
local void print_vect(wn_cplx vect[],int size)
{
int i;
printf("[");
for(i=0;i<size;++i)
{
printf(" ");
wn_cplx_print(vect[i]);
}
printf("]\n");
}
void main(void)
{
wn_cplx *vect;
wn_cplx_make_vect(&vect,SIZE);
vect[0]->real = 1.0;
vect[1]->real = 1.0;
vect[2]->real = 1.0;
/*
print_vect(vect,SIZE);
*/
print_vect(vect,20);
wn_fft_vect(vect,SIZE);
print_vect(vect,20);
/*
*/
wn_inverse_fft_vect(vect,SIZE);
print_vect(vect,20);
/*
*/
}
|