The calculation of the Fourier transform value for any frequency from a set of samples is actually quite simple:
F(w)= sum[over all sample indices k] ( f(t_k) e^(i w t_k) )
According to the code, you are doing something like this:
float Fourier(float omega) {
Complex a(0.0);
for(int k=0; k<value.size(); ++k) {
float time= t_start + k*dt;
float theta= omega * time;
a+= value[k] * Complex(cos(theta), sin(theta));
}
return a;
}
, //time [] vector/array, , . ( , , , , ! - , ...)
, N , O (N ^ 2). - , O (N log N) .