BME | EEG Analysis - Hilbert Transform
Hilbert Transform | Hilbert Transform
Basic procedure: Start with a bandpass filter, then apply the Hilbert transform to obtain a complex signal, which separates amplitude and phase.
Objective: Obtain instantaneous amplitude and phase by adding the imaginary part to the real signal.
📌 We do not alter the real part; we only add the imaginary part on top of it.
Mathematical Definition
Assuming we have a signal named real(t)real(t)real(t), the Hilbert transform is given by:
real(t)+i∗imag(t)rea ...
BME | EEG Analysis - Wavelet Transform
Basic Concept: Wavelet Transform
The wavelet transform uses a group of short kernels (wavelets) of different frequencies convolved with the original signal. Thus, the signal only needs to be stable over the length of the wavelet (stationary).
Similar to Fourier transform, when the signal frequency matches the wavelet frequency, the dot product yields larger amplitude results.
Wavelet convolution can be utilized as a band-pass filter.
Convolution Kernels
Types of Wavelets
There are various types ...
BME | EEG Analysis - Fourier Transform
Fourier Transform
Mathematical Definitions
Discrete Fourier Transform (DFT) Definition:
Fn=∑k=0N−1fke−2πink/NF_n= \sum_{k=0}^{N-1} f_k e^{-2\pi ink/N}
Fn=k=0∑N−1fke−2πink/N
Continuous Fourier Transform (CFT) Definition:
F(v)=∫−∞+∞f(t)e−2πivtdtF(v)=\int_{-\infty}^{+\infty} f(t)e^{-2\pi ivt}dt
F(v)=∫−∞+∞f(t)e−2πivtdt
Discrete Inverse Fourier Transform (IDFT) Definition:
fk=1n∑n=0N−1Fne2πink/Nf_k= \frac{1}{n}\sum_{n=0}^{N-1} F_n e^{2\pi ink/N}
fk=n1n=0∑N−1Fne2πink/N
Continuous Inverse Fouri ...
BME | EEG Analysis - Preprocessing
Organize Data
Cleanse the imported data into the required structure. Select data types (such as cell types in MATLAB, multidimensional matrix types, structure types, etc., in Python including tuples, lists, dictionaries, np.array, MNE data structures, etc.)
Understand the fundamental aspects of the dataset: the number of channels, patients, the stored content in each dataset, the size of the dataset, etc.
Re-reference
Data obtained from online sources or EEG machines are typically reference-fre ...
BME | EEG Analysis - Matlab Basics
Matlab Basics
size(x): Dimensions of matrix x.
length(x): Maximum length across all dimensions of x.
zeros(1,2): Generates a matrix of zeros with 1 row and 2 columns.
ones(2,3): Generates a matrix of ones with 2 rows and 3 columns.
eye(2): Creates a 2x2 identity matrix with 1s on the diagonal and 0s elsewhere.
round(x): Rounds x to the nearest integer.
ceil(x): Rounds x up to the nearest integer.
floor(x): Rounds x down to the nearest integer.
repmat([1,2],2, 3): Replicates the array [1,2] into ...
BME | Anatomy - Respiratory System
Respiratory System
Respiration: The process of gas exchange between the body and the external environment.
Respiratory Tract: Nose, Pharynx, Larynx, Trachea, Bronchi.
Lungs: Site for gas exchange.
External Respiration: Gas exchange between blood in the pulmonary capillaries and the external environment.
Internal Respiration: Gas exchange between blood in the tissue capillaries and the tissue cells.
Pulmonary Ventilation: Gas exchange between the lungs and the external environment.
Pulmonary Gas ...
BME | EEG Analysis - Convolution and Dot Product
Dot Product
Mathematical Definition
Assuming two input vectors, x=[x1,x2,...,xn]x = [x_1, x_2, ..., x_n]x=[x1,x2,...,xn] and y=[y1,y2,...,yn]y = [y_1, y_2, ..., y_n]y=[y1,y2,...,yn], the dot product is calculated as:
x⋅y=∑i=1nxiyi=x1y1+x2y2+...+xnynx \cdot y = \sum_{i=1}^n x_i y_i = x_1y_1+x_2y_2+...+x_ny_n
x⋅y=i=1∑nxiyi=x1y1+x2y2+...+xnyn
Code
MATLAB Code:
12z = dot(x, y)z = x * y'
Python Code
1z = np.dot(x, y)
Convolution
Mathematical Definitions
Discrete Convolution Defini ...
BME | EEG Analysis - Introduction
Neural Time Series Data Types
EEG (electroencephalogram) measures electrical activity through field changes.
Scalp EEG: Non-invasive, resembling wearing a cap on the head.
iEEG (intracranial EEG): Invasive, requires a craniotomy.
Stereotactic EEG / Depth electrode: Embedded deep within brain tissue.
ECoG (electrocorticogram): Surface-level measurement on the brain cortex.
MEG (magnetoencephalogram): Measures magnetic field changes.
fMRI/PET: Measures blood flow changes, typically using BLOD.
LF ...
BME | Anatomy - Circulatory System
Fluid Distribution, Internal Environment Homeostasis, Blood Components, and Functions
Fluids: Intracellular and Extracellular
Internal Environment: Extracellular Fluid
Blood Components: Plasma + Blood Cells (Red Blood Cells + White Blood Cells + Platelets)
Functions of Blood: Transportation, Defense and Protection, Maintaining Homeostasis
Blood
Plasma
Plasma Proteins: Albumin (maintains blood colloid osmotic pressure), Globulin, Fibrinogen (involved in clotting)
Non-protein Nitrogen: Nitrogen-c ...
BME | Anatomy - Musculoskeletal System
Overview of the Musculoskeletal System
Components of the Musculoskeletal System: Bones, Joints, Spinal Bones
Composition of the musculoskeletal system: Bones, Bone Connections, Skeletal Muscles.
Functions of the skeleton: Provides basic body shape, supports body weight, protects vital organs.
Number of bones: Total of 206.
Classification of bones: Long bones, Short bones, Flat bones, Irregular bones.
Bone structure: Periosteum (nutritional function), Bone tissue, Bone marrow.
Chemical compositio ...