cpp

 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
/*
* fourier.cpp
* FourierTransform
*
* Created by RJ Linton on 4/28/09.
* Copyright 2009 RJ Linton. All rights reserved.
*
*/
#include "fourier.h"
complex DFT(double functValue[], int compNum, int size){
complex z1, z2
double 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);
}