Phase amplitude coupling#
The measurement of phase amplitude coupling is a very commonly used and effective function. Below, I will provide a detailed explanation of the call parameters of functional phase amplitude coupling, as shown in source code, and give appropriate examples.
Single signal PAC#
We calculate phase amplitude coupling (PAC) in single channel, which means the phase modulation of a signal corresponds to the amplitude of the same signal.
selected_funcs is ‘pac_connectivity_mod’
- Selected Function:
pac_connectivity_mod__mod- Sample Frequency:
pac_connectivity_mod__sfreq: 250 Hz- Calculation Method:
pac_connectivity_mod__method: ‘tort’- Frequency Bands:
- PAC Phase Band:
[4, 8] (Theta)- PAC Amplitude Band:
[30, 45] (Gamma)- Mode:
pac_connectivity_mod__mode: ‘self’ (Single signal)We calculate PAC for a 250 Hz single channel using the ‘tort’ method for theta phase to gamma amplitude.
[ ]:
data = np.random.rand(2, 5, 1000)
fea1 = Feature(data = data, sfreq=250, selected_funcs = ['pac_connectivity_mod'],
funcs_params={
"pac_connectivity_mod__sfreq": 250,
"pac_connectivity_mod__method": 'tort',
"pac_connectivity_mod__band": np.array([[4, 8], [30, 45]]),
"pac_connectivity_mod__mode": 'self'
} )
[9]:
n_epcoh, n_channels, pac_value = fea1.features.shape
print(f"data.shape: {n_epcoh} epcoh X {n_channels} channels X {pac_value} pac_value")
[........................................] 100% | 0.07 sec | comodulogram: tort
data.shape: 2 epcoh X 5 channels X 1 pac_value
Different signals PACs#
The phase and amplitude modulation between different signals is similar to a functional connection between different signals.
selected_funcs is ‘pac_connectivity_mod’
- Selected Function:
pac_connectivity_mod__mod- Sample Frequency:
pac_connectivity_mod__sfreq: 250 Hz- Calculation Method:
pac_connectivity_mod__method: ‘tort’- Frequency Bands:
- PAC Phase Band:
[4, 8] (Theta)- PAC Amplitude Band:
[30, 45] (Gamma)- Mode:
pac_connectivity_mod__mode: ‘non-self’ (Different signals)We calculate PAC for a 250 Hz multi-channel using the ‘tort’ method for theta phase to gamma amplitude.
[ ]:
data = np.random.rand(2, 5, 1000)
fea2 = Feature(data = data, sfreq=250, selected_funcs=['pac_connectivity_mod'],
funcs_params={
"pac_connectivity_mod__sfreq": 250,
"pac_connectivity_mod__method": 'tort',
"pac_connectivity_mod__band": np.array([[4, 8], [30, 45]]),
"pac_connectivity_mod__mode": 'non-self'
} )
[11]:
n_epcoh, n_channels, n_channels = fea2.features.shape
print(f"data.shape: {n_epcoh} epcoh X {n_channels} channels X {n_channels} n_channels")
[........................................] 100% | 0.07 sec | comodulogram: tort
data.shape: 2 epcoh X 5 channels X 5 n_channels
Visualization of PAC#
[12]:
sns.heatmap(fea2.features[0])
[12]:
<Axes: >
fea2.features[k,i,j] represents that the i-th channel signal of theta phase modulate the j-th channel signal of gamma amplitude for k-th epcoh data.
[14]:
fig, ax = plt.subplots(figsize=(8, 8), facecolor="Black", subplot_kw=dict(polar=True))
plot_connectivity_circle(fea2.features[0], [f'Chan {i+1}' for i in range(n_channels)],
title = f'PAC connectivity', colormap = "hot", colorbar_size = 0.35, colorbar_pos = (0, 0.5), ax=ax)
[14]:
(<Figure size 800x800 with 2 Axes>,
<PolarAxes: title={'center': 'PAC connectivity'}>)