How do I find the period of a random signal?

40 vues (au cours des 30 derniers jours)
Henrique Moura
Henrique Moura le 26 Mai 2017
Commenté : Mousumi Nag le 7 Juil 2017
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?

Réponse acceptée

MathReallyWorks
MathReallyWorks le 26 Mai 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 commentaires
Henrique Moura
Henrique Moura le 26 Mai 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 le 7 Juil 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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by