Find index max in Frequency domain

6 views (last 30 days)
Hi everyone!
I have one problem, I need to find the index max in frequency, on this signal
if you can see, it's centered in zero in X axis and Y axis, but when I try to find the index, this take the value when the signal doesn´t center.
to center the signal I used this, having Fs and Ts
m=abs(fft(signal));
magxF=fftshift(m);
f_esp = Fs/(length(signal));
f_inicial = -(Fs/2);
f_final = (Fs/2) - f_esp;
f_eje = f_inicial:f_esp:f_final;
plot(f_eje,magxF)
xlabel('(Hz)')
and to find the index I used
[maxval,idx] = max(magxF);
but returns values of this signal
How can I find the index Max for the signal centered ?
  2 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 22 Jun 2015
It's centered in X axis and Y axis : What does that mean?
Camilo  A Rincón
Camilo A Rincón on 24 Jun 2015
The signal must be symmetrical, having positive and negative frequencies. it means that the center should be in zero for X axis and Y axis.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 22 Jun 2015
No it is finding the index correctly, but what you want as output is not the index but rather the frequency. You will get the frequency as
f_eje(maxidx)

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!