-
Notifications
You must be signed in to change notification settings - Fork 0
/
newSpikeExtract10232015.m
47 lines (34 loc) · 1.27 KB
/
newSpikeExtract10232015.m
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
40
41
42
43
44
45
46
47
handles.datatype = 'unClustered';
handles.params = set_parameters_CSC_TEST(sampFreq, fileName, handles);
[thrOut] = SpikeThresholdCreate(tempSpkData, handles, 'Min9sig');
filtSpkData = thrOut.Filtered;
threshold = thrOut.AveThresh;
[jat_Struct] = SpikeTimeExtract(filtSpkData, threshold, handles);
features = struct;
% Reduce dimensions and extract Waveforms of interest
tempWaves = jat_Struct.spkWaveforms;
% Waveform Structure
WaveIndex = tempWaves;
% Peak
features.Peak = max(tempWaves)';
% Valley
features.Valley = min(tempWaves)';
% Energy
features.Energy = trapz(abs(tempWaves))';
% Combine for WavePCA analysis
featsForPCA = horzcat(features.Peak,...
features.Valley,...
features.Energy);
% WavePC1
[~,features.WavePC1,~] =...
princomp(featsForPCA);
% Waveform Comparison (Bray-Curtis Index)
% Keep off during dbug TAKES a while to compute 6/10/2013
% features.WaveSimIndex.(strcat('L',num2str(disindex(fi)))) =...
% BrayCurtisIndex(tempWaves,disindex(fi));
% First & Second Derivative analysis
features.FSDE_Values =...
FSDE_Method(tempWaves');
% Derive Gaussian fit parameters for positive and negative
% component of waveform (Felsen and Thompson method)
[features.WaveFitParams, features.WaveSumDS] = WaveFormFit_SE(tempWaves);