I have taken the FFT in Matlab in this given way.
X=fft(t); % Take Fourier Transform
T=abs(X); % Take real parts of transform
T=T(1:n/2);
I'm interested in finding the centroid frequency of this plot. I understand that the centroid freuency is given as:
Where x(n) represents the weighted frequency value, or magnitude, of bin number n, and f(n) represents the center frequency of that bin.
Now I am tempted to say that f(n) are the values from T in my script, but those are the absolute values of the imaginary and real components of the FFT and so I don't know how to find the x(n) which is supposed to be a weighted frequency.
You say that
f(n)
is the centre-frequency of the n-th bin; this is nothing to do with your data. It's simply a function of your sampling frequency:You can of course, factor this out in your above equation:
It sounds like
x
is what you've calledT
in your code.