Find index max in Frequency domain
6 views (last 30 days)
Show older comments
Camilo A Rincón
on 22 Jun 2015
Commented: Camilo A Rincón
on 24 Jun 2015
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
Accepted Answer
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)
0 Comments
More Answers (0)
See Also
Categories
Find more on Axis Labels in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!