Skip to content

Example: Time-Frequency Analysis

This page explains the time_frequency_analysis_pipeline.signalJourney.json example file, which documents a typical time-frequency analysis using MNE-Python.

{
  "sj_version": "0.1.0",
  "schema_version": "0.1.0",
  "description": "Example signalJourney file for a time-frequency analysis pipeline using MNE-Python.",
  "pipelineInfo": {
    "name": "Time-Frequency Analysis (Morlet)",
    "description": "Calculates time-frequency representation using Morlet wavelets on epoched data and applies baseline correction.",
    "pipelineType": "time-frequency",
    "version": "1.0.0",
    "executionDate": "2024-05-02T12:00:00Z"
  },
  "processingSteps": [
    // ... steps detailed below ...
  ],
  "summaryMetrics": {
    "analysisType": "Time-Frequency",
    "method": "Morlet Wavelet",
    "frequencyRangeHz": [2.0, 40.0]
  }
}

Overview

The pipeline performs the following steps:

  1. Loads epoched EEG data (presumably cleaned, e.g., output from an ICA pipeline).
  2. Calculates TFR power using Morlet wavelets for frequencies between 2-40 Hz for a specific condition ("ConditionA").
  3. Applies baseline correction (log ratio) to the calculated power.
  4. Saves the baseline-corrected TFR power to an HDF5 file.

Key Sections Explained

  • pipelineInfo: Defines the pipeline name, description, type ("time-frequency"), etc.
  • processingSteps:
    • Step 1: Load Epoched Data
      • inputSources: Loads an epoched FIF file (*_epo.fif), potentially generated by a previous pipeline (pipelineSource: "ICA Decomposition").
      • outputTargets: Outputs the loaded data as an in-memory MNE Epochs object.
    • Step 2: Calculate TFR (Morlet)
      • dependsOn: ["1"].
      • software: MNE-Python, using mne.time_frequency.tfr_morlet.
      • parameters: Specifies the analysis parameters:
        • event_id: Selects epochs belonging to "ConditionA".
        • freqs: Defines the frequency range using start/stop/step.
        • n_cycles_formula: Shows how the number of wavelet cycles was determined (here, frequency-dependent).
        • Other parameters like use_fft, return_itc, decim.
      • inputSources: Takes the loaded Epochs object from Step 1.
      • outputTargets: Outputs the computed TFR power as an in-memory AverageTFR object.
    • Step 3: Apply Baseline Correction
      • dependsOn: ["2"].
      • software: MNE-Python, using the apply_baseline method of the TFR object.
      • parameters: Specifies the baseline period [-0.5, 0.0] seconds and the correction mode ("logratio").
      • inputSources: Takes the TFR power object from Step 2.
      • outputTargets: Saves the final baseline-corrected TFR power to a file (format: "HDF5").
      • qualityMetrics: Records the baseline period and mode used.
  • summaryMetrics: Provides overall information about the analysis performed, such as the type, method, and frequency range.

This example illustrates documenting time-frequency specific parameters, including how parameters like frequency ranges or wavelet cycles were defined, and linking to prior processing stages.