フィルターのクリア

How to calculate the frequencies interval?

4 ビュー (過去 30 日間)
sh xx
sh xx 2022 年 12 月 21 日
回答済み: Cameron 2022 年 12 月 23 日
As showed below, how to calculate the frequencies interval in the red box?

回答 (1 件)

Cameron
Cameron 2022 年 12 月 23 日
I'm a little confused what you're asking, but if you have access to the x and y data then you should be able to use the findpeaks function. For example
x = 0:0.01:10; %simulate some time vector in seconds
y = sin(2.22*x); %simulate some y data
[~,loc] = findpeaks(y); %find peaks. You can check the documentation for additional arguements
plot(x,y,'-',x(loc),y(loc),'o') %plot the data just to see what you're looking at
f = 1/(x(loc(2)) - x(loc(1))); %frequency in Hz

カテゴリ

Help Center および File ExchangeDescriptive Statistics and Visualization についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by