1 ) A machine readable storage medium containing a program element for execution by a computing device for performing spike and artifact detection in encephalogram (EG) data, said program element, comprising: a) a spike detection module for processing EG data to detect spikes, each spike being a candidate having a likelihood of being related to a physiological event of interest; b) an artifact detection module, said artifact detection module being operative for: i) for spikes detected by said spike detection module, computing respective models of events manifested by the respective spikes; ii) use the computed models to determine which spikes among the spikes detected by said spike detection module are highly likely to be artifacts; iii) filtering the spikes detected by said spike detection module on the basis of the computed models to produce filtered data; and iv) outputting the filtered data.