-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathEx01_testPCA.m
More file actions
38 lines (34 loc) · 1.13 KB
/
Ex01_testPCA.m
File metadata and controls
38 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
% Principal component analysis
%
% BMI500 Course
% Lecture: An Introduction to Blind Source Separation and Independent Component Analysis
% By: R. Sameni
% Department of Biomedical Informatics, Emory University, Atlanta, GA, USA
% Fall 2020
%
% Dependency: The open-source electrophysiological toolbox (OSET):
% https://github.com/alphanumericslab/OSET.git
% OR
% https://gitlab.com/rsameni/OSET.git
%
clc
clear
close all
example = 1;
switch example
case 1 % Load a sample EEG signal
load EEGdata textdata data % A sample EEG from the OSET package
fs = 250;
x = data'; % make the data in (channels x samples) format
% Check the channel names
disp(textdata)
case 2 % Load a sample ECG signal
load SampleECG2 data % A sample ECG from the OSET package
fs = 1000;
x = data(:, 2:end)'; % make the data in (channels x samples) format
x = x - LPFilter(x, 1.0/fs); % remove the lowpass baseline
otherwise
error('unknown example');
end
N = size(x, 1); % The number of channels
T = size(x, 2); % The number of samples per channel