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 Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by