-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsepa_subjectNormalizedSiteScores.m
More file actions
40 lines (28 loc) · 1.24 KB
/
sepa_subjectNormalizedSiteScores.m
File metadata and controls
40 lines (28 loc) · 1.24 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
38
39
function [zHi, zLo] = sepa_subjectNormalizedSiteScores(eegDataBlob, overlap, duration)
% [zHi zLo] = sepa_subjectNormalizedSiteScores(eegDataBlob, overlap, duration)
%
% Program to get the z-scores for alpha power at each electrode site,
% normalized across sites for a single subject. Returns a list of 14 z
% scores, ordered by site. Computes for both high and low alpha a la Smith
% et al. (2016) Neuropsychologia 85, 118-126.
%
% MDT
% 2017.02.23 ALPHA
% Setup and Defaults:
if nargin < 3
duration = 4; % Default 4 seconds per epoch
end
if nargin < 2
overlap = 0.50; % New setting for more smoothing for EPOC
end
% Obtain the average power spectrum:
[aps, freq, ~] = averagePowerSpectrum(eegDataBlob.data, eegDataBlob.Fs, duration, overlap);
% Pick out alpha power for each site
hiAlphaIndex = find(freq > 10 & freq <= 13);
loAlphaIndex = find(freq >= 8 & freq <= 10);
siteHiAlphaPowers = sum(aps(hiAlphaIndex, :));
siteLoAlphaPowers = sum(aps(loAlphaIndex, :));
% Divide by sum of alpha power then z-score:
zHi = zscore(siteHiAlphaPowers ./ sum(siteHiAlphaPowers));
zLo = zscore(siteLoAlphaPowers ./ sum(siteLoAlphaPowers));
end