Cross-frequency coupling

Analyze an example data set

# Load modules we'll need.
from scipy.io import loadmat
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import spectrogram

Step 1: Load the data and look at it.

Q. Do you observe evidence of cross-frequency coupling?

Conclusions

# Load the data.
data = loadmat('Data/LFP-1.mat')      # Load the data,
t    = data['t'][0]                   # ... extract t, the time variable,
LFP  = data['LFP'][0]                 # ... and LFP, the voltage variable.
dt   = t[1] - t[0]                    # Define the sampling interval,
fNQ  = 1 / dt / 2                     # ... and Nyquist frequency. 
plt.plot(t,LFP);

Spectral analysis

Q. What rhythms are present in the data?

Conclusions

# Compute the spectrum.

Phase-amplitude coupling (Step 1)

Q. Filter the data into low and high frequency bands. What frequency bands will you choose?

Q. Visualize the data; does the filtering make sense?

Conclusions

from scipy import signal

# Low frequency band.
Wn = [??,??];                       # Set the passband [??-??] Hz,
n = 100;                            # ... and filter order,
                                    # ... build the bandpass filter,
b = signal.firwin(n, Wn, nyq=fNQ, pass_zero=False, window='hamming');
Vlo = signal.filtfilt(b, 1, LFP);   # ... and apply it to the data.

# High frequency band.
Wn = [??, ??];                      # Set the passband [??-??] Hz,
n = 100;                            # ... and filter order,
                                    # ... build the bandpass filter,
b = signal.firwin(n, Wn, nyq=fNQ, pass_zero=False, window='hamming');
Vhi = signal.filtfilt(b, 1, LFP);   # ... and apply it to the data.

Phase-amplitude coupling (Step 2)

Q. How do you extract the amplitude and phase from the filtered signals?

Q. For Vhi and Vlo, we need to compute the analytic signal, and then the phase or amplitude. What Python functions do you need?

Q. Visualize the amplitude and phase; does it make sense?

Conclusions

# Compute the amplitude and phase.

Phase-amplitude coupling (Step 3)

Q. Determine if the phase and amplitude are related by making a phase-amplitude histogram. What is the value of the statistic h?

Q. Does this result suggest CFC occurs in these data?

Q. If no CFC occurred in the data, what would you expect to find in the plot of average amplitude versus phase?

Conclusions

# Plot the amplitude-phase histogram.