diff --git a/src/fft.c b/src/fft.c index 256d5ec..a282fe7 100644 --- a/src/fft.c +++ b/src/fft.c @@ -1,9 +1,15 @@ #include "fft.h" #include "settings.h" -/* if flag is EVEN (0), it takes only the even elements - * otherwise if flag is ODD (1) it takes only the odd ones - */ +/** + * FFT algorithm +*/ + +/** + * split an array + * - if flag is EVEN (0), take only even elements + * - else if flag is ODD (1) it takes only the odd ones +*/ cplx *split_array(cplx *a, const int len, const int flag) { int i, cnt = 0; @@ -18,17 +24,18 @@ return ret; } -/* recursively compute the fft on an array of complex numbers +/** + * recursively compute the fft on an array of complex numbers * splitting the array in two parts each recursion - */ +*/ cplx *_fast_ft(cplx *compArray, const int len) { cplx omegaN, omega; cplx *evenA, *oddA, *transformedA; int i; - /*termination*/ - if(len == 1){ + // recursive termination + if(len == 1) { return compArray; } @@ -51,17 +58,11 @@ return transformedA; } -void -print_components(cplx *a, const int len) -{ - int i; - for(i=0; i