How to calculate a period of a wave when you don't have the equation of the wave

조회 수: 11 (최근 30일)
Hi guys,
I have this wave plotted in MATLAB for 10 periods. I only have the time and height arrays. What I would like is to calculate its period but I don't know how. I was thinking of finding all the values of time (X axis) when the height of the wave (Y axis) goes to 0 and then work from there. But one problem is that X is never 0 but only very close to zero except for the initial point height(1). Any help would be welcome! Thank you.

채택된 답변

Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017년 11월 5일
You can use findpeaks to detect the peaks in your wave and then use the spacing between peaks to determine periodicity.
[~,peaklocs] = findpeaks(wave);
period = mean(diff(peaklocs)); % peaks may not be exactly periodic, so take mean
This should work unless your wave is very noisy.
  댓글 수: 2
Nicolas Nicolaides
Nicolas Nicolaides 2017년 11월 5일
Thank you very helpful, I actually used this way!
Jeffrey Ostler
Jeffrey Ostler 2019년 4월 8일
편집: Jeffrey Ostler 2019년 4월 8일
This is exactly what I needed to find the period. I replaced 'wave' with (position,time) which were column vectors with data I'd imposted from my daq. Thanks so much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by