cpp file

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#include "fourier.h"
complex DFT(complex* functValue[], int compNum, int size){
complex z1, z2, omega;
omega = -2*PI*compNum/size;
for(int n = 0; size > n; n ++){
z1 = cos(omega*n)functValue[n];
z2 = sin(omega*n)functValue[n];
}
complex component = z1 + z2;
return(component);
}