function [x,y] = spike_wave(v)

v = v(:)';

spikes = find(v ~= 0);

if ~isempty(spikes)
  x = [spikes; spikes; spikes];
  y = 0*x;
  y(2,:) = v(spikes);
else
  x = []; y = [];
end

x = [1, x(:)', length(v)];
y = [0, y(:)', 0];
