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

조회 수: 1 (최근 30일)
Abba Alhaji Bala
Abba Alhaji Bala 2019년 2월 27일
댓글: Abba Alhaji Bala 2019년 2월 28일
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

답변 (1개)

KSSV
KSSV 2019년 2월 27일
Note that max gives you the index of the max value also.
[aa_max,idx] = max(aa)
  댓글 수: 3
KSSV
KSSV 2019년 2월 27일
you have to extract the frequency of that index.
Abba Alhaji Bala
Abba Alhaji Bala 2019년 2월 28일
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,

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by