spike sorting and clustering using PCA
10 views (last 30 days)
Show older comments
I am attempting to sort neural spikes but my code is giving me just an empty figure without the spikes
below is a copy of my code.
variance = rms(wave);
amplitude = (max(wave)-min(wave))/2;
SNR=snr(wave);
threshold = 4*variance;
[value, index]= findpeaks(wave, time, 'Threshold', threshold);
noise = 20 *randn(size(wave));
[~, loc] = ismember(index , time)
actionP= zeros(1, 180000);
potentialperiods = zeros(1, 180000);
for k = 1:numel(index)
actionP(k,:) = wave(loc(k)-20: loc(k)+40);
potentialperiods(k) = time(loc(k)-20: loc(k)+40);
end
figure(1);
hold on;
plot (potentialperiods, actionP);
0 Comments
Answers (0)
See Also
Categories
Find more on Electrophysiology in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!