how can i find the value for the amplitude and frequency using fft?

2 views (last 30 days)
Hi everyone,
please i want to find the value for the maximum amplitude and the frequency. i used the abs of the fft for the amplitude but the amplitude value i am having does not tally with that from the figure (from the figure is around 2-2.2 while am having from the fft 8900). also, i used several methods from this page for the frequency value but its returning with a vector not value. The oscillations have no sampling frequency, so i used fs = 1/T.
Time = 0.2-0.3ms %the vector values= 250000x1 double
% to find the amplitude
p=signal
pt=signal time
t1=0.2
t2=0.3
pttt=find(pt>ti&pt<t2)
a=fft(pt(pttt))
aa=abs(a)
aa_max=max(aa) % it will give value of 8900
% to find the frequency value
f=find(aa==aa_max)
f_exst=(f(1,1)-1)*fs/N % but am not sure of the value it gives
Please i need your help
thanks

Answers (1)

KSSV
KSSV on 27 Feb 2019
Note that max gives you the index of the max value also.
[aa_max,idx] = max(aa)
  3 Comments
Abba Alhaji Bala
Abba Alhaji Bala on 28 Feb 2019
I use this code to extract
>>[aa_max,idx] = max(aa)
>>faa = max(aa);
>>f_exst=(faa(1,1)-1)*fs/N;
i dont know if this is how you mean i can extract the frequency
Thanks,

Sign in to comment.

Categories

Find more on Fourier Analysis and Filtering 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!