I know that if we have some data representing some wave, for example image line values,
we can use fourier transform to get frequency function of that wave.
But we have N values at points x=0…N-1
And we get only N frequencies at the output.
So I want to analyze the wave everywhere in the range [0, N-1]
For example at point u = 1.5.
How can I do it?
I know that if we have some data representing some wave, for example image
Share
Computing the Fourier transform value for any frequency from a set of samples is actually quite easy:
Code-wise, you do something like this:
If you have irregular sample times, you can use a time[] vector/array along with your value[] vector/array, instead of computing the time from the index. (However, be careful, since irregularly spaced samples don’t necessarily mean what you think they do! If this comment is in any way mysterious, stick with regular samples…)
The only problem is that, if you want to generate N regularly spaced frequencies based on regular samples, doing it the above way will take O(N^2) time. The Fast Fourier Transform is an algorithm that does this in O(N log N) time.