How do I find the period of a random signal?

43 views (last 30 days)
Let's imagine that a friend of mine made a vector with this following attributes:
x = 0:0.001:20
y = exp(-x/30).*sin((2*pi/5)*x)
xx = x(end);
t = [x x+xx x+2*xx x+3*xx];
f = [y y y y];
Then, I got a function like this
He saved the vector t and f and then he sent them to me.
What I have to do is to find the period of the signal f(t) at matlab using the data of t and f. I'm having some issues trying to do this... I can't find 20 as my period valor. I have already tried finding period with zero-crossing strategies, autocorelation, but nothing that I did was effective. Could you guys help me solving this?

Accepted Answer

MathReallyWorks
MathReallyWorks on 26 May 2017
Hello henrique,
Did you see Mohammad Abouali's answer on a similar question? How to calculate period of signal with matlab
If not then check it out. Autocorrelation is being used to find the period of signal.
  3 Comments
Henrique Moura
Henrique Moura on 26 May 2017
Ok, here's my code using the data my friend sent me.
clc %limpa comandos
clear %limpa variáveis
load('funcaoperiodica.mat'); %load the function
% f is my amplitude vector
% t is my time vector
% My fuction f = exp(-t/20).*sin((2*pi/5)*t) repeats itself at each 20 seconds
%as you guys can see in the graph I uploaded, then my period should be 20s.
%using the autocorrelation
esp = (t(end)-t(1))/length(t) %here I get the the space between my samples
ac=xcorr(f,f); %here the correlation
[~,locs]=findpeaks(ac); %here the peaks of the function
T = mean(diff(locs)*esp) %here te calculos of the period that shows me 5 instead of 20
If you don't understand something I said, just tell me that I will rewrite. I'm still learning english. ;)
Mousumi Nag
Mousumi Nag on 7 Jul 2017
@Henrique Moura: I am also working with a random signal to find its period. If you come across the way to solve your problem (that gives period value as 20), can you please share the steps here. Thanks in advance.

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!