coherence plot and correlation plot,time domain to frequency domain

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 件)

質問済み:

2019 年 7 月 1 日

回答済み:

2019 年 7 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by