Hi,
I have applied a phase amplitude coupling analysis to my data. I chose the range 1 to 8 hz for the phase (width=2), and 8 to 120 for the amplitude frequencies (width=4).
When I run the analysis, I am faced with two problems.
- for a couple of subjects I get missing data in the comodulogram:
I cannot understand why I get these empty columns for low frequencies only for a few subjects, when I applied to all participants the same exact pre-processing steps.
- For those participants with full comodulogram (e.g., see image below), I also feel the pattern of results is a bit at odds compared to what I have observed in other studies. Apart from the 0 PAC values at 50Hz (which is noise due to a nearby electronic device - I still have to use a notch filter), it seems strange to me to see these relatively high PAC at lower phase frequencies almost along the whole column of amplitude frequencies. Is there something wrong? For those expert in PAC analysis, can you spot a potential problem?
Here is part of the code:
import tensorpac
from tensorpac import Pac
time_delay = (1.5,3)
time_delay_idx = slice(*[np.argmin(abs(phase['1'].times - t)) + i for t,i in zip(time_delay, (0,1))])
sf = 256
pac_ato = []
pac_atb = []
subjects = list(range(1,37))
for i in subjects:
print(i)
p_obj = Pac(idpac=(2, 0, 0), f_pha=(1, 8,2,0.2), f_amp=(8,120,4,1))
pac_electrodes_ato = []
pac_electrodes_atb = []
for e in range(0,64): #electrodes
# condition 1
pha_p_ato = p_obj.filter(sf, EEG[f'{i}'][act].copy()._data[:,e,:], ftype='phase')
amp_p_ato = p_obj.filter(sf, EEG[f'{i}'][act].copy()._data[:,e,:], ftype='amplitude')
pha_delay_ato, amp_delay_ato = pha_p_ato[..., time_delay_idx], amp_p_ato[..., time_delay_idx]
pac_delay_ato = p_obj.fit(pha_delay_ato, amp_delay_ato).mean(-1)
pac_electrodes_ato.append(pac_delay_ato)
# condition 2
pha_p_atb = p_obj.filter(sf, EEG[f'{i}'][cont].copy()._data[:,e,:], ftype='phase')
amp_p_atb = p_obj.filter(sf, EEG[f'{i}'][cont].copy()._data[:,e,:], ftype='amplitude')
pha_delay_atb, amp_delay_atb = pha_p_atb[..., time_delay_idx], amp_p_atb[..., time_delay_idx]
pac_delay_atb = p_obj.fit(pha_delay_atb, amp_delay_atb).mean(-1)
pac_electrodes_atb.append(pac_delay_atb)
pac_ato.append(pac_electrodes_ato)
pac_atb.append(pac_electrodes_atb)
Then to show the graph for one participant I used e.g.:
p_obj.comodulogram(np.mean(np.array(pac_ato)[0],axis=0))
Many thanks for your help!