PLV:相位同步信息在时域的计算值
分别计算两个通道数据的希尔伯特变换,然后计算数据的瞬时相位差值,然后根据所有点的相位差计算自然常数为底的指数,将指数的绝对值求和平均,得到PLV的值
值的区间是0-1,0说明相位完全没同步
Matlab函数:文末有附
https://www.mathworks.com/matlabcentral/fileexchange/31600-phase-locking-value
用法:
脑电数据格式是16个通道x840个数据点x80个trial
采样率1200Hz
滤波区间8-12Hz
绘制3通道和4通道的PLV值
eegData=samples(:,:,find(labels==0));
srate = 1200; %Hz
filtSpec.order = 50;
filtSpec.range = [8 12]; %Hz
[plv] = pn_eegPLV(eegData, srate, filtSpec);
figure;
plot(squeeze(plv(:,3,4)));
xlabel('Time (s)');
ylabel('Plase Locking Value');
结果:
函数:
function [plv] = pn_eegPLV(eegData, srate, filtSpec, dataSelectArr)
% Computes the Phase Locking Value (PLV) for an EEG dataset.
%
% Input parameters:
% eegData is a 3D matrix numChannels x numTimePoints x numTrials
% srate is the sampling rate of the EEG data
% filtSpec is the filter specification to filter the EEG signal in the
% desired frequency band of interest. It is a structure with two
% fields, order and range.
% Range specifies the limits of the frequency
% band, for example, put filtSpec.range = [35 45] for gamma band.
% Specify the order of the FIR filter in filtSpec.order. A useful
% rule of thumb can be to include about 4 to 5 cycles of the desired
% signal. For example, filtSpec.order = 50 for eeg data sampled at
% 500 Hz corresponds to 100 ms and contains ~4 cycles of gamma band
% (40 Hz).
% dataSelectArr (OPTIONAL) is a logical 2D matrix of size