MalLab, FFT and Centroid Frequency
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);

Im interested in finding the centroid frequency of this plot. I understand that the centroid freuency is given as :

  <img>![enter image description here][1]


  [1]: http://i.stack.imgur.com/VcVuz.png

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 dont know how to find the x(n) which is supposed to be a weighted frequency.


Best,
Abid
MalLab, FFT and Centroid Frequency
===

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);

Im interested in finding the centroid frequency of this plot. I understand that the centroid freuency is given as :

  <img>![enter image description here][1]


  [1]: http://i.stack.imgur.com/VcVuz.png

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 dont know how to find the x(n) which is supposed to be a weighted frequency.


Best,
Abid