Fourier transform calculation at any frequency

I know that if we have some data representing a certain wave, for example, the values โ€‹โ€‹of the image lines, we can use the Fourier transform to obtain the frequency function of this wave. But we have N values โ€‹โ€‹at the points x = 0 ... N-1 And at the output we get only N frequencies. Therefore, I want to analyze the wave everywhere in the range [0, N-1] For example, at the point u = 1,5. How can i do this?

+3
source share
3 answers

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); // think "a is for accumulator"
  for(int k=0; k<value.size(); ++k) {
    float time= t_start + k*dt;
    float theta= omega * time;  // this is (w t_k) from above
    a+= value[k] * Complex(cos(theta), sin(theta));
  }
  return a;
} // note, I have explicitly written out e^(i theta) = cos(theta) + i sin(theta)

, //time [] vector/array, , . ( , , , , ! - , ...)

, N , O (N ^ 2). - , O (N log N) .

+4
+1

It's been over 10 years since I did any of them, but I think Matlab has some FT methods that will let you do what you wanted. At least what we used in our linear signals and DSP classes

0
source

Source: https://habr.com/ru/post/1728175/


All Articles