<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Sofia,
<div class=""><br class="">
</div>
<div class="">Your issue is most likely caused by the fact that the input data that you use for ft_connectivityanalysis consists of just a single trial worth of data. In general, the computation of a correlation coefficient needs multiple paired observations.
 If there’s just a single data duplet, then the correlation will by definition be 1. FieldTrip’s connectivity routines require the observations to be represented as trials, i.e. a powspctrm that has a ‘dimord’ of ‘rpt_chan_freq(_time)’</div>
<div class=""><br class="">
</div>
<div class="">best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 3 Mar 2022, at 08:59, Stephen Whitmarsh via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Dear Sofia,
<div class=""><br class="">
</div>
It might be that something is either off with the input data, or your configuration of ft_connectivityanalysis. 
<div class=""><br class="">
</div>
<div class="">
<div class="">A) I would first check that the two channels of data you are using are not (highly) correlated, e.g. by just plotting (part of) them together.</div>
<div class="">
<div class="">B) Due to the fact you are using intracranial data of very closely spaced electrodes, more detail on their preprocessing would also be helpful; e.g. are you using bipolar references/CSD or a common references to both? </div>
<div class=""><br class="">
</div>
<div class="">Getting 1's indicate something is more probably off with your analyses though. To be able for people to evaluate that:</div>
<div class=""></div>
C) Share your configuration to both ft_connectivity, and the previous ft_freqanalysis, so that people can evaluate whether you are calling those functions correctly. Preprocessing steps will also be helpful.<br class="">
D) Do you get any error/warning messages at any point?</div>
<div class=""><br class="">
I hope this helps,<br class="">
Stephen</div>
</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, 2 Mar 2022 at 12:59, CARRION-FALGARONA Sofia via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="FR" style="overflow-wrap: break-word;" class="">
<div class="gmail-m_-8195808907421030428WordSection1">
<div class="">
<p class="MsoNormal"><span style="font-size:12pt" class="">Dear Community, <u class="">
</u><u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12pt" class="">I am Sofia and I work at the Brain Paris institute. I am currently looking at rodent’s brain activity within different brain’s region simultaneously by using deep multi-electrodes.<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12pt" class="">I am trying to use ft_correlationanalysis function in order to compare the power correlation of different channel through the time.<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12pt" class="">I was expecting to observe some fluctuation in the correlation but I obtained a matrix of  1…<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12pt" class="">Can someone help me in order to get the correct correlation between 2 channels ?
<u class=""></u><u class=""></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12pt" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><u class=""></u> <u class=""></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">stat  = ft_connectivityanalysis(cfgtemp, timefreq_alldata);
</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">disp( stat);</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">>> label: {2×1 cell}</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">   dimord: 'chan_chan_freq_time'</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">   powcorrspctrm: [2×2×50×801 double]</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">   time: [1×801 double]</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">   freq: [1×50 double]</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">   dof: 1</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">   cfg: [1×1 struct]</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class=""></span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">data_corr_temp  = stat.powcorrspctrm(1,1,:,:);</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">data_corr       = permute(data_corr_temp ,[3 4 1 2 ]);                 
</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">disp(data_corr);</span><span lang="EN-US" style="font-size: 12pt; font-family: "Courier New";" class=""><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">>> 1 1 1 1 1 1 1 1 1 1 . .
</span><span lang="EN-US" style="font-size: 12pt;" class="">. => actually return a Matrix of 50x801 of 1</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">
<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 12pt;" class="">I thank you for your help !<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 12pt;" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 12pt;" class="">Best Regards,
<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 12pt;" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 12pt;" class="">Sofia<u class=""></u><u class=""></u></span></p>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!5cfJ4Ncc5pfsMd3XfB7rN4IgV4Rihfl6_cc-r-4sNFN0L0u3yrapN_7AC7eqD-mC0dAWbCLglwvGsDh7zXHZ6FPhOOXwzeD2H7oSFg$" rel="noreferrer" target="_blank" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</blockquote>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!5cfJ4Ncc5pfsMd3XfB7rN4IgV4Rihfl6_cc-r-4sNFN0L0u3yrapN_7AC7eqD-mC0dAWbCLglwvGsDh7zXHZ6FPhOOXwzeD2H7oSFg$
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>