How to calculate period of signal with matlab

Technical Source
1 min readJan 19, 2021

--

Hi , I have the signal x2(t)=|cos(10*pi*t)|.How can i calculate its period with matlab?I am new matlab so each help will be usefull

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

use autocorrelation. If your data is periodic you should get high correlation once the lag time matches the period. here is an example:

x=0:0.1:20*2*pi;
y=sin(x); % so we know the period is 2*pi roughly 6.28
ac=xcorr(y,y);
[~,locs]=findpeaks(ac);
mean(diff(locs)*0.1)
ans = 6.2842

In a more complex data set including some noise you need to work around the find peaks a little bit. That might be too noisy.

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet