从公式详解相位滞后指数(Phase-Lag Index, PLI)的两种计算方式

一、什么是相位滞后指数?

PLI是基于相位滞后的连通性方法,该方法告诉我们(以下是我看到的两种不同解释):

  1. 某一时刻(timePoint)不同试验(trial)收集到的两个信号的相角差在复平面的投影是否始终指向同一侧(虚轴的正侧 或 虚轴的负侧)。(这个与PLV的计算有点类似)
  2. 某一段时间内(timePeriod收集到的 两个信号的相角差 在复平面的投影是否始终指向同一侧(虚轴的正侧 或 虚轴的负侧)。
    PLI可以忽略由体积效应引起的0和pi的相角差。

二、为什么要忽略0和pi的相角差

在这里插入图片描述

在这里插入图片描述

三、复平面上的相位差

在这里插入图片描述
在这里插入图片描述

四、PLI的计算

在这里插入图片描述
在这里插入图片描述

五、MATLAB实现PLI

function PLI = PhaseLagIndex(X, trialTimePoint, timePeriod)
    %% Given a multivariate data, returns phase lag index matrix
    % trialTimePoint and timePeriod decide which PLI to perform.
    % trialTimePoint and timePeriod are both 0 or 1,select timePeriod.
    % Modified the mfile of 'phase synchronization'
    % X: channel * timePoint * trial
    if trialTimePoint==1 && timePeriod==1
        trialTimePoint = 0;
    end
    if trialTimePoint==0 && timePeriod==0
        timePeriod = 1;
    end

    numChannels = size(X, 1); 
    numtimePoint = size(X, 2); 
    numTrials = size(X, 3); 

    %% Obtain the instantaneous phase of each channel by Hilbert transform
    dataP = zeros(size(X));
    for channelCount = 1:numChannels
        dataP(channelCount, :, :) = angle(hilbert(squeeze(X(channelCount, :, :))));
    end
    
    % whether the projections of phase angle differences collected from different trials at a given moment always point to the same side in the complex plane
    if trialTimePoint == 1
        %% Calculation of PLI
        PLI = ones(numtimePoint, numChannels, numChannels);
        for ch1 = 1:numChannels-1
            for ch2 = ch1+1:numChannels
                %%%%%% phase lage index
                PDiff = squeeze(dataP(ch1,:,:)) - squeeze(dataP(ch2,:,:));  % hase difference at each time point
                PLI(:,ch1,ch2) = abs(sum(sign(sin(PDiff)), 2)/numTrials);   % only count the asymmetry
                PLI(:,ch2,ch1) = PLI(:,ch1,ch2);
            end
        end
    end
    
    % Whether the projections of the phase angle differences collected in a given time period 
    % always point to the same side of the complex plane 
    % (positive side of the imaginary axis or negative side of the imaginary axis).
    if timePeriod == 1
        % Phase averaging between trials
        phi1 = mean(dataP, 3);
        ch = numChannels;
        %% Calculation of PLI
        PLI = ones(ch,ch);
        for ch1=1:ch-1
            for ch2=ch1+1:ch
                %%%%%% phase lage index
                PDiff=phi1(ch1,:)-phi1(ch2,:); % phase difference
                PLI(ch1,ch2)=abs(mean(sign(sin(PDiff)))); % only count the asymmetry
                PLI(ch2,ch1)=PLI(ch1,ch2);
            end
        end
    end
end

在这里插入图片描述

六、计算结果差异

下面是我用这两种方法计算的某一时间区间的PLI,很明显这两个差别很大,我也不晓得哪个才是对的,但我更倾向于第一个,n表示trial的个数。
在这里插入图片描述
n表示trial时,要计算某区间的PLI:先计算每一个时刻的PLI,得到所有时刻的PLI后,再对所需的时间区间的PLI取平均。
在这里插入图片描述

  • 12
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 12
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值