spike sorting and clustering using PCA

10 views (last 30 days)
Enock Boakye
Enock Boakye on 22 Feb 2019
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);

Answers (0)

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!