Can we use xcorr() for continuous signals

조회 수: 4 (최근 30일)
Sadiq Akbar
Sadiq Akbar 2021년 5월 24일
편집: Sadiq Akbar 2021년 5월 24일
If we have two continuous signals as below: Then can we use xcorr() to find the correlation between them?
close all; clc; clearvars;
w = [pi/4 pi/4 pi/2]'; % Frequency
P = length(w); % Number of signals
N=10; % Number of data points in the generated signals
S=2*exp(1j*(w*(1:N))); % Three signals generated
x=S(1,:);
y=S(2,:);
[Cxy,F] = mscohere(x,y) % Coherence between x and y signals computed
figure('name', 'Coherence')
plot(F,Cxy)
title('Magnitude-Squared Coherence')
xlabel('Frequency (Hz)')
grid
[r,lags] = xcorr(x,y)
When two signals have different frequenies, they are called Uncorrelated signals.Likewise same frequency signals are called correlated signals.
Similarly when two signals start from same point, then they are coherent signals but if they start from different point, then they are non-coherent signals. In the above command [Cxy,F] = mscohere(x,y)
what is Cxy and what is F. Where is the starting point of the two signals stored here?
Likwise where is the frequency stored in the command [r,lags] = xcorr(x,y) as it finds correlation.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by