0

Assuming that I convert a vector in time domain to frequency domain in C++ using Eigen's FFT. What FFT gives in return is a vector of complex numbers. My question is that how can I filter this (output) vector for some specific frequency and get the amplitude of that frequency.

vector<float> Tdomain(N);
vector<std::complex<float> > Fdomain;
Eigen::FFT<float> fft;
fft.fwd(Fdomain,Tdomain);

Or how can I even know if the given vector (the frequency domain) contains a specific frequency? This procedure seems to be more straightforward and visual in MATLAB, but how I can do it in C++?

Thanks in advance.

user2452253
  • 157
  • 2
  • 10
  • It should be much the same as for any other FFT implementation, see e.g. http://stackoverflow.com/questions/4364823/how-to-get-frequency-from-fft-result/4371627#4371627 for the frequency relationship. – Paul R Sep 19 '14 at 07:53
  • 1
    Agree. Pretty much the only difference with MATLAB is that DC is at 0, not 1, and TBH having DC at index 0 is the sane thing anyway. – MSalters Sep 19 '14 at 08:13
  • 1
    Thanks for the replies. I was however searching for duplicate questions for a while. Maybe the Eigen keyword limited my results. – user2452253 Sep 19 '14 at 09:50
  • 1
    Thanks @PaulR for the link. If you found more information please don't hesitate to share them. – user2452253 Sep 19 '14 at 09:51

0 Answers0