# How do you calculate the phase locking value across trials of two matrics of EEG data (each matric include the EEG data for 31 channles across time)?

#### molan

##### Newbie
hi , i am working on a project that includes recordings from couples , i have been processing the data , but i am having difficulties with the phase locking value part .

i have been struggling for two weeks with this , i have searched everywhere and couldn't find anyone who can help , does anyone know about phase locking value and can help ?

also if this is not the right place to ask , where can i ask such questions ?

##### Super Moderator
Staff member
I'm guessing your aim is to synchronize 31 data bits arriving out of phase...?

By using 31 D flip-flops (D stands for delay or data), you can apply a single clock pulse to all 31, so each simultaneously admits a single bit (high or low datum).

31 highs or lows were applied to 31 data pins during the preceding 1/2 cycle. They arrived at various times, being out of phase. Adjust your clock timing to allow all 31 data to arrive. When clock goes high, all 31 data pass through 31 flip-flops simultaneously.

#### betwixt

##### Super Moderator
Staff member
The question is vague but I think they are trying to align 31 data sets rather than 31 bits of data. My guess is the data sets contain similar but out of step sets of periodic data samples and they need phase and possibly rates aligning so their shapes can be compared.

If I'm right, this is a mathematical problem rather than an an electronic one.

Brian.

#### FvM

##### Super Moderator
Staff member
I think the question is right in the DSP section, it's however rather specific. As far as I found by a few clicks, method of phase locking value is well explained in literature, there are also MATLAB program examples.

Regarding your question, I think that "calculate the phase locking value across trials of two matrics of EEG data" is not the usual and I presume no useful way to apply the method. The actual phase observed in each trial is arbitrary, PLV describes phase coincidence of channels, the coincidence pattern is characteristic but not the instantaneous phase. Respectively PLV is not calculated across trials, instead PLV patterns of multiple trials can be compared.