필터 지우기
필터 지우기

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 CenterFile Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by