coherence plot and correlation plot,time domain to frequency domain

조회 수: 4 (최근 30일)
Hi ,
I have attached a sample data.I want to create a correlation as well as coherence plot for the attached time series data.
In order to understand the difference between time and frequency domain of time series I need to plot both correlation and coherence of same time series so that I can spot and understand the difference.Since I am new to the frequency domain concept I don't know how to measure coherence and how to make coherence plot.My understanding is that in order to measure coherence I would need to convert the time series that is in time domain to frequency domain.But I dont know how to do that.
Would highly appreciate if someone can help.

채택된 답변

Navya Seelam
Navya Seelam 2019년 7월 17일
Hi,
If you have the Signal Processing Toolbox, use the function "mscohere" to plot coherence.
n = 0:599;
x = cos(pi/4*n)+randn(size(n));
y = 1/2*sin(pi/4*n)+randn(size(n));
[Cxy,W] = mscohere(x,y);
Plot(W,Cxy)
You can obtain the correlation using the function "xcorr"
C=xcorr(x,y);
For more details check the MATLAB documentation of the above functions

추가 답변 (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