Calculating the frequency of data

16 ビュー (過去 30 日間)
Sam J
Sam J 2022 年 2 月 10 日
コメント済み: Benjamin Thompson 2022 年 2 月 10 日
I have a data (length-time) that looks like this. I am trying to calculate the frequncy of this data. Is there any way that I can calcukate this frequncy based on the peak to peak position?

採用された回答

Benjamin Thompson
Benjamin Thompson 2022 年 2 月 10 日
If you can do it manually, I like ginput. You use the mouse to select the points of interest and ginput returns the x and y values of those points from the plot.
>> t = 1:0.01:5;
>> x = sin(2*pi*4*t);
>> figure, plot(t, x);
>> [a, b] = ginput(2)
a =
1.8249
2.0645
b =
0.9913
0.9854
>> 1/(a(2)-a(1))
ans =
4.1731
  4 件のコメント
Sam J
Sam J 2022 年 2 月 10 日
I have a lot of data like this to analyze. I am looking for a auomated way. Is there any to do it automatically?
Benjamin Thompson
Benjamin Thompson 2022 年 2 月 10 日
Use the fast fourier transform or fft function in MATLAB to map an input signal to the frequency spectrum. The signal processing toolbox also has some helpful things like findpeaks and pspectrum. You can also type "lookfor" followed by a key word to find functions that do things you want in MATLAB.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParametric Spectral Estimation についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by