フィルターのクリア

NEED HELP, Need to find the period for a signal

2 ビュー (過去 30 日間)
Mohammad Sharifi
Mohammad Sharifi 2023 年 4 月 3 日
回答済み: Antoni Garcia-Herreros 2023 年 4 月 3 日
Hi,
I have the following signal:
I need to write a Matlab code to find the period T.
And plot the signal for 0 <= t <= T.
Can anyone Help?
Thank You in Advance!!

回答 (1 件)

Antoni Garcia-Herreros
Antoni Garcia-Herreros 2023 年 4 月 3 日
Hello Mohammad,
You could try something like this:
clear all
ts=0.001;
t=0:ts:0.6;
y=5*sin(8*pi*t)+6*sin(16*pi*t);
[p,peaks]=findpeaks(y,'MinPeakProminence',(max(y)-min(y))/4);
Period=mean([diff(peaks(1:2:length(peaks))), diff(peaks(2:2:length(peaks)))])*ts
Or you could work your way arround using autocorrelation

カテゴリ

Help Center および File ExchangeSignal Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by