How can I find Period of Signal
조회 수: 85 (최근 30일)
이전 댓글 표시
I have a signal which is X in code. I want to find this period. The ans is 0.0049 but I am not sure it is true. Is it the correct way to find period?
%%Time specifications:
Fs = 8000; % samples per second
dt = 1/Fs; % seconds per sample
StopTime = 0.25; % seconds
t = (0:dt:StopTime); % seconds
%%Sine wave:
Fc1 = 50; % hertz
Fc2 = 200;
Fc3 = 400;
Fc4 = 600;
x1 = sin(2*pi*Fc1*t+pi);
x2 = 0.5*cos(2*pi*Fc2*t + (pi/2));
x3 = (1/3)*sin(2*pi*Fc3*t + (pi/3));
x4 = 0.25*cos(2*pi*Fc4*t + (pi/4));
X = x1+x2+x3+x4;
ac=xcorr(X,X);
[~,locs]=findpeaks(ac);
mean(diff(locs)*dt)
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subspace Methods에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!